page

Oct 8, 2019

MATLAB - Data label on each point in xy scatter

https://stackoverflow.com/questions/7100398/data-label-on-each-entry-in-xy-scatter



p = rand(10,2);
scatter(p(:,1), p(:,2), 'filled')
axis([0 1 0 1])

labels = num2str((1:size(p,1))','%d');    %'
text(p(:,1), p(:,2), labels, 'horizontal','left', 'vertical','bottom','Fontsize', 7)

No comments:

Post a Comment