2847
|
1 ## Copyright (C) 1996, 1997 John W. Eaton |
2313
|
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. |
245
|
19 |
3368
|
20 ## -*- texinfo -*- |
|
21 ## @deftypefn {Function File} {} title (@var{string}) |
5152
|
22 ## Specify a title for a plot. |
5642
|
23 ## @seealso{plot, semilogx, semilogy, loglog, polar, mesh, contour, |
|
24 ## bar, stairs, replot, xlabel, ylabel} |
3368
|
25 ## @end deftypefn |
4
|
26 |
2314
|
27 ## Author: jwe |
|
28 |
4529
|
29 function h = title (text) |
4
|
30 |
|
31 if (nargin != 1) |
904
|
32 usage ("title (text)"); |
4
|
33 endif |
|
34 |
5443
|
35 if (ischar (text)) |
5252
|
36 __gnuplot_raw__ (sprintf ("set title \"%s\";\n", |
|
37 undo_string_escapes (text))); |
5152
|
38 if (automatic_replot) |
5493
|
39 replot (); |
5152
|
40 endif |
4
|
41 else |
904
|
42 error ("title: text must be a string"); |
4
|
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 |
4
|
53 endfunction |