Problem to plot graph....

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??????

 採用された回答

Grzegorz Knor
Grzegorz Knor 2011 年 11 月 3 日

0 投票

2 件のコメント

Grzegorz Knor
Grzegorz Knor 2011 年 11 月 3 日
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
Hemanshu rana
Hemanshu rana 2011 年 11 月 3 日
thanks.....

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraph and Network Algorithms についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by