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

조회 수: 1 (최근 30일)
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 CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by