Mercurial > octave-nkf
comparison scripts/plot/zlabel.m @ 7194:a927a2871a93
[project @ 2007-11-26 23:06:12 by jwe]
author | jwe |
---|---|
date | Mon, 26 Nov 2007 23:06:13 +0000 |
parents | a1dbe9d80eee |
children | a730e47fda4d |
comparison
equal
deleted
inserted
replaced
7193:cbdee3da62bd | 7194:a927a2871a93 |
---|---|
17 ## along with Octave; see the file COPYING. If not, see | 17 ## along with Octave; see the file COPYING. If not, see |
18 ## <http://www.gnu.org/licenses/>. | 18 ## <http://www.gnu.org/licenses/>. |
19 | 19 |
20 ## -*- texinfo -*- | 20 ## -*- texinfo -*- |
21 ## @deftypefn {Function File} {} zlabel (@var{string}) | 21 ## @deftypefn {Function File} {} zlabel (@var{string}) |
22 ## @deftypefnx {Function File} {} zlabel (@var{h}, @var{string}) | |
22 ## See xlabel. | 23 ## See xlabel. |
23 ## @end deftypefn | 24 ## @end deftypefn |
24 | 25 |
25 ## Author: jwe | 26 ## Author: jwe |
26 | 27 |
27 function h = zlabel (varargin) | 28 function h = zlabel (varargin) |
28 | 29 |
29 if (rem (nargin, 2) == 1) | 30 if (isscalar (varargin{1}) && ishandle (varargin{1})) |
30 if (nargout > 0) | 31 ax = varargin {1}; |
31 h = __axis_label__ ("zlabel", varargin{:}); | 32 if (! strcmp (get (ax, "type"), "axes")) |
32 else | 33 error ("zlabel: expecting first argument to be an axes object"); |
33 __axis_label__ ("zlabel", varargin{:}); | |
34 endif | 34 endif |
35 if (rem (nargin, 2) == 1) | |
36 print_usage (); | |
37 endif | |
38 oldh = gca (); | |
39 unwind_protect | |
40 axes (ax); | |
41 tmp = __axis_label__ ("zlabel", varargin{2:end}); | |
42 unwind_protect_cleanup | |
43 axes (oldh); | |
44 end_unwind_protect | |
35 else | 45 else |
36 print_usage (); | 46 if (rem (nargin, 2) != 1) |
47 print_usage (); | |
48 endif | |
49 tmp = __axis_label__ ("zlabel", varargin{1:end}); | |
50 endif | |
51 | |
52 if (nargout > 0) | |
53 h = tmp; | |
37 endif | 54 endif |
38 | 55 |
39 endfunction | 56 endfunction |