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:29:30 -0500

On Feb 10, 2010, at 7:17 PM, John W. Eaton wrote:

> On 10-Feb-2010, Ben Abbott wrote:
> 
> | 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]
> 
> Then I think this part of our current implementation is OK, except
> that the order of the handles is apparently reversed.  Does that
> matter?  I thought we already switched the order of children once for
> Matlab compatibility.  Did we get the ordering wrong?

I'm not sure the ordering is wrong. Could it be that the objects are created in 
a different order? 

> Also, what about the order of the hidden objects, and what are they?
> xlabel, ylabel, zlabel and what else?  Are they ordered the same in
> Octave and Matlab?  Should they be the same?  Should we even care
> about this detail?

I don't think the handles that are hidden by default matters.

> | 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
> 
> OK, so should we fix Octave so that it does not sort the resutls of
> findall?

I think that would be the right thing to do. 

Ben




reply via email to

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