[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: question about ordering of visible/hidden children in graphics objec
From: |
John W. Eaton |
Subject: |
Re: question about ordering of visible/hidden children in graphics objects (was: rearranging 'children' in a graphics handle) |
Date: |
Wed, 10 Feb 2010 13:56:03 -0500 |
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