Mercurial > hg > octave-nkf
changeset 17071:e89fd58a6e84
feather.m: Update to use new __plt_get_axis_arg__.
* scripts/plot/feather.m: Update to use new __plt_get_axis_arg__.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Wed, 24 Jul 2013 09:19:02 +0200 |
parents | d465f9970c02 |
children | 22fa8c77b92d |
files | scripts/plot/feather.m |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/feather.m +++ b/scripts/plot/feather.m @@ -46,7 +46,7 @@ function retval = feather (varargin) - [h, varargin, nargin] = __plt_get_axis_arg__ ("feather", varargin{:}); + [hax, varargin, nargin] = __plt_get_axis_arg__ ("feather", varargin{:}); arrowsize = 0.25; @@ -94,13 +94,14 @@ y = [zeros(1, n); yend; ytmp + u * arrowsize / 3; yend; ... ytmp - u * arrowsize / 3]; - oldh = gca (); + oldfig = ifelse (isempty (hax), [], get (0, "currentfigure")); unwind_protect - axes (h); - newplot (); - hlist = plot (h, x, y, line_spec, [1, n], [0, 0], line_spec); + hax = newplot (hax); + hlist = plot (hax, x, y, line_spec, [1, n], [0, 0], line_spec); unwind_protect_cleanup - axes (oldh); + if (! isempty (oldfig)) + set (0, "currentfigure", oldfig); + endif end_unwind_protect if (nargout > 0)