Why does COPYOBJ reverse the order of copied objects when copying mutliple objects at once?
If I use COPYOBJ to copy a group of handle graphics objects from one parent to another, the ordering of the copied objects is opposite to the original objects. In other words, objects that were originally in the foreground of the figure are moved to the background.
For example, if I create two patches:
ax1=axes;patch([0 0 1 1],[0 1 1 0],'b')hold onpatch([0 0.5 1],[0 1 0],'r')title('Original Image')
and then copy them to a new axes using COPYOBJ:
fig2=figure('units','norm','pos',[0.5 0.5 0.4 0.4]);ax2=axes;newkids=copyobj(get(ax1,'children'),ax2);
The second patch has been moved to the background and can no longer be seen.
Best Answer