1 ## Copyright (C) 1993-2012 John W. Eaton
3 ## This file is part of Octave.
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 3 of the License, or (at
8 ## your option) any later version.
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.
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
20 ## @deftypefn {Function File} {} title (@var{string})
21 ## @deftypefnx {Function File} {} title (@var{string}, @var{p1}, @var{v1}, @dots{})
22 ## @deftypefnx {Function File} {} title (@var{h}, @dots{})
23 ## @deftypefnx {Function File} {@var{h} =} title (@dots{})
24 ## Create a title object for a plot.
26 ## The optional return value @var{h} is a graphics handle to the created object.
31 function retval = title (varargin)
33 [h, varargin, nargin] = __plt_get_axis_arg__ ("title", varargin{:});
35 if (rem (nargin, 2) != 1)
39 tmp = __axis_label__ (h, "title", varargin{:});
51 %! xl = get (ax,"title");
52 %! title ("Testing title");
53 %! assert (get (xl,"string"), "Testing title");
57 %! plot3 ([0,1], [0,1], [0,1]);
58 %! xl = get(gca (), "title");
59 %! title ("Testing title");
60 %! assert (get (xl,"string"),"Testing title");
63 %! hf = figure ("visible", "off");
66 %! xl = get (ax,"title");
67 %! title ("Testing title");
68 %! assert (get (xl,"string"), "Testing title");
69 %! unwind_protect_cleanup
74 %! hf = figure ("visible", "off");
76 %! plot3 ([0,1], [0,1], [0,1]);
77 %! xl = get (gca (), "title");
78 %! title("Testing title");
79 %! assert (get (xl,"string"), "Testing title");
80 %! unwind_protect_cleanup