Hello, I create a plot on a UIAxes with many plots and text objects. I wanted to be able to save them and later on add additional data so I have managed tconvert all the graphics objects on my UIAxes to a figure using the following:
xlab=ax.XLabel; ylab=ax.YLabel;
h = findobj(ax,'Type','line');
h1 = findobj(ax,'Type','text');
set(gcf,'color',[0.25,0.25,0.25]);
new_handle = copyobj(h,ax); new_handle = copyobj(h1,ax);
ax.XLabel=xlab; ax.YLabel=ylab;
I am then able to save this fig.
However, after re-opening this saved fig and trying to get the graphics objects from the figure to the UIAxes is where I am struggling.
I have tried:
[file,folder]=uigetfile({'*.fig'},'Open Fig file',app.startfolder);
[file,folder]=uigettfile({'*.fig'},'Open Fig file','C:\');
openpath=fullfile(folder,file);
newax = copyobj(ax,app.UIAxes);
But get the error:
Axes cannot be a child of UIAxes.