Chris - you can use the allchild function to get a list of all children of the specified object (including those ones with hidden handles). So in your code, you could replace
The above change would be made in the pushbutton1_Callback function for both GUIs, and seems to allow the copying of titles and axis labels from one GUI to another. I say seems, because the copying of the histogram works well, but that for the logarithmic plot is messy and incomplete.
I could only get the correct colour of the histogram to be copied successfully if I explicitly defined/set the colour in the testplot2.m file. In pushbutton2_Callback, I added the following code after the call to hist
h = findobj(gca,'Type','patch');
set(h,'FaceColor',[0 .5 .5],'EdgeColor','w');
The above is taken from the Change Histogram Color Properties of hist.
As for the loglog plot - yikes. The title wouldn't copy, the x and y axis labels were in the incorrect place, and the plot itself was way off...but it was the correct colour! Replacing the loglog with the simpler
demonstrated that this data (and title and axis labels) could be copied over successfully. It appears that the XData and YData is copied over from one figure to the other, but without the logarithmic scaling.
As an aside, in your code, the axes1 tag kept getting cleared (this is a known issue) after the loglog or plot, so I had to add as the last line in both pushbutton2_Callback functions, the following
just to reset the tag value.