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 11:43:19 -0500

On Wednesday, February 10, 2010, at 10:06AM, "John W. Eaton" <address@hidden> 
wrote:
>In a thread on the bug list on 9-Feb-2010, John W. Eaton wrote:
>
>| On  9-Feb-2010, E. Joshua Rigler wrote:
>| 
>| | The following should work if there are multiple 'children' handles
>| | defined in the current graphics handle:
>| | 
>| | plot(1);
>| | h = get(gca,'children');
>| | hp = shift(h,1);
>| | set(gca,'children', hp);
>| | 
>| | I get the error "set: new children must be a permutation of existing
>| | children" when I attempt this.
>| | 
>| | The pertinent function in the file graphics.cc seems to be
>| | maybe_set_children.  The old and new 'children' vectors are called
>| | 'kids' and 'new_kids' respectively.  They are each sorted, then
>| | compared.  If one is a permutation of the other, the sorted versions
>| | of each should match, but for some reason this isn't working.  This
>| | seems like such a basic operation, I can't imagine what is going
>| | wrong.  Any suggestions?
>| | 
>| | For context, this was discovered in an effort to get the free ML
>| | mapping toolbox M_Map to work under Octave.
>| 
>| The problem is that an axes object normally has hidden children that
>| you are not seeing when you do
>| 
>|   get (gca, 'children');
>| 
>| and that the maybe_set_children function was not handling either.
>| 
>| I checked in the following change.
>| 
>|   http://hg.savannah.gnu.org/hgweb/octave/rev/4b124317dc38
>
>In my change, after setting the children for a graphics object, all
>the visible children will be first in the list and all the hidden
>children will be at the end.  Is this the correct behavior?  Is it
>possible for the hidden children to be mixed with the visible
>children prior to such a rearrangement?  If so, then should we be
>preserving the ordering/mixing of the visible/hidden children in the
>list?
>
>jwe
>

Its not clear to me if the discussion is about hidden handles or hidden 
objects. 

close all
figure(1)
axes
set (gca, 'visible', 'off')
get (gcf, 'children')
ans =
  158.3616e+000
set (gca, 'HandleVisibility', 'off')
get (gcf, 'children')
ans =
  Empty matrix: 0-by-1

In any event, for Matlab setting 'visible' to 'off' doesn't change the order of 
the handles, it just hides the object. Setting 'handlevisibility', to 'off' 
removes the handle for the list of children. To obtain a list of all 
hidden/visible handles of all children for a figure I use ...

all_children = findall (gcf)

The order of the handles in "all_children" is determined by the order they were 
created and is not effected by the state of the 'visible' or 'handlevisibility' 
properties. 

Ben
 



reply via email to

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