specifying the handle as you plot

조회 수: 3 (최근 30일)
Stephen
Stephen 2012년 5월 22일
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일
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일
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 CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by