MATLAB: Copyobj to copy .fig from Figure window to Axes inside GUI

axescopyobjfigureguiMATLABsavefig

Hello. This is my problem.
I have a GUI (one Figure) with several Tabs, and some of then have axes (mostly to plot a .jpg or a graph).
In one of this Tabs I have a button that has a callback which opens a new Window (Figure(2)), where it opens a .jpg and I draw some lines (imline) by hand, and then saves this Figure to a .fig file (using savefig). After that, i try to open the .fig file to one of the axes on the GUI.
In most of my attempts (using copyobj) i get the error "Axes cannot be a child of Axes". How can I solve this?
This is 'myhandles', which contains the handles of the GUI. The 'OWSO_main' is the Figure of the GUI, and 'W6_figure_tag' is the axes (inside a Tab) where i want to display the contents of the .fig file.
fig1.PNG
When i use Hfig = openfig('myfig.fig'), Hfig appears as a 1×1 Axes.
I have tried the approachs below, with no sucess.
I can provide more information if needed.
Thanks in advance.

Best Answer

figure() objects can never be the child of an axes()
uipanel() can never be the child of an axes()
axes() can never be the child of an axes()
There is no possibility that you will be able to copyobj() the figure or the axes into an axes.
The closest you can get is to copy the children of the original axes into the new axes.