comparison scripts/plot/scatter3.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 7277fe922e99
children eaab03308c0b
comparison
equal deleted inserted replaced
17068:140d50ed8f22 17069:1cbdd14711c5
54 ## @seealso{plot, patch, scatter} 54 ## @seealso{plot, patch, scatter}
55 ## @end deftypefn 55 ## @end deftypefn
56 56
57 function retval = scatter3 (varargin) 57 function retval = scatter3 (varargin)
58 58
59 [h, varargin, nargin] = __plt_get_axis_arg__ ("scatter3", varargin{:}); 59 [hax, varargin, nargin] = __plt_get_axis_arg__ ("scatter3", varargin{:});
60 60
61 if (nargin < 2) 61 if (nargin < 2)
62 print_usage (); 62 print_usage ();
63 else 63 else
64 oldh = gca (); 64 oldfig = ifelse (isempty (hax), [], get (0, "currentfigure"));
65 unwind_protect 65 unwind_protect
66 axes (h); 66 hax = newplot (hax);
67 newplot (); 67
68 tmp = __scatter__ (h, 3, "scatter3", varargin{:}); 68 tmp = __scatter__ (hax, 3, "scatter3", varargin{:});
69 unwind_protect_cleanup 69 unwind_protect_cleanup
70 axes (oldh); 70 if (! isempty (oldfig))
71 set (0, "currentfigure", oldfig);
72 endif
71 end_unwind_protect 73 end_unwind_protect
72 endif 74 endif
73 75
74 if (! ishold ()) 76 if (! ishold (hax))
75 set (h, "view", [-37.5, 30], 77 set (hax, "view", [-37.5, 30],
76 "xgrid", "on", "ygrid", "on", "zgrid", "on"); 78 "xgrid", "on", "ygrid", "on", "zgrid", "on");
77 endif 79 endif
78 80
79 if (nargout > 0) 81 if (nargout > 0)
80 retval = tmp; 82 retval = tmp;