switch from GUI axes to figure() and back

조회 수: 1 (최근 30일)
G A
G A 2012년 6월 25일
I want to plot my graph either in GUI axes or in a separate figure As Walter recommended ( http://www.mathworks.com/matlabcentral/answers/22208-show-figure) I could switch to figure() using
if PlotInFigure
handles.Fig1_axes=axes('Parent',figure(1));
end
plot(handles.Fig1_axes,x,y,'-b'),
Now I want to plot my graph in GUI axes during the next run of my code (with a different value of checkbox, for instance)
if ~PlotInFigure
???
end
plot(handles.Fig1_axes,x,y,'-b'),
How can I do it? Thanks!

채택된 답변

Walter Roberson
Walter Roberson 2012년 6월 25일
if PlotInFigure
handles.Fig1_axes = axes('Parent', figure(1));
plot_into = handles.Fig1_axes;
else
plot_into = TheHandleOfTheAxesInTheGUI;
end
plot(plot_into, x, y, '-b'),
  댓글 수: 4
Walter Roberson
Walter Roberson 2012년 6월 25일
You can compact two lines as you do not need "f".
plot_into = axes('Parent', figure(1));
G A
G A 2012년 6월 25일
I have done it already) And everything works. Thanks, Walter!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by