specifying the handle as you plot

Asked by Stephen on 22 May 2012
Latest activity Commented on by Stephen on 22 May 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

0 Comments

Stephen

Products

No products are associated with this question.

2 Answers

Answer by Honglei Chen on 22 May 2012
Accepted answer
h = plot(0.5,0.5)

returns the handle in h

1 Comment

Stephen on 22 May 2012

ahhh, of course! thank you so much!

Honglei Chen
Answer by Walter Roberson on 22 May 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)

1 Comment

Stephen on 22 May 2012

thanks :)

Walter Roberson

Contact us