Problem to plot graph....
1 view (last 30 days)
Show older comments
any one have idea about plot graph in matlab.. i want to draw a graph with string annotation. i have three array x=[1,2,3,4,5]; y=[2,3,4,5,6]; z=[{'1'},{'2'},{'3'},{'4'},{'5'}]; using by this plot(x,y,'.') we can plot graph but i want z array value in place of '.' how it's possible??????
0 Comments
Accepted Answer
Grzegorz Knor
on 3 Nov 2011
Use text command:
2 Comments
Grzegorz Knor
on 3 Nov 2011
In your case:
x=[1,2,3,4,5]; y=[2,3,4,5,6]; z=[{'1'},{'2'},{'3'},{'4'},{'5'}];
plot(x,y,'.')
for k=1:length(x)
text(x(k),y(k),z{k},'HorizontalAlignment','center','VerticalAlignment','middle')
end
More Answers (0)
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!