specifying the handle as you plot
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
更多回答(1 个)
Walter Roberson
2012-5-22
Record the output of plot() and use that, such as
h = plot(0.5, 0.5)
Then you can
set(h, 'xdata', 1.5)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!