Display colored labels in plots with matlab
I'm using the fol开发者_StackOverflow社区lowing commands to plot a set of points on a 2d map in matlab
labels = {'label1', ' label2', 'label3',...) plot(score(:,1),score(:,2), '*') gname(lables)
Is there a way to choose the color for each label?
Thanks
Return vector of label handles, then you can set color (as well as other text properties) for all or individual labels.
h = gname(lables);
set(h,'color','r') %# set all labels to red
set(h(2),'color','g') %# set 2nd label to green
精彩评论