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

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

[Octave-bug-tracker] [bug #39529] graphics functions: unneeded new axis


From: Rik
Subject: [Octave-bug-tracker] [bug #39529] graphics functions: unneeded new axis when parent is specified as prop/val
Date: Sun, 21 Jul 2013 02:47:14 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0

Follow-up Comment #4, bug #39529 (project octave):

I think the overall structure of creating a new plot is broken.  First,
unneeded new axes occasionally get created.  Second, the axes() function is
not behaving in a compatible way.  And once we do make it compatible, it will
make the Octave behavior look even worse.

I've been looking into the situation and I think that Matlab relies on
newplot() to do most of the work.  So, I'm thinking that Octave should re-code
to the following syntax for plotting routines.


[hax, varargin, nargs] = __plt_get_axis_args (...);
oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
unwind_protect
  hax = newplot (hax);
  ... CODE ...
unwind_protect_cleanup
  if (! isempty (oldfig) && isfigure (oldfig))
    set (0, "currentfigure", oldfig)
  endif
end_unwind_protect


__plt_get_axis_args__ would be modified to just examine varargin and return
hax or a null value, but not to create any figures or axes.  Instead of
switching axes with the axes() command I would switch figures.  Since the
current axis is maintained as a property of the figure object this avoids
having to call axes() and all the problems associated with that.  Once the
figure is restored the current axis will automatically be correct again.

What do you think?


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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