octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #39767] initial axes are not ordered properly


From: Rik
Subject: [Octave-bug-tracker] [bug #39767] initial axes are not ordered properly
Date: Tue, 13 Aug 2013 19:32:36 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0

Follow-up Comment #8, bug #39767 (project octave):

Ben,

I extracted the failing test and put it in its own m-file, tst_findall.m,
which is attached.  Now you can run


test tst_findall
test tst_findall


The first time it will pass.  And it will fail on all subsequent times.  The
problem is in the findall call.  It does not return the objects in the same
order as they are in the figure.  There is a keybard() call I used to debug
the test.  If you uncomment it and then run the failing test I get.


test tst_findall
stopped in __test__ at line 10
debug> get (gcf, 'children')
ans =

   -6.13765
  -12.80879

debug> hax
hax =

  -12.80879
   -6.13765



First, we should just be able to run findobj() here.  Second, there is
something in findobj.  I suspect it is the call to union().


while (numel (handles) && ! (idepth >= depth))
  children = [];
  for n = 1 : numel (handles)
    children = union (children, get (handles(n), "children"));
  endfor
  handles = children;
  h = union (h, children);
  idepth = idepth + 1;
endwhile


union is for set objects which have no ordering, only membership.  It would be
better to use ordinary concatenation.  get() will always return column vectors
so this isn't a problem.  I changed findobj() to


while (numel (handles) && ! (idepth >= depth))
   children = [];
   for n = 1 : numel (handles)
     children = [children; get(handles(n), "children")];
   endfor
   handles = children;
   h = [h; children];
   idepth = idepth + 1;
endwhile


And the test passes now.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39767>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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