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 Center および File ExchangeAnnotations についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by