comparison scripts/plot/title.m @ 14001:5f0bb45e615c

doc: Update documentation for functions returning a graphics handle h (Bug #34761) * voronoi.m, image.m, imagesc.m, imshow.m, area.m, bar.m, barh.m, clabel.m, clf.m, compass.m, ezcontour.m, ezcontourf.m, ezmesh.m, ezmeshc.m, ezplot.m, ezplot3.m, ezpolar.m, ezsurf.m, ezsurfc.m, feather.m, fill.m, findall.m, findobj.m, loglog.m, mesh.m, pareto.m, patch.m, pie.m, pie3.m, plot.m, polar.m, quiver.m, quiver3.m, rectangle.m, ribbon.m, rose.m, scatter.m, scatter3.m, semilogx.m, semilogy.m, slice.m, stem.m, surf.m, surface.m, text.m, title.m, trimesh.m, triplot.m, trisurf.m, xlabel.m, ylabel.m, zlabel.m: Update documentation for functions returning a graphics handle h.
author Rik <octave@nomad.inbox5.com>
date Tue, 06 Dec 2011 13:09:17 -0800
parents d3f0d75faf2c
children 72c96de7a403
comparison
equal deleted inserted replaced
14000:15400d5deb1c 14001:5f0bb45e615c
19 ## -*- texinfo -*- 19 ## -*- texinfo -*-
20 ## @deftypefn {Function File} {} title (@var{string}) 20 ## @deftypefn {Function File} {} title (@var{string})
21 ## @deftypefnx {Function File} {} title (@var{string}, @var{p1}, @var{v1}, @dots{}) 21 ## @deftypefnx {Function File} {} title (@var{string}, @var{p1}, @var{v1}, @dots{})
22 ## @deftypefnx {Function File} {} title (@var{h}, @dots{}) 22 ## @deftypefnx {Function File} {} title (@var{h}, @dots{})
23 ## @deftypefnx {Function File} {@var{h} =} title (@dots{}) 23 ## @deftypefnx {Function File} {@var{h} =} title (@dots{})
24 ## Create a title object and return a handle to it. 24 ## Create a title object for a plot.
25 ##
26 ## The optional return value @var{h} is a graphics handle to the created object.
25 ## @end deftypefn 27 ## @end deftypefn
26 28
27 ## Author: jwe 29 ## Author: jwe
28 30
29 function retval = title (varargin) 31 function retval = title (varargin)
40 retval = tmp; 42 retval = tmp;
41 endif 43 endif
42 44
43 endfunction 45 endfunction
44 46
47
45 %!demo 48 %!demo
46 %! clf (); 49 %! clf ();
47 %! ax=axes(); 50 %! ax = axes();
48 %! xl = get(ax,"title"); 51 %! xl = get (ax,"title");
49 %! title("Testing title") 52 %! title ("Testing title");
50 %! assert(get(xl,"string"),"Testing title") 53 %! assert (get (xl,"string"), "Testing title");
51 54
52 %!demo 55 %!demo
53 %! clf (); 56 %! clf ();
54 %! plot3 ([0,1], [0,1], [0,1]); 57 %! plot3 ([0,1], [0,1], [0,1]);
55 %! xl = get(gca (), "title"); 58 %! xl = get(gca (), "title");
56 %! title("Testing title") 59 %! title ("Testing title");
57 %! assert(get(xl,"string"),"Testing title") 60 %! assert (get (xl,"string"),"Testing title");
58 61
59 %!test 62 %!test
60 %! hf = figure ("visible", "off"); 63 %! hf = figure ("visible", "off");
61 %! unwind_protect 64 %! unwind_protect
62 %! ax=axes(); 65 %! ax = axes();
63 %! xl = get(ax,"title"); 66 %! xl = get (ax,"title");
64 %! title("Testing title") 67 %! title ("Testing title");
65 %! assert(get(xl,"string"),"Testing title") 68 %! assert (get (xl,"string"), "Testing title");
66 %! unwind_protect_cleanup 69 %! unwind_protect_cleanup
67 %! close (hf); 70 %! close (hf);
68 %! end_unwind_protect 71 %! end_unwind_protect
69 72
70 %!test 73 %!test
71 %! hf = figure ("visible", "off"); 74 %! hf = figure ("visible", "off");
72 %! unwind_protect 75 %! unwind_protect
73 %! plot3 ([0,1], [0,1], [0,1]); 76 %! plot3 ([0,1], [0,1], [0,1]);
74 %! xl = get(gca (), "title"); 77 %! xl = get (gca (), "title");
75 %! title("Testing title") 78 %! title("Testing title");
76 %! assert(get(xl,"string"),"Testing title") 79 %! assert (get (xl,"string"), "Testing title");
77 %! unwind_protect_cleanup 80 %! unwind_protect_cleanup
78 %! close (hf); 81 %! close (hf);
79 %! end_unwind_protect 82 %! end_unwind_protect
83