How can I add the arrow to the graph like this picture ?

365 ビュー (過去 30 日間)
Nguyen Trong Nhan
Nguyen Trong Nhan 2013 年 12 月 23 日
コメント済み: Image Analyst 2013 年 12 月 23 日
I make a plot in GUI, How can I add the arrow on the graph like the picture ? help me. Thanks you very much.

採用された回答

Image Analyst
Image Analyst 2013 年 12 月 23 日
Nguyen, there is an annotation function that will do arrows:
annotation('arrow',x,y)
annotation('doublearrow',x,y)
annotation('textarrow',x,y)
But the arrows are straight, not curving/swooping . To get curved arrows like you showed, you'd have to create the curving/swooping lines and then use plot() to plot them. Then you'd have to set "hold on" and call annotation to put a small arrow on top of the curving line you drew with plot().
  2 件のコメント
Nguyen Trong Nhan
Nguyen Trong Nhan 2013 年 12 月 23 日
編集済み: Nguyen Trong Nhan 2013 年 12 月 23 日
I want the arrow lying on graph to point the direction of thermodynamics cycle. How I have to use annotation to do that ? Could you give me an example.I'm freshman in Vietnam. Hope you help me. thanks
Image Analyst
Image Analyst 2013 年 12 月 23 日
plot(x,y, 'k-');
annotation('arrow', [.3 .5], [.6 .5]);

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

その他の回答 (1 件)

Youssef  Khmou
Youssef Khmou 2013 年 12 月 23 日
編集済み: Youssef Khmou 2013 年 12 月 23 日
Nguyen, That is thermodynamic cycle, there might be a solution, however try this temporary example :
X=[2 4 4 2 2]; Y=[2 1 5 7 2];
plot(X,Y)
axis([0 7 0 7])
xlabel('Volume'), ylabel('Pressure');
Try then to put carefully the arrows with these commands :
gtext('>','FontSize',20,'Rotation',-30);
gtext('<','FontSize',20,'Rotation',-30);
gtext('<','FontSize',20,'Rotation',-90);
gtext('<','FontSize',20,'Rotation',90);
Try to choose the right angle in the property "Rotation" .

カテゴリ

Help Center および File ExchangeThermodynamics and Heat Transfer についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by