specifying the handle as you plot

2 Ansichten (letzte 30 Tage)
Stephen
Stephen am 22 Mai 2012
if I try to plot the following:
plot(0.5,0.5)
Is there any way to specify what handle the object will have while using plot? I want to avoid looking through the children of my axes, i.e.
handles = get(gca,'children')
and just be able to change the settings of that one object with:
set(handles(?),'xdata',1.5)
Thanks

Akzeptierte Antwort

Honglei Chen
Honglei Chen am 22 Mai 2012
h = plot(0.5,0.5)
returns the handle in h
  1 Kommentar
Stephen
Stephen am 22 Mai 2012
ahhh, of course! thank you so much!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Walter Roberson
Walter Roberson am 22 Mai 2012
Record the output of plot() and use that, such as
h = plot(0.5, 0.5)
Then you can
set(h, 'xdata', 1.5)

Kategorien

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

Community Treasure Hunt

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

Start Hunting!

Translated by