octave-maintainers
[Top][All Lists]
Advanced

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

Re: question about ordering of visible/hidden children in graphics objec


From: Ben Abbott
Subject: Re: question about ordering of visible/hidden children in graphics objects (was: rearranging 'children' in a graphics handle)
Date: Wed, 10 Feb 2010 19:07:45 -0500

On Feb 10, 2010, at 1:56 PM, John W. Eaton wrote:

> On 10-Feb-2010, Ben Abbott wrote:
> 
> | Its not clear to me if the discussion is about hidden handles or
> | hidden objects.
> 
> Hidden handles.  For example, what does Matlab do for the following?
> 
>  h1 = line (rand (3, 1), rand (3, 1))
>  h2 = line (rand (3, 1), rand (3, 1))
>  h3 = line (rand (3, 1), rand (3, 1))
>  set (0, 'showhiddenhandles', 'on')
>  get (gca (), 'children')             ## expect [h3; h2; h1; hidden...]
>  set (0, 'showhiddenhandles', 'off')
>  set (h2, 'handlevisibility', 'off');
>  kids = get (gca (), 'children')      ## should only get [h3; h1]
>  set (0, 'showhiddenhandles', 'on')
>  get (gca (), 'children')             ## expect [h3; h2; h1; other hidden...]
>  set (0, 'showhiddenhandles', 'off')
>  set (gca (), 'children', flipud (kids))
>  get (gca (), 'children')             ## expect [h1; h3]
>  set (0, 'showhiddenhandles', 'on')
>  get (gca (), 'children')
> 
> Should the result of the last command above be
> 
>  [h1; h3; h2; other hidden...]
> 
> or
> 
>  [h1; h2; h3; other hidden...]
> 
> Currently, Octave returns the first list above.
> 
> BTW,
> 
>  findall (gca ())
> 
> does not seem to be equivalent to
> 
>  set (0, 'showhiddenhandles', 'on')
>  get (gca (), 'children')
> 
> With findall, the handles appear to be sorted.  Is that required for
> compatibility with Matlab?
> 
> What does Matlab do?  The order of the handles might matter in how
> things are displayed, so we probably need to be compatible with the
> Matlab behavior.
> 
> jwe

I've attached the results.

The portion below ...

>  get (gca (), 'children')             ## expect [h3; h2; h1; other hidden...]

was ordered as [other hidden handles; h3; h2; h1]

The last part was ordered as ... [other hidden handles; h2; h1; h3]

Regarding findall and get(gca,'children'), the list only differs by the handle 
for the current axis. However, the order is the same for each. See below.

>> findall(gca())

ans =

          171
          177
          176
          175
          174
          172
   0.00097656
          173

>> set(0,'showhiddenHandles','on')
>> get(gca,'children')

ans =

          177
          176
          175
          174
          172
   0.00097656
          173

>> gca

ans =

          171

Ben


Attachment: results.txt
Description: Text document






reply via email to

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