Making a duplicate plot from a GUI axis in a normal figure window with a pushbutton

1 回表示 (過去 30 日間)
Chris
Chris 2013 年 11 月 24 日
編集済み: Azzi Abdelmalek 2013 年 11 月 24 日
I have a GUI made with Guide, in MATLAB 2013b. It has two axes in it and two buttons, which I would like, when pressed, to pop-out/duplicate each of the axes into a figure window. What confuses me is that I can make one of the buttons work and not the other. What I have is:
For the left button (this one works):
L = handles.MZILeft;
h = figure;
copyobj(L,h);
For the right button (this one does not work):
R = handles.MZIRight;
h2 = figure;
copyobj(R,h2);
Each of these sets of code are in the callback functions of two push buttons. MZILeft and MZIRight are the tags to the axes. I know the handles to the axes are correct because I successfully plot to them. The right button does not give an error, it just makes a blank figure. I tried changing the order the figures in the GUI were created, but that didn't change anything. I also tried,
copyobj(get(R,'parent'),h2);
But that unsurprisingly gave a figure with both figures in it because the figures are both in a panel together.
Am I doing something silly here? Thanks

回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by