octave-maintainers
[Top][All Lists]
Advanced

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

Re: meshz, and leading axis handles to mesh, meshc and surface


From: David Bateman
Subject: Re: meshz, and leading axis handles to mesh, meshc and surface
Date: Wed, 28 Nov 2007 01:14:03 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

David Bateman wrote:
>
> There are quite a few other functions that don't allow an axis handle as
> the first argument and should. These include errorbar, loglogerr,
> loglog, polar, semilogx, semilogyerr, semilogy where the code to do it
> is in __plt_get_axis_arg__ but is disabled, and stem where no code
> exists to do it.

Here is a patch that at least addresses this issue for the functions
that rely on __plt_get_axis_arg__ as the fix was small. Should we
convert the functions that probe the axes themselves to use
__plt_get_axis_arg__?

D.
Index: scripts/plot/errorbar.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/plot/errorbar.m,v
retrieving revision 1.19
diff -c -r1.19 errorbar.m
*** scripts/plot/errorbar.m     12 Oct 2007 21:27:24 -0000      1.19
--- scripts/plot/errorbar.m     28 Nov 2007 00:08:47 -0000
***************
*** 110,120 ****
  
  function errorbar (varargin)
  
!   newplot ();
! 
!   ## [h, varargin] = __plt_get_axis_arg__ ("errorbar", varargin{:});
!   h = gca ();
! 
!   __errcomm__ ("errorbar", h, varargin{:});
  
  endfunction
--- 110,123 ----
  
  function errorbar (varargin)
  
!   [h, varargin] = __plt_get_axis_arg__ ("errorbar", varargin{:});
!   oldh = gca ();
!   unwind_protect
!     axes (h);
!     newplot ();
!     __errcomm__ ("errorbar", h, varargin{:});
!   unwind_protect_cleanup
!     axes (oldh);
!   end_unwind_protect
  
  endfunction
Index: scripts/plot/loglog.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/plot/loglog.m,v
retrieving revision 1.34
diff -c -r1.34 loglog.m
*** scripts/plot/loglog.m       12 Oct 2007 21:27:24 -0000      1.34
--- scripts/plot/loglog.m       28 Nov 2007 00:08:47 -0000
***************
*** 29,45 ****
  
  function retval = loglog (varargin)
  
!   newplot ();
  
!   ## [h, varargin] = __plt_get_axis_arg__ ("loglog", varargin{:});
!   h = gca ();
  
!   set (h, "xscale", "log", "yscale", "log");
  
!   tmp = __plt__ ("loglog", h, varargin{:});
  
!   if (nargout > 0)
!     retval = tmp;
!   endif
  
  endfunction
--- 29,50 ----
  
  function retval = loglog (varargin)
  
!   [h, varargin] = __plt_get_axis_arg__ ("loglog", varargin{:});
!   oldh = gca ();
!   unwind_protect
!     axes (h);
!     newplot ();
  
!     set (h, "xscale", "log", "yscale", "log");
  
!     tmp = __plt__ ("loglog", h, varargin{:});
  
!     if (nargout > 0)
!       retval = tmp;
!     endif
  
!   unwind_protect_cleanup
!     axes (oldh);
!   end_unwind_protect
  
  endfunction
Index: scripts/plot/loglogerr.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/plot/loglogerr.m,v
retrieving revision 1.14
diff -c -r1.14 loglogerr.m
*** scripts/plot/loglogerr.m    12 Oct 2007 21:27:24 -0000      1.14
--- scripts/plot/loglogerr.m    28 Nov 2007 00:08:47 -0000
***************
*** 40,56 ****
  
  function retval = loglogerr (varargin)
  
!   newplot ();
  
!   ## [h, varargin] = __plt_get_axis_arg__ ("loglog", varargin{:});
!   h = gca ();
  
!   set (h, "xscale", "log", "yscale", "log");
  
!   tmp = __errcomm__ ("loglogerr", h, varargin{:});
  
!   if (nargout > 0)
!     retval = tmp;
!   endif
  
  endfunction
--- 40,61 ----
  
  function retval = loglogerr (varargin)
  
!   [h, varargin] = __plt_get_axis_arg__ ("loglogerr", varargin{:});
!   oldh = gca ();
!   unwind_protect
!     axes (h);
!     newplot ();
  
