Mercurial > hg > octave-lyh
annotate scripts/plot/xlim.m @ 13141:e81ddf9cacd5
maint: untabify and remove trailing whitespace from source files
* bicg.m, gmres.m, pkg.m: Untabify and remove trailing whitespace.
* libcruft/Makefile.am, libcruft/blas-xtra/cdotc3.f,
libcruft/blas-xtra/cmatm3.f, libcruft/blas-xtra/ddot3.f,
libcruft/blas-xtra/dmatm3.f, libcruft/blas-xtra/sdot3.f,
libcruft/blas-xtra/smatm3.f, libcruft/blas-xtra/zdotc3.f,
libcruft/blas-xtra/zmatm3.f, libcruft/lapack-xtra/crsf2csf.f,
libcruft/lapack-xtra/zrsf2csf.f, liboctave/Array.cc,
liboctave/DASPK-opts.in, liboctave/DASRT-opts.in,
liboctave/DASSL-opts.in, liboctave/LSODE-opts.in,
liboctave/Makefile.a,mliboctave/Quad-opts.in,
liboctave/Sparse-perm-op-defs.h,
scripts/Makefile.a,mscripts/deprecated/glpkmex.m,
scripts/general/blkdiag.m, scripts/general/interp1.m,
scripts/general/profshow.m, scripts/general/quadl.m,
scripts/general/triplequad.m, scripts/help/__makeinfo__.m,
scripts/io/strread.m, scripts/io/textread.m, scripts/io/textscan.m,
scripts/linear-algebra/rank.m, scripts/miscellaneous/gzip.m,
scripts/miscellaneous/private/__xzip__.m,
scripts/miscellaneous/tempdir.m, scripts/miscellaneous/unpack.m,
scripts/pkg/pkg.m, scripts/plot/allchild.m, scripts/plot/ancestor.m,
scripts/plot/cla.m, scripts/plot/clf.m, scripts/plot/findall.m,
scripts/plot/findobj.m, scripts/plot/gca.m, scripts/plot/gcf.m,
scripts/plot/hggroup.m, scripts/plot/isfigure.m,
scripts/plot/ishghandle.m, scripts/plot/legend.m,
scripts/plot/line.m, scripts/plot/loglog.m, scripts/plot/patch.m,
scripts/plot/print.m, scripts/plot/private/__quiver__.m,
scripts/plot/private/__scatter__.m, scripts/plot/rectangle.m,
scripts/plot/semilogx.m, scripts/plot/semilogy.m,
scripts/plot/surface.m, scripts/plot/text.m, scripts/plot/title.m,
scripts/plot/trisurf.m, scripts/plot/view.m, scripts/plot/whitebg.m,
scripts/plot/xlabel.m, scripts/plot/xlim.m, scripts/plot/ylabel.m,
scripts/plot/ylim.m, scripts/plot/zlabel.m, scripts/plot/zlim.m,
scripts/polynomial/mkpp.m, scripts/polynomial/polygcd.m,
scripts/polynomial/ppint.m, scripts/polynomial/ppjumps.m,
scripts/polynomial/ppval.m, scripts/set/setxor.m,
scripts/sparse/bicgstab.m, scripts/sparse/cgs.m,
scripts/sparse/spconvert.m, scripts/specfun/nthroot.m,
scripts/strings/strmatch.m, scripts/strings/untabify.m,
scripts/testfun/demo.m, scripts/testfun/example.m,
src/DLD-FUNCTIONS/filter.cc, src/DLD-FUNCTIONS/mgorth.cc,
src/DLD-FUNCTIONS/quadcc.cc, src/DLD-FUNCTIONS/str2double.cc,
src/Makefile.a,msrc/gl-render.cc, src/gl2ps-renderer.cc,
src/graphics.cc, src/octave-config.cc.in, src/octave-config.in,
src/ov-class.h, src/ov-fcn.h, src/profiler.cc, src/profiler.h,
src/pt-binop.cc, src/pt-unop.cc, src/symtab.cc, src/txt-eng-ft.cc:
Remove trailing whitespace.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 15 Sep 2011 12:51:10 -0400 |
parents | 2ea1658ad049 |
children | 72c96de7a403 |
rev | line source |
---|---|
11523 | 1 ## Copyright (C) 2007-2011 David Bateman |
7050 | 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 3 of the License, or (at | |
8 ## your option) 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, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
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 | 21 ## @deftypefnx {Function File} {} xlim (@var{xl}) |
22 ## @deftypefnx {Function File} {@var{m} =} xlim ('mode') | |
23 ## @deftypefnx {Function File} {} xlim (@var{m}) | |
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 | 28 ## to this value. |
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 | 33 ## as the argument. |
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 | 36 ## rather than the current axes handle. |
37 ## @seealso{ylim, zlim, set, get, gca} | |
38 ## @end deftypefn | |
39 | |
40 function retval = xlim (varargin) | |
7208 | 41 ret = __axes_limits__ ("xlim", varargin{:}); |
7050 | 42 |
43 if (! isempty (ret)) | |
44 retval = ret; | |
45 endif | |
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 | 76 |
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 | 80 %! plot3 ([0,1], [0,1], [0,1]); |
81 %! xlim ([0, 1.1]); | |
82 %! assert (get (gca, "xlim"), [0, 1.1], eps); | |
83 %! assert (xlim ("mode"), "manual"); | |
84 %! unwind_protect_cleanup | |
85 %! close (hf); | |
86 %! end_unwind_protect | |
87 | |
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 | 91 %! h = plot3 ([0,1.1], [0,1], [0, 1]); |
92 %! assert (get (gca, "xlim"), [0, 1.4], eps); | |
93 %! assert (xlim ("mode"), "auto"); | |
94 %! unwind_protect_cleanup | |
95 %! close (hf); | |
96 %! end_unwind_protect |