How to annotate specific axes in a GUI

3 ビュー (過去 30 日間)
Adam
Adam 2014 年 7 月 8 日
コメント済み: Adam 2014 年 7 月 11 日
I have created a GUI with more than one axes. I wish to annotate a plot in one of them using the annotation function, for example: h = annotation( 'textbox', [ 0 0 1 1 ] ). However the coordinates are understood by Matlab with respect to the entire GUI figure and annotation does not accept the Parent property (that would solve the problem immediately, and curiously enough set( h ) or get( h ) do show Parent as one of the fields of h). Is there a simpler solution that calculating the position of the axes within the GUI figure and then computing the position of the annotation object with respect to the figure so it positions properly on the axes, which is rather a cumberome excercise?

回答 (1 件)

Ben11
Ben11 2014 年 7 月 8 日
It might sound trivial, but what if you set the axis in which you want to add text the "current axis" just before actually placing the text?
Eg:
axes(YourAxis);
text(x,y,'YourString')
Is that what you mean?
  1 件のコメント
Adam
Adam 2014 年 7 月 11 日
No, it doesn't. It was the first thing I have tried.

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

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by