Mercurial > hg > octave-lyh
diff scripts/plot/scatter.m @ 17069:1cbdd14711c5
scatter3.m, scatter.m: Update to use new __plt_get_axis_arg__.
* scripts/plot/scatter3.m, scripts/plot/scatter.m: Update to use new
__plt_get_axis_arg__.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Tue, 23 Jul 2013 18:31:22 +0200 |
parents | 64e7bb01fce2 |
children | eaab03308c0b |
line wrap: on
line diff
--- a/scripts/plot/scatter.m +++ b/scripts/plot/scatter.m @@ -61,23 +61,25 @@ function retval = scatter (varargin) - [h, varargin, nargin] = __plt_get_axis_arg__ ("scatter", varargin{:}); + [hax, varargin, nargin] = __plt_get_axis_arg__ ("scatter", varargin{:}); if (nargin < 2) print_usage (); else - oldh = gca (); + oldfig = ifelse (isempty (hax), [], get (0, "currentfigure")); unwind_protect - axes (h); - newplot (); - tmp = __scatter__ (h, 2, "scatter", varargin{:}); + hax = newplot (hax); + + htmp = __scatter__ (hax, 2, "scatter", varargin{:}); unwind_protect_cleanup - axes (oldh); + if (! isempty (oldfig)) + set (0, "currentfigure", oldfig); + endif end_unwind_protect endif if (nargout > 0) - retval = tmp; + retval = htmp; endif endfunction