!     set (h, "xscale", "log", "yscale", "log");
  
!     tmp = __errcomm__ ("loglogerr", h, varargin{:});
  
!     if (nargout > 0)
!       retval = tmp;
!     endif
  
!   unwind_protect_cleanup
!     axes (oldh);
!   end_unwind_protect
  
  endfunction
Index: scripts/plot/polar.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/plot/polar.m,v
retrieving revision 1.36
diff -c -r1.36 polar.m
*** scripts/plot/polar.m        25 Nov 2007 04:32:24 -0000      1.36
--- scripts/plot/polar.m        28 Nov 2007 00:08:47 -0000
***************
*** 30,63 ****
  
  function retval = polar (varargin)
  
!   newplot ();
  
!   ## [h, varargin] = __plt_get_axis_arg__ ("semilogx", varargin{:});
!   h = gca ();
  
!   nargs = numel (varargin);
! 
!   if (nargs == 3)
!     if (! ischar (varargin{3}))
!       error ("polar: third argument must be a string");
!     endif
!     tmp = __plr2__ (h, varargin{:});
!   elseif (nargin == 2)
!     if (ischar (varargin{2}))
!       tmp = __plr1__ (h, varargin{:});
!     else
        fmt = "";
!       tmp = __plr2__ (h, varargin{:}, fmt);
      endif
-   elseif (nargin == 1)
-     fmt = "";
-     tmp = __plr1__ (h, varargin{:}, fmt);
-   else
-     print_usage ();
-   endif
  
!   if (nargout > 0)
!     retval = tmp;
!   endif
  
  endfunction
--- 30,68 ----
  
  function retval = polar (varargin)
  
!   [h, varargin] = __plt_get_axis_arg__ ("loglogerr", varargin{:});
!   oldh = gca ();
!   unwind_protect
!     axes (h);
!     newplot ();
  
!     nargs = numel (varargin);
  
!     if (nargs == 3)
!       if (! ischar (varargin{3}))
!       error ("polar: third argument must be a string");
!       endif
!       tmp = __plr2__ (h, varargin{:});
!     elseif (nargin == 2)
!       if (ischar (varargin{2}))
!       tmp = __plr1__ (h, varargin{:});
!       else
!       fmt = "";
!       tmp = __plr2__ (h, varargin{:}, fmt);
!       endif
!     elseif (nargin == 1)
        fmt = "";
!       tmp = __plr1__ (h, varargin{:}, fmt);
!     else
!       print_usage ();
!     endif
! 
!     if (nargout > 0)
!       retval = tmp;
      endif
  
!   unwind_protect_cleanup
!     axes (oldh);
!   end_unwind_protect
  
  endfunction
Index: scripts/plot/semilogx.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/plot/semilogx.m,v
retrieving revision 1.33
diff -c -r1.33 semilogx.m
*** scripts/plot/semilogx.m     12 Oct 2007 21:27:24 -0000      1.33
--- scripts/plot/semilogx.m     28 Nov 2007 00:08:47 -0000
***************
*** 29,45 ****
  
  function retval = semilogx (varargin)
  
!   newplot ();
  
!   ## [h, varargin] = __plt_get_axis_arg__ ("semilogx", varargin{:});
!   h = gca ();
  
!   set (h, "xscale", "log");
  
!   tmp = __plt__ ("semilogx", h, varargin{:});
  
!   if (nargout > 0)
!     retval = tmp;
!   endif
  
  endfunction
--- 29,50 ----
  
  function retval = semilogx (varargin)
  
!   [h, varargin] = __plt_get_axis_arg__ ("semilogx", varargin{:});
!   oldh = gca ();
!   unwind_protect
!     axes (h);
!     newplot ();
  
!     set (h, "xscale", "log");
  
!     tmp = __plt__ ("semilogx", h, varargin{:});
  
!     if (nargout > 0)
!       retval = tmp;
!     endif
  
!   unwind_protect_cleanup
!     axes (oldh);
!   end_unwind_protect
  
  endfunction
