Filter löschen
Filter löschen

Set text in GUI figure axis

11 Ansichten (letzte 30 Tage)
John
John am 14 Mär. 2012
Hi,
I would like to annotate a plot in an axes in a gui built with guide.
in the text call how do I specify the figure (for the gui) and the axis I want it to plot in?
Currently if I simply write:
text(xtp_ac,ytp_ac,'ATF-01');
I get it plotting correctly on the first call, but on the next update it doesn't plot and it opens a new figure.
I think I need to do something along the lines of:
text('FigureHandle',____,'AxesHandle',_____,xtp_ac,ytp_ac,'ATF-01');
however when I do this the figure just continuously opens and closes a couple of times a second rendering it useless.
The program I have written plots an objects position as it moves around over a map. I want to be able to give it a label to identify it as I have more than one plotted at the same time.
Thanks in advance.

Akzeptierte Antwort

Jacob Halbrooks
Jacob Halbrooks am 14 Mär. 2012
A look through the documentation for TEXT properties shows the Parent property, which lets you specify an axes:
ax=axes;
text(0.5, 0.5, 'My text', 'Parent', ax);
To give an identifier to a TEXT you create, consider using the Tag property.
  2 Kommentare
Jan
Jan am 14 Mär. 2012
Specifying the axes handle is enough, because this defines the corresponding figure uniquely already.
John
John am 14 Mär. 2012
Thank you to both of you!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by