3479
|
1 ## Copyright (C) 1996, 1997 John W. Eaton |
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by |
|
7 ## the Free Software Foundation; either version 2, or (at your option) |
|
8 ## any later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, write to the Free |
5307
|
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
18 ## 02110-1301, USA. |
3479
|
19 |
|
20 ## -*- texinfo -*- |
3497
|
21 ## @deftypefn {Function File} {} __axis_label__ (@var{caller}, @var{text}) |
3479
|
22 ## Utility function for @code{xlabel}, @code{ylabel}, and @code{zlabel}. |
|
23 ## @end deftypefn |
|
24 |
|
25 ## Author: jwe |
|
26 |
4529
|
27 function h = __axis_label__ (caller, text) |
3479
|
28 |
|
29 if (nargin == 0) |
6046
|
30 print_usage (); |
3479
|
31 elseif (nargin == 2) |
5443
|
32 if (ischar (text)) |
5252
|
33 __gnuplot_raw__ (sprintf ("set %s \"%s\";\n", caller, |
|
34 undo_string_escapes (text))); |
5152
|
35 if (automatic_replot) |
5493
|
36 replot (); |
5152
|
37 endif |
3479
|
38 else |
|
39 error ("%s: text must be a string", caller); |
|
40 endif |
|
41 else |
|
42 usage ("%s (text)", caller); |
|
43 endif |
|
44 |
5775
|
45 ## FIXME -- eventually, we will return a graphics handle. For |
4529
|
46 ## now, return something, so that calls that expect a handle won't |
|
47 ## fail (at least immediately). |
|
48 |
|
49 if (nargout > 0) |
|
50 h = -1; |
|
51 endif |
|
52 |
3479
|
53 endfunction |