From: Yehonathan Segev on
I'm trying to show a "pcolor" plot with a regular type plot as an inset. If I add any annotation it hides both plots. Is there a way to control the relative order of appearance (who obstructs who) as you would say in windows Office by changing the "order" of the objects?

Thanks
From: Ryan on
There is a function available on the file exchange for adding a button to the figure tool bar which allows you to re-order the children. If you look at the code you'll see how it can be done.

http://www.mathworks.com/matlabcentral/fileexchange/18136-addreorderbuttons
From: Yehonathan Segev on
Thank you. The suggested solution does not work with annotations so a filled rectangle will always stay on the front.


"Ryan " <ryan.pearson(a)removethis.astrium.eads.net> wrote in message <hjs2d6$mlp$1(a)fred.mathworks.com>...
> There is a function available on the file exchange for adding a button to the figure tool bar which allows you to re-order the children. If you look at the code you'll see how it can be done.
>
> http://www.mathworks.com/matlabcentral/fileexchange/18136-addreorderbuttons
From: Walter Roberson on
Yehonathan Segev wrote:
> I'm trying to show a "pcolor" plot with a regular type plot as an inset.
> If I add any annotation it hides both plots. Is there a way to control
> the relative order of appearance (who obstructs who) as you would say in
> windows Office by changing the "order" of the objects?

For any particular object, the 'children' of the object are drawn from
last to first. You can get() the children and set() a new order for
them, or you can use the uistack() function to do the manipulation for you.

Note: there is an exception to this, which is that for the OpenGL
renderer, if there are multiple objects in the same plane, the order
will not be paid attention to. Matlab documents the drawing order for
this case, but there is evidence that some implementations exactly
reverse that order. The fix for this situation is to move one of the
objects slightly in the Z plane.
From: Yehonathan Segev on
What I'm trying to do is to stack a pcolor, an annotation rectangle and a line plot (at this order). I think the problem is that an annotation rectangle is considered at a higher level than the plot axes and therefor always stays on top.