Mercurial > hg > octave-lyh
diff scripts/plot/contour.m @ 17050:9ff7d4849f03
contour[3f].m: Update to use new __plt_get_axis_arg__.
* scripts/plot/contourf.m, scripts/plot/contour3.m, scripts/plot/contour.m:
Update to use new __plt_get_axis_arg__. Rename xh to hax.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Tue, 23 Jul 2013 14:45:31 +0200 |
parents | 5ea6a6d2b83f |
children | eaab03308c0b |
line wrap: on
line diff
--- a/scripts/plot/contour.m +++ b/scripts/plot/contour.m @@ -52,15 +52,18 @@ function [c, h] = contour (varargin) - [xh, varargin] = __plt_get_axis_arg__ ("contour", varargin{:}); + [hax, varargin] = __plt_get_axis_arg__ ("contour", varargin{:}); - oldh = gca (); + oldfig = ifelse (isempty (hax), [], get (0, "currentfigure")); unwind_protect - axes (xh); - newplot (); - [ctmp, htmp] = __contour__ (xh, "none", varargin{:}); + hax = newplot (hax); + + [ctmp, htmp] = __contour__ (hax, "none", varargin{:}); + unwind_protect_cleanup - axes (oldh); + if (! isempty (oldfig)) + set (0, "currentfigure", oldfig); + endif end_unwind_protect if (nargout > 0)