comparison scripts/plot/axis.m @ 7215:dd88d61d443f

[project @ 2007-11-29 16:44:45 by jwe]
author jwe
date Thu, 29 Nov 2007 16:46:40 +0000
parents e8d953d03f6a
children 5389a52df87b
comparison
equal deleted inserted replaced
7214:86d0b16f2bb2 7215:dd88d61d443f
116 116
117 ## PKG_ADD: mark_as_command axis 117 ## PKG_ADD: mark_as_command axis
118 118
119 function varargout = axis (varargin) 119 function varargout = axis (varargin)
120 120
121 if (nargin > 0 && isscalar (varargin{1}) && ishandle (varargin{1})) 121 [h, varargin, nargin] = __plt_get_axis_arg__ ("axis", varargin{:});
122 h = varargin{1}; 122 oldh = gca ();
123 if (! strcmp (get (h, "type"), "axes")) 123 unwind_protect
124 error ("axis: expecting first argument to be an axes object"); 124 axes (h);
125 endif
126 oldh = gca ();
127 unwind_protect
128 axes (h);
129 varargout = cell (max (nargin == 1, nargout), 1);
130 if (isempty (varargout))
131 __axis__ (h, varargin{2:end});
132 else
133 [varargout{:}] = __axis__ (h, varargin{2:end});
134 endif
135 unwind_protect_cleanup
136 axes (oldh);
137 end_unwind_protect
138 else
139 varargout = cell (max (nargin == 0, nargout), 1); 125 varargout = cell (max (nargin == 0, nargout), 1);
140 if (isempty (varargout)) 126 if (isempty (varargout))
141 __axis__ (gca (), varargin{:}); 127 __axis__ (h, varargin{:});
142 else 128 else
143 [varargout{:}] = __axis__ (gca (), varargin{:}); 129 [varargout{:}] = __axis__ (h, varargin{:});
144 endif 130 endif
145 endif 131 unwind_protect_cleanup
132 axes (oldh);
133 end_unwind_protect
146 134
147 endfunction 135 endfunction
148 136
149 function curr_axis = __axis__ (ca, ax, varargin) 137 function curr_axis = __axis__ (ca, ax, varargin)
150 138