Index: scripts/plot/semilogxerr.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/plot/semilogxerr.m,v
retrieving revision 1.14
diff -c -r1.14 semilogxerr.m
*** scripts/plot/semilogxerr.m  12 Oct 2007 21:27:24 -0000      1.14
--- scripts/plot/semilogxerr.m  28 Nov 2007 00:08:47 -0000
***************
*** 40,56 ****
  
  function retval = semilogxerr (varargin)
  
!   newplot ();
  
!   ## [h, varargin] = __plt_get_axis_arg__ ("loglog", varargin{:});
!   h = gca ();
  
!   set (h, "xscale", "log");
  
!   tmp = __errcomm__ ("semilogxerr", h, varargin{:});
  
!   if (nargout > 0)
!     retval = tmp;
!   endif
  
  endfunction
--- 40,61 ----
  
  function retval = semilogxerr (varargin)
  
!   [h, varargin] = __plt_get_axis_arg__ ("semilogxerr", varargin{:});
!   oldh = gca ();
!   unwind_protect
!     axes (h);
!     newplot ();
  
!     set (h, "xscale", "log");
  
!     tmp = __errcomm__ ("semilogxerr", h, varargin{:});
  
!     if (nargout > 0)
!       retval = tmp;
!     endif
  
!   unwind_protect_cleanup
!     axes (oldh);
!   end_unwind_protect
  
  endfunction
Index: scripts/plot/semilogy.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/plot/semilogy.m,v
retrieving revision 1.33
diff -c -r1.33 semilogy.m
*** scripts/plot/semilogy.m     12 Oct 2007 21:27:24 -0000      1.33
--- scripts/plot/semilogy.m     28 Nov 2007 00:08:47 -0000
***************
*** 29,45 ****
  
  function retval = semilogy (varargin)
  
!   newplot ();
  
!   ## [h, varargin] = __plt_get_axis_arg__ ("semilogy", varargin{:});
!   h = gca ();
  
!   set (h, "yscale", "log");
  
!   tmp = __plt__ ("semilogy", h, varargin{:});
  
!   if (nargout > 0)
!     retval = tmp;
!   endif
  
  endfunction
--- 29,50 ----
  
  function retval = semilogy (varargin)
  
!   [h, varargin] = __plt_get_axis_arg__ ("semilogy", varargin{:});
!   oldh = gca ();
!   unwind_protect
!     axes (h);
!     newplot ();
  
!     set (h, "yscale", "log");
  
!     tmp = __plt__ ("semilogy", h, varargin{:});
  
!     if (nargout > 0)
!       retval = tmp;
!     endif
  
!   unwind_protect_cleanup
!     axes (oldh);
!   end_unwind_protect
  
  endfunction
Index: scripts/plot/semilogyerr.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/plot/semilogyerr.m,v
retrieving revision 1.14
diff -c -r1.14 semilogyerr.m
*** scripts/plot/semilogyerr.m  12 Oct 2007 21:27:24 -0000      1.14
--- scripts/plot/semilogyerr.m  28 Nov 2007 00:08:47 -0000
***************
*** 40,56 ****
  
  function retval = semilogyerr (varargin)
  
!   newplot ();
  
!   ## [h, varargin] = __plt_get_axis_arg__ ("loglog", varargin{:});
!   h = gca ();
  
!   set (h, "yscale", "log");
  
!   tmp = __errcomm__ ("semilogyerr", h, varargin{:});
  
!   if (nargout > 0)
!     retval = tmp;
!   endif
  
  endfunction
--- 40,61 ----
  
  function retval = semilogyerr (varargin)
  
!   [h, varargin] = __plt_get_axis_arg__ ("semilogyerr", varargin{:});
!   oldh = gca ();
!   unwind_protect
!     axes (h);
!     newplot ();
  
!     set (h, "yscale", "log");
  
!     tmp = __errcomm__ ("semilogyerr", h, varargin{:});
  
!     if (nargout > 0)
!       retval = tmp;
!     endif
  
!   unwind_protect_cleanup
!     axes (oldh);
!   end_unwind_protect
  
  endfunction
2007-11-27  David Bateman  <address@hidden>

        * plot/errorbar.m, plot/loglog.m, plot/loglogerr.m, plot/polar.m,
        plot/semilogx.m, plot/semilogxerr.m, plot/semilogy.m,
        plot/semilogyerr.m: Treat an axis handle as the first argument.

reply via email to

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