Matlab provides a function called uistack for arranging UI objects in the depth direction (which objects are in front of which others, etc). There is also a function (axes) for setting the current axes. I find that when I call axes, it also automatically puts that axes object in front of all other objects (including uipanels, etc). Is there any way to avoid this?
Here is some code that illustrates my question:
figure(1)
clf
ax1 = axes();
set(ax1,'position',[.1 .1 .5 .5],'xtick',[],'ytick',[],'color','r')
ax2 = axes();
set(ax2,'position',[.3 .3 .5 .5],'xtick',[],'ytick',[],'color','b')
% blue (ax2) is on top since it was created after ax1
uistack(ax1,'top')
% red (ax1) is now on top (good)
axes(ax2)
% [do some plotting or something in ax2]
% blue (ax2) is now on top (I'd rather avoid this)