octave-maintainers
[Top][All Lists]
Advanced

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

Re: graphics stacking order


From: Shai Ayal
Subject: Re: graphics stacking order
Date: Fri, 27 Nov 2009 22:09:27 +0200

On Fri, Nov 27, 2009 at 10:07 PM, Ben Abbott <address@hidden> wrote:
> On Nov 27, 2009, at 3:06 PM, Shai Ayal <address@hidden> wrote:
>
>> On Fri, Nov 27, 2009 at 10:03 PM, Ben Abbott <address@hidden> wrote:
>>>
>>> On Nov 27, 2009, at 2:33 PM, Shai Ayal <address@hidden> wrote:
>>>
>>>> On Fri, Nov 27, 2009 at 8:16 PM, Ben Abbott <address@hidden> wrote:
>>>>>
>>>>> 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
>>>>>
>>>> I'm sorry for being so dense, but it's too late at night to try to
>>>> decipher your example.
>>>> Can you please elaborate?
>>>> what is the order of the children (i,e, when I add a new child, does
>>>> it go before or after the current children in the children vector)?
>>>> does the first child get to be on top when drawing?
>>>>
>>>> Shai
>>>
>>> The last child created is the first in the list ... Which is counter to
>>> expectation, at least my expectation.
>>
>> So when painting, the first handle on the list is drawn on top of all
>> others?
>>
>> Shai
>
> Yes, that is my understanding.
Thanks



reply via email to

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