Mercurial > hg > octave-nkf
comparison scripts/plot/ellipsoid.m @ 17051:3e1b24a2454a
cylinder.m, ellipsoid.m, rectangle.m, sphere.m: Update to use new __plt_get_axis_arg__.
* scripts/plot/cylinder.m, scripts/plot/ellipsoid.m, scripts/plot/rectangle.m,
scripts/plot/sphere.m: Update to use new __plt_get_axis_arg__.
Rename ax to hax.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Tue, 23 Jul 2013 16:06:07 +0200 |
parents | 11949c9795a0 |
children | eaab03308c0b |
comparison
equal
deleted
inserted
replaced
17050:9ff7d4849f03 | 17051:3e1b24a2454a |
---|---|
29 | 29 |
30 ## Author: Sylvain Pelissier <sylvain.pelissier@gmail.com> | 30 ## Author: Sylvain Pelissier <sylvain.pelissier@gmail.com> |
31 | 31 |
32 function [xx, yy, zz] = ellipsoid (varargin) | 32 function [xx, yy, zz] = ellipsoid (varargin) |
33 | 33 |
34 [h, varargin, nargin] = __plt_get_axis_arg__ ((nargout > 0), "ellipsoid", | 34 [hax, varargin, nargin] = __plt_get_axis_arg__ ("ellipsoid", varargin{:}); |
35 varargin{:}); | |
36 | 35 |
37 if (nargin != 6 && nargin != 7) | 36 if (nargin != 6 && nargin != 7) |
38 print_usage (); | 37 print_usage (); |
39 endif | 38 endif |
40 | 39 |
62 if (nargout > 0) | 61 if (nargout > 0) |
63 xx = x; | 62 xx = x; |
64 yy = y; | 63 yy = y; |
65 zz = z; | 64 zz = z; |
66 else | 65 else |
67 surf (h, x, y, z); | 66 oldfig = ifelse (isempty (hax), [], get (0, "currentfigure")); |
67 unwind_protect | |
68 hax = newplot (hax); | |
69 | |
70 surf (hax, x, y, z); | |
71 | |
72 unwind_protect_cleanup | |
73 if (! isempty (oldfig)) | |
74 set (0, "currentfigure", oldfig); | |
75 endif | |
76 end_unwind_protect | |
68 endif | 77 endif |
69 | 78 |
70 endfunction | 79 endfunction |
71 | 80 |
72 | 81 |