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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!