specifying the handle as you plot

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

 採用された回答

Honglei Chen
Honglei Chen 2012 年 5 月 22 日

1 投票

h = plot(0.5,0.5)
returns the handle in h

1 件のコメント

Stephen
Stephen 2012 年 5 月 22 日
ahhh, of course! thank you so much!

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 5 月 22 日

1 投票

Record the output of plot() and use that, such as
h = plot(0.5, 0.5)
Then you can
set(h, 'xdata', 1.5)

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by