GUI - Text to label scatter plot data gets ignored / only works when running function multiple times
1 回表示 (過去 30 日間)
古いコメントを表示
Hi all,
The following function in a GUI (linked to a push button) displays a scatter plot, which works fine However, the TEXT function to label the data points does not work (without an error message being shown), no data labels are being displayed. It sometimes works after running the function multiple times but also without clear pattern. Any ideas?
Thanks for the help!
%Create Chart
x_axis = data.DUR_ADJ_MID(issuer,:);
y_axis = data.YAS_ZSPREAD(issuer,:);
c_colour = colourcode(issuer,:);
scatter(handles.CHART1,x_axis,y_axis,12,c_colour,'filled');
title(handles.CHART1,'Market Screening');
xlabel(handles.CHART1,'Mod. Duration');
ylabel(handles.CHART1,'Z-Spread');
ylim(handles.CHART1,[ZS_MIN ZS_MAX]);
text(x_axis+0.02,y_axis,data.SECURITY_DES(issuer,:),'FontSize',7,'Color',[1 1 1]);
set (handles.CHART1, 'Color', [0 0 0] );
set (handles.CHART1, 'XColor', [1 1 1] );
set (handles.CHART1, 'YColor', [1 1 1] );
0 件のコメント
回答 (1 件)
Sid
2015 年 6 月 30 日
Should there be a hold on between ylim and text?
Also, one thing I find useful when setting axes is to have a clear axes set up at the beginning of the plot handle I am about to plot in. That way, I am always sure that there are not artifacts from the previous plot left behind.
HTH.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!