comparison 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
comparison
equal deleted inserted replaced
17068:140d50ed8f22 17069:1cbdd14711c5
59 ## @seealso{plot, patch, scatter3} 59 ## @seealso{plot, patch, scatter3}
60 ## @end deftypefn 60 ## @end deftypefn
61 61
62 function retval = scatter (varargin) 62 function retval = scatter (varargin)
63 63
64 [h, varargin, nargin] = __plt_get_axis_arg__ ("scatter", varargin{:}); 64 [hax, varargin, nargin] = __plt_get_axis_arg__ ("scatter", varargin{:});
65 65
66 if (nargin < 2) 66 if (nargin < 2)
67 print_usage (); 67 print_usage ();
68 else 68 else
69 oldh = gca (); 69 oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
70 unwind_protect 70 unwind_protect
71 axes (h); 71 hax = newplot (hax);
72 newplot (); 72
73 tmp = __scatter__ (h, 2, "scatter", varargin{:}); 73 htmp = __scatter__ (hax, 2, "scatter", varargin{:});
74 unwind_protect_cleanup 74 unwind_protect_cleanup
75 axes (oldh); 75 if (! isempty (oldfig))
76 set (0, "currentfigure", oldfig);
77 endif
76 end_unwind_protect 78 end_unwind_protect
77 endif 79 endif
78 80
79 if (nargout > 0) 81 if (nargout > 0)
80 retval = tmp; 82 retval = htmp;
81 endif 83 endif
82 84
83 endfunction 85 endfunction
84 86
85 87