octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: graphics stacking order


From: Ben Abbott
Subject: Re: graphics stacking order
Date: Fri, 27 Nov 2009 13:16:56 -0500

On Nov 27, 2009, at 12:43 PM, Shai Ayal wrote:

> Hi,
> 
> while trying to get colorbar to work, I realized I'm not sure what the
> graphics stacking order (that is what object should be in front)
> should be.
> 
> consider the following code:
> 
> clf ();
> ax1 = gca ();
> sombrero (); # just so that we have something drawn
> ax2 = axes ("position", [0.3, 0.3, 0.2, 0.2]);
> ch=get (gcf (), "children")
> 
> with current tip I see ax1 drawn on top of ax2, (both in gnuplot and
> fltk) and ch = [ax2;ax1]
> I couldn't find a reference for what matlab would do. I'm pretty sure
> that at least ax2 should be drawn on top of a1, but I'm not sure about
> the order of ch. Can anyone try on matlab and report?
> 
> Shai


Octave orders the objects in the same way as Matlab.

Here's a simple illustration using Matlab.

>> x = 0:1;
>> plot (x,x,  x,x,  x,x,  x,x,  x,x,  x,x,  x,x)
>> ch = get (gca, 'children');
>> cell2mat (get (ch, 'color'))
ans =

         0.25         0.25         0.25
         0.75         0.75            0
         0.75            0         0.75
            0         0.75         0.75
            1            0            0
            0          0.5            0
            0            0            1

>> get (gca, 'colororder')

ans =

            0            0            1
            0          0.5            0
            1            0            0
            0         0.75         0.75
         0.75            0         0.75
         0.75         0.75            0
         0.25         0.25         0.25

Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]