annotate scripts/plot/xlim.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 e81ddf9cacd5
children 72c96de7a403
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11523
fd0a3ac60b0e update copyright notices
John W. Eaton <jwe@octave.org>
parents: 11189
diff changeset
1 ## Copyright (C) 2007-2011 David Bateman
7050
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
2 ##
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
3 ## This file is part of Octave.
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
4 ##
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
8 ## your option) any later version.
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
9 ##
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
13 ## General Public License for more details.
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
14 ##
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
18
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
19 ## -*- texinfo -*-
10793
be55736a0783 Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents: 9245
diff changeset
20 ## @deftypefn {Function File} {@var{xl} =} xlim ()
7050
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
21 ## @deftypefnx {Function File} {} xlim (@var{xl})
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
22 ## @deftypefnx {Function File} {@var{m} =} xlim ('mode')
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
23 ## @deftypefnx {Function File} {} xlim (@var{m})
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
24 ## @deftypefnx {Function File} {} xlim (@var{h}, @dots{})
9209
923c7cb7f13f Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents: 9040
diff changeset
25 ## Get or set the limits of the x-axis of the current plot. Called without
923c7cb7f13f Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents: 9040
diff changeset
26 ## arguments @code{xlim} returns the x-axis limits of the current plot.
923c7cb7f13f Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents: 9040
diff changeset
27 ## If passed a two element vector @var{xl}, the limits of the x-axis are set
7050
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
28 ## to this value.
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
29 ##
9209
923c7cb7f13f Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents: 9040
diff changeset
30 ## The current mode for calculation of the x-axis can be returned with a
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
31 ## call @code{xlim ('mode')}, and can be either 'auto' or 'manual'. The
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
32 ## current plotting mode can be set by passing either 'auto' or 'manual'
7050
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
33 ## as the argument.
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
34 ##
11189
a3cb42b394eb Fix typos in docstring and demo string.
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
35 ## If passed a handle as the first argument, then operate on this handle
7050
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
36 ## rather than the current axes handle.
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
37 ## @seealso{ylim, zlim, set, get, gca}
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
38 ## @end deftypefn
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
39
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
40 function retval = xlim (varargin)
7208
a730e47fda4d [project @ 2007-11-28 02:32:41 by jwe]
jwe
parents: 7050
diff changeset
41 ret = __axes_limits__ ("xlim", varargin{:});
7050
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
42
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
43 if (! isempty (ret))
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
44 retval = ret;
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
45 endif
bd56a0609c4f [project @ 2007-10-23 12:02:17 by dbateman]
dbateman
parents:
diff changeset
46 endfunction
13083
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
47
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
48 %!demo
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
49 %! clf ();
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
50 %! line ();
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
51 %! xlim ([0.2, 0.8]);
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
52 %! title ("xlim is [0.2, 0.8]");
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
53 %! assert (xlim (), [0.2, 0.8]);
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
54
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
55 %!demo
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
56 %! clf ();
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
57 %! line ();
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
58 %! xlim ('auto');
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
59 %! title ("xlim is auto");
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
60 %! assert (xlim ("mode"), "auto");
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
61
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
62 %!demo
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
63 %! clf ();
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
64 %! plot3 ([0,1], [0,1], [0,1]);
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
65 %! xlim ([0.2, 0.8]);
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
66 %! title ("xlim is [0.2, 0.8]");
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
67 %! assert (xlim (), [0.2, 0.8]);
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
68
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
69 %!demo
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
70 %! clf ();
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
71 %! plot3 ([0,1], [0,1], [0,1]);
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
72 %! xlim ('auto');
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
73 %! title ("xlim is auto");
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
74 %! assert (xlim ("mode"), "auto");
0e231bbd78bc codesprint: demos for xlim, ylim, and zlim
John W. Eaton <jwe@octave.org>
parents: 11587
diff changeset
75
13096
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
76
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
77 %!test
13124
2ea1658ad049 Don't use explicit figure number for tests to avoid interference with any figures opened by user.
Kai Habel <kai.habel@gmx.de>
parents: 13096
diff changeset
78 %! hf = figure ("visible", "off");
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 13124
diff changeset
79 %! unwind_protect
13096
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
80 %! plot3 ([0,1], [0,1], [0,1]);
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
81 %! xlim ([0, 1.1]);
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
82 %! assert (get (gca, "xlim"), [0, 1.1], eps);
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
83 %! assert (xlim ("mode"), "manual");
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
84 %! unwind_protect_cleanup
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
85 %! close (hf);
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
86 %! end_unwind_protect
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
87
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
88 %!test
13124
2ea1658ad049 Don't use explicit figure number for tests to avoid interference with any figures opened by user.
Kai Habel <kai.habel@gmx.de>
parents: 13096
diff changeset
89 %! hf = figure ("visible", "off");
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 13124
diff changeset
90 %! unwind_protect
13096
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
91 %! h = plot3 ([0,1.1], [0,1], [0, 1]);
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
92 %! assert (get (gca, "xlim"), [0, 1.4], eps);
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
93 %! assert (xlim ("mode"), "auto");
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
94 %! unwind_protect_cleanup
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
95 %! close (hf);
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13083
diff changeset
96 %! end_unwind_protect