Mercurial > octave
annotate scripts/plot/appearance/axis.m @ 22299:9fc91bb2aec3
doc: grammarcheck documentation for 4.2 release.
* container.txi, contrib.txi, diagperm.txi, errors.txi, external.txi,
func.txi, image.txi, nonlin.txi, numbers.txi, plot.txi, quad.txi, sparse.txi,
strings.txi, tips.txi, var.txi, vectorize.txi, __dispatch__.cc, cellfun.cc,
file-io.cc, gsvd.cc, load-path.cc, regexp.cc, __init_gnuplot__.cc,
__osmesa_print__.cc, qr.cc, xzip.cc, ov-classdef.cc, octave_config_info.m,
grabcode.m, publish.m, dialog.m, condest.m, normest1.m, mkdir.m, ode23.m,
ode45.m, odeplot.m, AbsRel_Norm.m, integrate_adaptive.m, integrate_const.m,
integrate_n_steps.m, axis.m, isocaps.m, isocolors.m, isosurface.m, light.m,
__calc_isovalue_from_data__.m, __marching_cube__.m, cov.m, median.m:
doc: grammarcheck documentation for 4.2 release.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 15 Aug 2016 10:05:50 -0700 |
parents | 6bb0f32d22a5 |
children | 1c4cd12987f5 |
rev | line source |
---|---|
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
1 ## Copyright (C) 1994-2015 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 | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
2313 | 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 | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
590 | 18 |
3368 | 19 ## -*- texinfo -*- |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20778
diff
changeset
|
20 ## @deftypefn {} {} axis () |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
21 ## @deftypefnx {} {} axis ([@var{x_lo} @var{x_hi}]) |
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
22 ## @deftypefnx {} {} axis ([@var{x_lo} @var{x_hi} @var{y_lo} @var{y_hi}]) |
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
23 ## @deftypefnx {} {} axis ([@var{x_lo} @var{x_hi} @var{y_lo} @var{y_hi} @var{z_lo} @var{z_hi}]) |
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
24 ## @deftypefnx {} {} axis ([@var{x_lo} @var{x_hi} @var{y_lo} @var{y_hi} @var{z_lo} @var{z_hi} @var{c_lo} @var{c_hi}]) |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20778
diff
changeset
|
25 ## @deftypefnx {} {} axis (@var{option}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20778
diff
changeset
|
26 ## @deftypefnx {} {} axis (@dots{}, @var{option}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20778
diff
changeset
|
27 ## @deftypefnx {} {} axis (@var{hax}, @dots{}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20778
diff
changeset
|
28 ## @deftypefnx {} {@var{limits} =} axis () |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17045
diff
changeset
|
29 ## Set axis limits and appearance. |
3426 | 30 ## |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
31 ## The argument @var{limits} should be a 2-, 4-, 6-, or 8-element vector. The |
11563
3c6e8aaa9555
Grammarcheck m-files before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
32 ## first and second elements specify the lower and upper limits for the |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
33 ## x-axis. The third and fourth specify the limits for the y-axis, the fifth |
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
34 ## and sixth specify the limits for the z-axis, and the seventh and eighth |
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
35 ## specify the limits for the color axis. The special values -Inf and Inf may |
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
36 ## be used to indicate that the limit should automatically be computed based |
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
37 ## on the data in the axis. |
3426 | 38 ## |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
39 ## Without any arguments, @code{axis} turns autoscaling on. |
4945 | 40 ## |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17045
diff
changeset
|
41 ## With one output argument, @code{@var{limits} = axis} returns the current |
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17045
diff
changeset
|
42 ## axis limits. |
3667 | 43 ## |
20173
777f26aa8e3e
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19880
diff
changeset
|
44 ## The vector argument specifying limits is optional, and additional string |
777f26aa8e3e
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19880
diff
changeset
|
45 ## arguments may be used to specify various axis properties. For example, |
3667 | 46 ## |
47 ## @example | |
48 ## axis ([1, 2, 3, 4], "square"); | |
49 ## @end example | |
50 ## | |
51 ## @noindent | |
3668 | 52 ## forces a square aspect ratio, and |
53 ## | |
54 ## @example | |
11563
3c6e8aaa9555
Grammarcheck m-files before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
55 ## axis ("tic", "labely"); |
3668 | 56 ## @end example |
57 ## | |
58 ## @noindent | |
22299
9fc91bb2aec3
doc: grammarcheck documentation for 4.2 release.
Rik <rik@octave.org>
parents:
22218
diff
changeset
|
59 ## turns tick marks on for all axes and tick mark labels on for the y-axis |
9fc91bb2aec3
doc: grammarcheck documentation for 4.2 release.
Rik <rik@octave.org>
parents:
22218
diff
changeset
|
60 ## only. |
3667 | 61 ## |
62 ## @noindent | |
63 ## The following options control the aspect ratio of the axes. | |
64 ## | |
11563
3c6e8aaa9555
Grammarcheck m-files before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
65 ## @table @asis |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
66 ## @item @qcode{"square"} |
21808
a4c744194bbb
Add equal data aspect ratio to gnuplot graphics toolkit 3D plots (bug #47974).
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
21385
diff
changeset
|
67 ## Force a square axis aspect ratio. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
68 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
69 ## @item @qcode{"equal"} |
21808
a4c744194bbb
Add equal data aspect ratio to gnuplot graphics toolkit 3D plots (bug #47974).
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
21385
diff
changeset
|
70 ## Force x-axis unit distance to equal y-axis (and z-axis) unit distance. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
71 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
72 ## @item @qcode{"normal"} |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17045
diff
changeset
|
73 ## Restore default aspect ratio. |
3667 | 74 ## @end table |
75 ## | |
76 ## @noindent | |
77 ## The following options control the way axis limits are interpreted. | |
78 ## | |
11563
3c6e8aaa9555
Grammarcheck m-files before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
79 ## @table @asis |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
80 ## @item @qcode{"auto[xyz]"} |
20173
777f26aa8e3e
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19880
diff
changeset
|
81 ## Set the specified axes to have nice limits around the data or all if no |
777f26aa8e3e
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19880
diff
changeset
|
82 ## axes are specified. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
83 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
84 ## @item @qcode{"manual"} |
3667 | 85 ## Fix the current axes limits. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
86 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
87 ## @item @qcode{"tight"} |
9277
be84e9654feb
Update axis.m documentation to reflect addition of "tight" option.
Rik <rdrider0-list@yahoo.com>
parents:
9209
diff
changeset
|
88 ## Fix axes to the limits of the data. |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17045
diff
changeset
|
89 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
90 ## @item @qcode{"image"} |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
91 ## Equivalent to @qcode{"tight"} and @qcode{"equal"}. |
3667 | 92 ## @end table |
93 ## | |
94 ## @noindent | |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
95 ## The following options affect the appearance of tick marks. |
3667 | 96 ## |
11563
3c6e8aaa9555
Grammarcheck m-files before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
97 ## @table @asis |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
98 ## @item @qcode{"on"} |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
99 ## Turn tick marks and labels on for all axes. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
100 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
101 ## @item @qcode{"off"} |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
102 ## Turn tick marks off for all axes. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
103 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
104 ## @item @qcode{"tic[xyz]"} |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
105 ## Turn tick marks on for all axes, or turn them on for the specified axes and |
20173
777f26aa8e3e
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19880
diff
changeset
|
106 ## off for the remainder. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
107 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
108 ## @item @qcode{"label[xyz]"} |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
109 ## Turn tick labels on for all axes, or turn them on for the specified axes |
20173
777f26aa8e3e
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19880
diff
changeset
|
110 ## and off for the remainder. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
111 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
112 ## @item @qcode{"nolabel"} |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
113 ## Turn tick labels off for all axes. |
3667 | 114 ## @end table |
15007
8f0e3c5bfa5f
doc: Periodic grammarcheck of documentation
Rik <rik@octave.org>
parents:
14868
diff
changeset
|
115 ## |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
116 ## Note, if there are no tick marks for an axis, there can be no labels. |
3667 | 117 ## |
118 ## @noindent | |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17045
diff
changeset
|
119 ## The following options affect the direction of increasing values on the axes. |
3667 | 120 ## |
11563
3c6e8aaa9555
Grammarcheck m-files before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
121 ## @table @asis |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
122 ## @item @qcode{"ij"} |
3667 | 123 ## Reverse y-axis, so lower values are nearer the top. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
124 ## |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17211
diff
changeset
|
125 ## @item @qcode{"xy"} |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
126 ## Restore y-axis, so higher values are nearer the top. |
3667 | 127 ## @end table |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
128 ## |
20173
777f26aa8e3e
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19880
diff
changeset
|
129 ## If the first argument @var{hax} is an axes handle, then operate on this |
777f26aa8e3e
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19880
diff
changeset
|
130 ## axes rather than the current axes returned by @code{gca}. |
17122
eaab03308c0b
doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents:
17045
diff
changeset
|
131 ## |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
132 ## @seealso{xlim, ylim, zlim, daspect, pbaspect, box, grid, caxis} |
3368 | 133 ## @end deftypefn |
590 | 134 |
2314 | 135 ## Author: jwe |
136 | |
17045
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
137 function limits = axis (varargin) |
590 | 138 |
17045
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
139 [hax, varargin, nargin] = __plt_get_axis_arg__ ("axis", varargin{:}); |
7216 | 140 |
17211
87ba70043bfc
Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
141 oldfig = []; |
17301
68bcac3c043a
Correct inversion accidentally introduced in cset 87ba70043bfc.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
142 if (! isempty (hax)) |
17211
87ba70043bfc
Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
143 oldfig = get (0, "currentfigure"); |
87ba70043bfc
Don't use ifelse in plot fcns to avoid unnecessary fcn evaluations.
Rik <rik@octave.org>
parents:
17190
diff
changeset
|
144 endif |
7215 | 145 unwind_protect |
17045
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
146 if (isempty (hax)) |
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
147 hax = gca (); |
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
148 endif |
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
149 if (nargin == 0) |
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
150 limits = __axis__ (hax, varargin{:}); |
7189 | 151 else |
17045
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
152 __axis__ (hax, varargin{:}); |
7189 | 153 endif |
7215 | 154 unwind_protect_cleanup |
17045
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
155 if (! isempty (oldfig)) |
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
156 set (0, "currentfigure", oldfig); |
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
157 endif |
7215 | 158 end_unwind_protect |
590 | 159 |
7189 | 160 endfunction |
161 | |
17045
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
162 function limits = __axis__ (ca, ax, varargin) |
7189 | 163 |
164 if (nargin == 1) | |
4945 | 165 if (nargout == 0) |
6257 | 166 set (ca, "xlimmode", "auto", "ylimmode", "auto", "zlimmode", "auto"); |
4945 | 167 else |
6257 | 168 xlim = get (ca, "xlim"); |
169 ylim = get (ca, "ylim"); | |
9427
7b74a7fd4761
axis: return 4-element vector for 2-d view
John W. Eaton <jwe@octave.org>
parents:
9357
diff
changeset
|
170 view = get (ca, "view"); |
7b74a7fd4761
axis: return 4-element vector for 2-d view
John W. Eaton <jwe@octave.org>
parents:
9357
diff
changeset
|
171 if (view(2) == 90) |
17045
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
172 limits = [xlim, ylim]; |
9427
7b74a7fd4761
axis: return 4-element vector for 2-d view
John W. Eaton <jwe@octave.org>
parents:
9357
diff
changeset
|
173 else |
10549 | 174 zlim = get (ca, "zlim"); |
17045
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
175 limits = [xlim, ylim, zlim]; |
9427
7b74a7fd4761
axis: return 4-element vector for 2-d view
John W. Eaton <jwe@octave.org>
parents:
9357
diff
changeset
|
176 endif |
4945 | 177 endif |
3667 | 178 |
5443 | 179 elseif (ischar (ax)) |
4340 | 180 len = length (ax); |
3667 | 181 |
182 ## 'matrix mode' to reverse the y-axis | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
183 if (strcmpi (ax, "ij")) |
6257 | 184 set (ca, "ydir", "reverse"); |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
185 elseif (strcmpi (ax, "xy")) |
6257 | 186 set (ca, "ydir", "normal"); |
3667 | 187 |
188 ## aspect ratio | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
189 elseif (strcmpi (ax, "image")) |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
190 __axis__ (ca, "equal"); |
18475
00d684465379
axis.m: Make "image" and "square" compatible with Matlab (bug #41581).
Rik <rik@octave.org>
parents:
18468
diff
changeset
|
191 set (ca, "plotboxaspectratiomode", "auto"); |
7376 | 192 __do_tight_option__ (ca); |
8953
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8920
diff
changeset
|
193 elseif (strcmpi (ax, "square")) |
18475
00d684465379
axis.m: Make "image" and "square" compatible with Matlab (bug #41581).
Rik <rik@octave.org>
parents:
18468
diff
changeset
|
194 set (ca, "dataaspectratiomode", "auto", |
00d684465379
axis.m: Make "image" and "square" compatible with Matlab (bug #41581).
Rik <rik@octave.org>
parents:
18468
diff
changeset
|
195 "plotboxaspectratio", [1, 1, 1]); |
14552
86854d032a37
maint: miscellaneous style fixes for .m files
John W. Eaton <jwe@octave.org>
parents:
14247
diff
changeset
|
196 elseif (strcmp (ax, "equal")) |
18468 | 197 set (ca, "dataaspectratio", [1, 1, 1], "plotboxaspectratio", [5 4 4]); |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18668
diff
changeset
|
198 |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
199 elseif (strcmpi (ax, "normal")) |
18468 | 200 ## Set plotboxaspectratio to something obtuse so that switching |
201 ## back to "auto" will force a re-calculation. | |
202 set (ca, "plotboxaspectratio", [3 2 1]); | |
203 set (ca, "plotboxaspectratiomode", "auto", | |
204 "dataaspectratiomode", "auto"); | |
3667 | 205 |
206 ## axis limits | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
207 elseif (len >= 4 && strcmpi (ax(1:4), "auto")) |
4340 | 208 if (len > 4) |
10549 | 209 if (any (ax == "x")) |
210 set (ca, "xlimmode", "auto"); | |
211 endif | |
212 if (any (ax == "y")) | |
213 set (ca, "ylimmode", "auto"); | |
214 endif | |
215 if (any (ax == "z")) | |
216 set (ca, "zlimmode", "auto"); | |
217 endif | |
3667 | 218 else |
10549 | 219 set (ca, "xlimmode", "auto", "ylimmode", "auto", "zlimmode", "auto"); |
3667 | 220 endif |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
221 elseif (strcmpi (ax, "manual")) |
3667 | 222 ## fixes the axis limits, like axis(axis) should; |
6257 | 223 set (ca, "xlimmode", "manual", "ylimmode", "manual", "zlimmode", "manual"); |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
224 elseif (strcmpi (ax, "tight")) |
7376 | 225 ## sets the axis limits to the min and max of all data. |
226 __do_tight_option__ (ca); | |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
227 ## tick marks |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
228 elseif (strcmpi (ax, "on") || strcmpi (ax, "tic")) |
6257 | 229 set (ca, "xtickmode", "auto", "ytickmode", "auto", "ztickmode", "auto"); |
8953
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8920
diff
changeset
|
230 if (strcmpi (ax, "on")) |
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8920
diff
changeset
|
231 set (ca, "xticklabelmode", "auto", "yticklabelmode", "auto", |
10549 | 232 "zticklabelmode", "auto"); |
8953
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8920
diff
changeset
|
233 endif |
6765 | 234 set (ca, "visible", "on"); |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
235 elseif (strcmpi (ax, "off")) |
6257 | 236 set (ca, "xtick", [], "ytick", [], "ztick", []); |
6765 | 237 set (ca, "visible", "off"); |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
238 elseif (len > 3 && strcmpi (ax(1:3), "tic")) |
4340 | 239 if (any (ax == "x")) |
10549 | 240 set (ca, "xtickmode", "auto"); |
3667 | 241 else |
10549 | 242 set (ca, "xtick", []); |
3667 | 243 endif |
4340 | 244 if (any (ax == "y")) |
10549 | 245 set (ca, "ytickmode", "auto"); |
3667 | 246 else |
10549 | 247 set (ca, "ytick", []); |
3667 | 248 endif |
4340 | 249 if (any (ax == "z")) |
10549 | 250 set (ca, "ztickmode", "auto"); |
3667 | 251 else |
10549 | 252 set (ca, "ztick", []); |
3667 | 253 endif |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
254 elseif (strcmpi (ax, "label")) |
6257 | 255 set (ca, "xticklabelmode", "auto", "yticklabelmode", "auto", |
10549 | 256 "zticklabelmode", "auto"); |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
257 elseif (strcmpi (ax, "nolabel")) |
6257 | 258 set (ca, "xticklabel", "", "yticklabel", "", "zticklabel", ""); |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
259 elseif (len > 5 && strcmpi (ax(1:5), "label")) |
4340 | 260 if (any (ax == "x")) |
10549 | 261 set (ca, "xticklabelmode", "auto"); |
3667 | 262 else |
10549 | 263 set (ca, "xticklabel", ""); |
3667 | 264 endif |
4340 | 265 if (any (ax == "y")) |
10549 | 266 set (ca, "yticklabelmode", "auto"); |
3667 | 267 else |
10549 | 268 set (ca, "yticklabel", ""); |
3667 | 269 endif |
4340 | 270 if (any (ax == "z")) |
10549 | 271 set (ca, "zticklabelmode", "auto"); |
3667 | 272 else |
10549 | 273 set (ca, "zticklabel", ""); |
3667 | 274 endif |
275 | |
276 else | |
20727
a5949b3d2332
Preface warning() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20711
diff
changeset
|
277 warning ("axis: unknown option '%s'", ax); |
3667 | 278 endif |
279 | |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
280 elseif (isnumeric (ax) && isvector (ax)) |
590 | 281 |
282 len = length (ax); | |
283 | |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
284 if (len != 2 && len != 4 && len != 6 && len != 8) |
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
285 error ("axis: LIMITS vector must have 2, 4, 6, or 8 elements"); |
590 | 286 endif |
287 | |
5627 | 288 for i = 1:2:len |
13031 | 289 if (ax(i) >= ax(i+1)) |
20711
7b608fadc663
Make error messages more specific about the variable and problem encountered.
Rik <rik@octave.org>
parents:
20231
diff
changeset
|
290 error ("axis: LIMITS(%d) must be less than LIMITS(%d)", i, i+1); |
5627 | 291 endif |
292 endfor | |
293 | |
590 | 294 if (len > 1) |
18669
cf3db95a75f0
axis.m: Fix regression when accepting input handle (cset 5032ac119d52).
Rik <rik@octave.org>
parents:
18588
diff
changeset
|
295 xlim (ca, ax(1:2)); |
590 | 296 endif |
297 | |
298 if (len > 3) | |
18669
cf3db95a75f0
axis.m: Fix regression when accepting input handle (cset 5032ac119d52).
Rik <rik@octave.org>
parents:
18588
diff
changeset
|
299 ylim (ca, ax(3:4)); |
590 | 300 endif |
301 | |
302 if (len > 5) | |
18669
cf3db95a75f0
axis.m: Fix regression when accepting input handle (cset 5032ac119d52).
Rik <rik@octave.org>
parents:
18588
diff
changeset
|
303 zlim (ca, ax(5:6)); |
590 | 304 endif |
305 | |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
306 if (len > 7) |
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
307 clim (ca, ax(7:8)); |
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
308 endif |
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
309 |
590 | 310 else |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
311 error ("axis: expecting no args, or a numeric vector with 2, 4, 6, or 8 elements"); |
590 | 312 endif |
313 | |
7376 | 314 if (! isempty (varargin)) |
7189 | 315 __axis__ (ca, varargin{:}); |
3667 | 316 endif |
6447 | 317 |
590 | 318 endfunction |
3667 | 319 |
7376 | 320 function lims = __get_tight_lims__ (ca, ax) |
321 | |
322 ## Get the limits for axis ("tight"). | |
323 ## AX should be one of "x", "y", or "z". | |
20778
8513c84a13cb
Use parser string concatenation rather than strcat() for performance in m-files.
Rik <rik@octave.org>
parents:
20727
diff
changeset
|
324 kids = findobj (ca, "-property", [ax "data"]); |
14054
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
325 ## The data properties for hggroups mirror their children. |
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
326 ## Exclude the redundant hgroup values. |
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
327 hg_kids = findobj (kids, "type", "hggroup"); |
11174
2114867f2a50
axis.m: Exclude hggroup {x,y,z}data properties when determing tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
11001
diff
changeset
|
328 kids = setdiff (kids, hg_kids); |
7376 | 329 if (isempty (kids)) |
330 ## Return the current limits. | |
20778
8513c84a13cb
Use parser string concatenation rather than strcat() for performance in m-files.
Rik <rik@octave.org>
parents:
20727
diff
changeset
|
331 lims = get (ca, [ax "lim"]); |
7376 | 332 else |
20778
8513c84a13cb
Use parser string concatenation rather than strcat() for performance in m-files.
Rik <rik@octave.org>
parents:
20727
diff
changeset
|
333 data = get (kids, [ax "data"]); |
18524
bf0d2e51c8f0
axis.m: make 'tight' embrace whole images (bug #36594).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18475
diff
changeset
|
334 types = get (kids, "type"); |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18668
diff
changeset
|
335 |
20778
8513c84a13cb
Use parser string concatenation rather than strcat() for performance in m-files.
Rik <rik@octave.org>
parents:
20727
diff
changeset
|
336 scale = get (ca, [ax "scale"]); |
14054
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
337 if (! iscell (data)) |
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
338 data = {data}; |
14552
86854d032a37
maint: miscellaneous style fixes for .m files
John W. Eaton <jwe@octave.org>
parents:
14247
diff
changeset
|
339 endif |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18668
diff
changeset
|
340 |
18524
bf0d2e51c8f0
axis.m: make 'tight' embrace whole images (bug #36594).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18475
diff
changeset
|
341 ## Extend image data one pixel |
bf0d2e51c8f0
axis.m: make 'tight' embrace whole images (bug #36594).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18475
diff
changeset
|
342 idx = strcmp (types, "image"); |
18668
01aa90ece9a4
axis.m: Fix regression setting tight limits on non-image objects.
Rik <rik@octave.org>
parents:
18524
diff
changeset
|
343 if (any (idx) && (ax == "x" || ax == "y")) |
18524
bf0d2e51c8f0
axis.m: make 'tight' embrace whole images (bug #36594).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18475
diff
changeset
|
344 imdata = data(idx); |
bf0d2e51c8f0
axis.m: make 'tight' embrace whole images (bug #36594).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18475
diff
changeset
|
345 px = arrayfun (@__image_pixel_size__, kids(idx), "uniformoutput", false); |
bf0d2e51c8f0
axis.m: make 'tight' embrace whole images (bug #36594).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18475
diff
changeset
|
346 ipx = ifelse (ax == "x", 1, 2); |
bf0d2e51c8f0
axis.m: make 'tight' embrace whole images (bug #36594).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18475
diff
changeset
|
347 imdata = cellfun (@(x,dx) [(min (x) - dx(ipx)), (max (x) + dx(ipx))], |
bf0d2e51c8f0
axis.m: make 'tight' embrace whole images (bug #36594).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18475
diff
changeset
|
348 imdata, px, "uniformoutput", false); |
bf0d2e51c8f0
axis.m: make 'tight' embrace whole images (bug #36594).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18475
diff
changeset
|
349 data(idx) = imdata; |
bf0d2e51c8f0
axis.m: make 'tight' embrace whole images (bug #36594).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18475
diff
changeset
|
350 endif |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18668
diff
changeset
|
351 |
14054
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
352 if (strcmp (scale, "log")) |
14063
6875d23ce051
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
Ben Abbott <bpabbott@mac.com>
parents:
14054
diff
changeset
|
353 tmp = data; |
6875d23ce051
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
Ben Abbott <bpabbott@mac.com>
parents:
14054
diff
changeset
|
354 data = cellfun (@(x) x(x>0), tmp, "uniformoutput", false); |
17426
aa380b380315
axis.m: Fix bug when data sets differ in size and dimension (bug #40036).
Rik <rik@octave.org>
parents:
17386
diff
changeset
|
355 n = cellfun ("isempty", data); |
14063
6875d23ce051
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
Ben Abbott <bpabbott@mac.com>
parents:
14054
diff
changeset
|
356 data(n) = cellfun (@(x) x(x<0), tmp(n), "uniformoutput", false); |
13174
bd2cd4fd3edf
maint: use specific endif, endfor tokens instead of simple end
John W. Eaton <jwe@octave.org>
parents:
13154
diff
changeset
|
357 endif |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14552
diff
changeset
|
358 data = cellfun (@(x) x(isfinite (x)), data, "uniformoutput", false); |
14054
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
359 data = data(! cellfun ("isempty", data)); |
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
360 if (! isempty (data)) |
17426
aa380b380315
axis.m: Fix bug when data sets differ in size and dimension (bug #40036).
Rik <rik@octave.org>
parents:
17386
diff
changeset
|
361 ## Change data from cell array of various sizes to a single column vector |
aa380b380315
axis.m: Fix bug when data sets differ in size and dimension (bug #40036).
Rik <rik@octave.org>
parents:
17386
diff
changeset
|
362 data = cat (1, cellindexmat (data, ":"){:}); |
aa380b380315
axis.m: Fix bug when data sets differ in size and dimension (bug #40036).
Rik <rik@octave.org>
parents:
17386
diff
changeset
|
363 lims = [min(data), max(data)]; |
7376 | 364 else |
14054
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
365 lims = [0, 1]; |
8610
85c9906abfd1
use endif and endfor instead of end
John W. Eaton <jwe@octave.org>
parents:
8507
diff
changeset
|
366 endif |
85c9906abfd1
use endif and endfor instead of end
John W. Eaton <jwe@octave.org>
parents:
8507
diff
changeset
|
367 endif |
9357
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
368 |
7376 | 369 endfunction |
370 | |
371 function __do_tight_option__ (ca) | |
372 | |
17023 | 373 xlim = __get_tight_lims__ (ca, "x"); |
374 if (all (xlim == 0)) | |
375 xlim = eps () * [-1 1]; | |
376 elseif (diff (xlim == 0)) | |
20231
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
377 xlim .*= (1 + eps () * [-1, 1]); |
17023 | 378 endif |
379 ylim = __get_tight_lims__ (ca, "y"); | |
380 if (all (ylim == 0)) | |
381 ylim = eps () * [-1 1]; | |
382 elseif (diff (ylim == 0)) | |
20231
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
383 ylim .*= (1 + eps () * [-1, 1]); |
17023 | 384 endif |
21385
89fa0694aa2e
Fix check-missing-semicolon QA target (bug #47277).
Rik <rik@octave.org>
parents:
20852
diff
changeset
|
385 set (ca, "xlim", xlim, "ylim", ylim); |
17564
234731d524c2
axis.m: Fix 'axis tight' with pcolor plots.
Rik <rik@octave.org>
parents:
17427
diff
changeset
|
386 nd = __calc_dimensions__ (ca); |
234731d524c2
axis.m: Fix 'axis tight' with pcolor plots.
Rik <rik@octave.org>
parents:
17427
diff
changeset
|
387 is3dview = (get (ca, "view")(2) != 90); |
234731d524c2
axis.m: Fix 'axis tight' with pcolor plots.
Rik <rik@octave.org>
parents:
17427
diff
changeset
|
388 if (nd > 2 && is3dview) |
17023 | 389 zlim = __get_tight_lims__ (ca, "z"); |
390 if (all (zlim == 0)) | |
391 zlim = eps () * [-1 1]; | |
392 elseif (diff (zlim == 0)) | |
20231
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
393 zlim .*= (1 + eps () * [-1, 1]); |
17023 | 394 endif |
395 set (ca, "zlim", zlim); | |
11183
ac6a199be45e
Leave zlim unchanged during 'axis tight' on 2D plots
Konstantinos Poulios <logari81@googlemail.com>
parents:
11174
diff
changeset
|
396 endif |
7376 | 397 |
398 endfunction | |
399 | |
17045
6dec8dbf8a97
axis.m: Overhaul to use new __plt_get_axis_arg__.
Rik <rik@octave.org>
parents:
17026
diff
changeset
|
400 |
3667 | 401 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
402 %! clf; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
403 %! t = 0:0.01:2*pi; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
404 %! x = sin (t); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
405 %! |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
406 %! subplot (221); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
407 %! plot (t, x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
408 %! title ('normal plot'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
409 %! |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
410 %! subplot (222); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
411 %! plot (t, x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
412 %! title ('square plot'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
413 %! axis ('square'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
414 %! |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
415 %! subplot (223); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
416 %! plot (t, x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
417 %! title ('equal plot'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
418 %! axis ('equal'); |
3667 | 419 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
420 %! subplot (224); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
421 %! plot (t, x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
422 %! title ('normal plot again'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
423 %! axis ('normal'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
424 |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
425 %!demo |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
426 %! clf; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
427 %! t = 0:0.01:2*pi; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
428 %! x = sin (t); |
3667 | 429 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
430 %! subplot (121); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
431 %! plot (t, x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
432 %! title ('ij plot'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
433 %! axis ('ij'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
434 %! |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
435 %! subplot (122); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
436 %! plot (t, x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
437 %! title ('xy plot'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
438 %! axis ('xy'); |
3667 | 439 |
440 %!demo | |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
441 %! clf; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
442 %! t = 0:0.01:2*pi; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
443 %! x = sin (t); |
3667 | 444 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
445 %! subplot (331); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
446 %! plot (t, x); |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
447 %! title ('x ticks and labels'); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
448 %! axis ('ticx'); |
3667 | 449 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
450 %! subplot (332); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
451 %! plot (t, x); |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
452 %! title ('y ticks and labels'); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
453 %! axis ('ticy'); |
3667 | 454 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
455 %! subplot (333); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
456 %! plot (t, x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
457 %! title ('axis off'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
458 %! axis ('off'); |
3667 | 459 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
460 %! subplot (334); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
461 %! plot (t, x); |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
462 %! title ('x and y ticks, x labels'); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
463 %! axis ('labelx','tic'); |
3667 | 464 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
465 %! subplot (335); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
466 %! plot (t, x); |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
467 %! title ('x and y ticks, y labels'); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
468 %! axis ('labely','tic'); |
3667 | 469 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
470 %! subplot (336); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
471 %! plot (t, x); |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
472 %! title ('all ticks but no labels'); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
473 %! axis ('nolabel','tic'); |
3667 | 474 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
475 %! subplot (337); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
476 %! plot (t, x); |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
477 %! title ('x ticks, no labels'); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
478 %! axis ('nolabel','ticx'); |
3667 | 479 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
480 %! subplot (338); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
481 %! plot (t, x); |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
482 %! title ('y ticks, no labels'); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
483 %! axis ('nolabel','ticy'); |
3667 | 484 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
485 %! subplot (339); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
486 %! plot (t, x); |
22163
ae89334cb536
Support setting colormap min max with axis.m (bug #48566).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22151
diff
changeset
|
487 %! title ('all ticks and labels'); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
488 %! axis ('on'); |
3667 | 489 |
490 %!demo | |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
491 %! clf; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
492 %! t = 0:0.01:2*pi; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
493 %! x = sin (t); |
3667 | 494 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
495 %! subplot (321); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
496 %! plot (t, x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
497 %! title ('axes at [0 3 0 1]'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
498 %! axis ([0,3,0,1]); |
3667 | 499 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
500 %! subplot (322); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
501 %! plot (t, x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
502 %! title ('auto'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
503 %! axis ('auto'); |
3667 | 504 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
505 %! subplot (323); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
506 %! plot (t, x, ';sine [0:2pi];'); hold on; |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
507 %! plot (-3:3,-3:3, ';line (-3,-3)->(3,3);'); hold off; |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
508 %! title ('manual'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
509 %! axis ('manual'); |
3667 | 510 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
511 %! subplot (324); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
512 %! plot (t, x, ';sine [0:2pi];'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
513 %! title ('axes at [0 3 0 1], then autox'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
514 %! axis ([0,3,0,1]); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
515 %! axis ('autox'); |
3667 | 516 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
517 %! subplot (325); |
17026
be52288f827b
Tweak some plotting demos for messages and spelling.
Rik <rik@octave.org>
parents:
17023
diff
changeset
|
518 %! plot (t, x, ';sine [0:2pi];'); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
519 %! title ('axes at [3 6 0 1], then autoy'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
520 %! axis ([3,6,0,1]); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
521 %! axis ('autoy'); |
3667 | 522 %! |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
523 %! subplot (326); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
524 %! plot (t, sin(t), t, -2*sin(t/2)); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
525 %! axis ('tight'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
526 %! title ('tight'); |
8953
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8920
diff
changeset
|
527 |
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8920
diff
changeset
|
528 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
529 %! clf; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
530 %! x = 0:0.1:10; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
531 %! plot (x, sin(x)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
532 %! axis image; |
17026
be52288f827b
Tweak some plotting demos for messages and spelling.
Rik <rik@octave.org>
parents:
17023
diff
changeset
|
533 %! title ({'image', 'equivalent to "tight" & "equal"'}); |
8953
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8920
diff
changeset
|
534 |
9357
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
535 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
536 %! clf; |
14247
c4fa5e0b6193
test: Make surface demos reproducible by setting colormap to default at start of demo.
Rik <octave@nomad.inbox5.com>
parents:
14245
diff
changeset
|
537 %! colormap ('default'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
538 %! [x,y,z] = peaks (50); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
539 %! x1 = max (x(:)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
540 %! pcolor (x-x1, y-x1/2, z); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
541 %! hold on; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
542 %! [x,y,z] = sombrero (); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
543 %! s = x1 / max (x(:)); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
544 %! pcolor (s*x+x1, s*y+x1/2, 5*z); |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
545 %! axis tight; |
8953
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8920
diff
changeset
|
546 |
11201
6c8791cb35b1
__go_draw_axes__.m: Set proper tight axis limits for log scale.
Ben Abbott <bpabbott@mac.com>
parents:
11191
diff
changeset
|
547 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
548 %! clf; |
11201
6c8791cb35b1
__go_draw_axes__.m: Set proper tight axis limits for log scale.
Ben Abbott <bpabbott@mac.com>
parents:
11191
diff
changeset
|
549 %! x = -10:10; |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
550 %! plot (x,x, x,-x); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
551 %! set (gca, 'yscale', 'log'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
552 %! legend ({'x >= 1', 'x <= 1'}, 'location', 'north'); |
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
553 %! title ('ylim = [1, 10]'); |
11201
6c8791cb35b1
__go_draw_axes__.m: Set proper tight axis limits for log scale.
Ben Abbott <bpabbott@mac.com>
parents:
11191
diff
changeset
|
554 |
13154 | 555 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
556 %! clf; |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
557 %! loglog (1:20, '-s'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
558 %! axis tight; |
13154 | 559 |
13322
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
560 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
561 %! clf; |
13322
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
562 %! x = -10:0.1:10; |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
563 %! y = sin (x)./(1 + abs (x)) + 0.1*x - 0.4; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
564 %! plot (x, y); |
22151
283d8dfcad37
Make demos Matlab compatible for comparison with dump_demos script.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
565 %! set (gca, 'xaxislocation', 'origin'); |
283d8dfcad37
Make demos Matlab compatible for comparison with dump_demos script.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
566 %! set (gca, 'yaxislocation', 'origin'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
567 %! box off; |
22151
283d8dfcad37
Make demos Matlab compatible for comparison with dump_demos script.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
568 %! title ({'no plot box', 'xaxislocation = origin, yaxislocation = origin'}); |
13322
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
569 |
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
570 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
571 %! clf; |
13322
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
572 %! x = -10:0.1:10; |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
573 %! y = sin (x)./(1+abs (x)) + 0.1*x - 0.4; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
574 %! plot (x, y); |
22151
283d8dfcad37
Make demos Matlab compatible for comparison with dump_demos script.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
575 %! set (gca, 'xaxislocation', 'origin'); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
576 %! set (gca, 'yaxislocation', 'left'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
577 %! box off; |
22151
283d8dfcad37
Make demos Matlab compatible for comparison with dump_demos script.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
578 %! title ({'no plot box', 'xaxislocation = origin, yaxislocation = left'}); |
13322
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
579 |
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
580 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
581 %! clf; |
13322
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
582 %! x = -10:0.1:10; |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
583 %! y = sin (x)./(1+abs (x)) + 0.1*x - 0.4; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
584 %! plot (x, y); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
585 %! title ('no plot box'); |
22151
283d8dfcad37
Make demos Matlab compatible for comparison with dump_demos script.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
586 %! set (gca, 'xaxislocation', 'origin'); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
587 %! set (gca, 'yaxislocation', 'right'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
588 %! box off; |
22151
283d8dfcad37
Make demos Matlab compatible for comparison with dump_demos script.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
589 %! title ({'no plot box', 'xaxislocation = origin, yaxislocation = right'}); |
13322
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
590 |
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
591 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
592 %! clf; |
13322
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
593 %! x = -10:0.1:10; |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
594 %! y = sin (x)./(1+abs (x)) + 0.1*x - 0.4; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
595 %! plot (x, y); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
596 %! set (gca, 'xaxislocation', 'bottom'); |
22151
283d8dfcad37
Make demos Matlab compatible for comparison with dump_demos script.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
597 %! set (gca, 'yaxislocation', 'origin'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
598 %! box off; |
22151
283d8dfcad37
Make demos Matlab compatible for comparison with dump_demos script.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
599 %! title ({'no plot box', 'xaxislocation = bottom, yaxislocation = origin'}); |
13322
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
600 |
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
601 %!demo |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
602 %! clf; |
13322
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
603 %! x = -10:0.1:10; |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
604 %! y = sin (x)./(1+abs (x)) + 0.1*x - 0.4; |
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
605 %! plot (x, y); |
14245
4506eade9f04
Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents:
14237
diff
changeset
|
606 %! set (gca, 'xaxislocation', 'top'); |
22151
283d8dfcad37
Make demos Matlab compatible for comparison with dump_demos script.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
607 %! set (gca, 'yaxislocation', 'origin'); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
608 %! box off; |
22151
283d8dfcad37
Make demos Matlab compatible for comparison with dump_demos script.
Rik <rik@octave.org>
parents:
22069
diff
changeset
|
609 %! title ({'no plot box', 'xaxislocation = top, yaxislocation = origin'}); |
13322
16a706965ee0
Allow the axis box to be turned off for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
13175
diff
changeset
|
610 |
14054
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
611 %!test |
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
612 %! hf = figure ("visible", "off"); |
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
613 %! unwind_protect |
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
614 %! plot (11:20, [21:24, NaN, -Inf, 27:30]); |
22069
9121d6584f6a
Overhaul graphics implementation of hold() (bug #43559).
Rik <rik@octave.org>
parents:
21808
diff
changeset
|
615 %! hold on; |
14054
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
616 %! plot (11:20, 25.5 + rand (10)); |
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
617 %! axis tight; |
14063
6875d23ce051
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
Ben Abbott <bpabbott@mac.com>
parents:
14054
diff
changeset
|
618 %! assert (axis (), [11 20 21 30]); |
14054
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
619 %! unwind_protect_cleanup |
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
620 %! close (hf); |
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
621 %! end_unwind_protect |
ec79cd8359c5
Ignore Inf when determining tight axis limits.
Ben Abbott <bpabbott@mac.com>
parents:
13322
diff
changeset
|
622 |
14063
6875d23ce051
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
Ben Abbott <bpabbott@mac.com>
parents:
14054
diff
changeset
|
623 %!test |
6875d23ce051
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
Ben Abbott <bpabbott@mac.com>
parents:
14054
diff
changeset
|
624 %! hf = figure ("visible", "off"); |
6875d23ce051
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
Ben Abbott <bpabbott@mac.com>
parents:
14054
diff
changeset
|
625 %! unwind_protect |
6875d23ce051
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
Ben Abbott <bpabbott@mac.com>
parents:
14054
diff
changeset
|
626 %! a = logspace (-5, 1, 10); |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
627 %! loglog (a, -a); |
14063
6875d23ce051
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
Ben Abbott <bpabbott@mac.com>
parents:
14054
diff
changeset
|
628 %! axis tight; |
14237
11949c9795a0
Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
629 %! assert (axis (), [1e-5, 10, -10, -1e-5]); |
14063
6875d23ce051
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
Ben Abbott <bpabbott@mac.com>
parents:
14054
diff
changeset
|
630 %! unwind_protect_cleanup |
6875d23ce051
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
Ben Abbott <bpabbott@mac.com>
parents:
14054
diff
changeset
|
631 %! close (hf); |
6875d23ce051
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
Ben Abbott <bpabbott@mac.com>
parents:
14054
diff
changeset
|
632 %! end_unwind_protect |
6875d23ce051
Fix regression of tight axis limits introduced by changeset ec79cd8359c5.
Ben Abbott <bpabbott@mac.com>
parents:
14054
diff
changeset
|
633 |
17427
15d592c82abc
test: Add test for bug #40036 to axis.m
Rik <rik@octave.org>
parents:
17426
diff
changeset
|
634 ## Test 'axis tight' with differently oriented, differently numbered data vecs |
15d592c82abc
test: Add test for bug #40036 to axis.m
Rik <rik@octave.org>
parents:
17426
diff
changeset
|
635 ## Bug #40036. |
15d592c82abc
test: Add test for bug #40036 to axis.m
Rik <rik@octave.org>
parents:
17426
diff
changeset
|
636 %!test |
15d592c82abc
test: Add test for bug #40036 to axis.m
Rik <rik@octave.org>
parents:
17426
diff
changeset
|
637 %! hf = figure ("visible", "off"); |
15d592c82abc
test: Add test for bug #40036 to axis.m
Rik <rik@octave.org>
parents:
17426
diff
changeset
|
638 %! unwind_protect |
15d592c82abc
test: Add test for bug #40036 to axis.m
Rik <rik@octave.org>
parents:
17426
diff
changeset
|
639 %! Z = peaks (linspace (-3, 3, 49), linspace (-2, 2, 29)); |
15d592c82abc
test: Add test for bug #40036 to axis.m
Rik <rik@octave.org>
parents:
17426
diff
changeset
|
640 %! surf (Z); |
15d592c82abc
test: Add test for bug #40036 to axis.m
Rik <rik@octave.org>
parents:
17426
diff
changeset
|
641 %! axis tight; |
15d592c82abc
test: Add test for bug #40036 to axis.m
Rik <rik@octave.org>
parents:
17426
diff
changeset
|
642 %! assert (axis (), [1 49 1 29 min(Z(:)) max(Z(:))]); |
15d592c82abc
test: Add test for bug #40036 to axis.m
Rik <rik@octave.org>
parents:
17426
diff
changeset
|
643 %! unwind_protect_cleanup |
15d592c82abc
test: Add test for bug #40036 to axis.m
Rik <rik@octave.org>
parents:
17426
diff
changeset
|
644 %! close (hf); |
15d592c82abc
test: Add test for bug #40036 to axis.m
Rik <rik@octave.org>
parents:
17426
diff
changeset
|
645 %! end_unwind_protect |
15d592c82abc
test: Add test for bug #40036 to axis.m
Rik <rik@octave.org>
parents:
17426
diff
changeset
|
646 |
22170
20257791e358
avoid displaying plots in axis tests (bug #48602)
John W. Eaton <jwe@octave.org>
parents:
22163
diff
changeset
|
647 ## Even on errors, axis can display a figure. |
20257791e358
avoid displaying plots in axis tests (bug #48602)
John W. Eaton <jwe@octave.org>
parents:
22163
diff
changeset
|
648 |
22218
6bb0f32d22a5
axis.m: Clean up formatting in %!error tests.
Rik <rik@octave.org>
parents:
22170
diff
changeset
|
649 %!error <LIMITS vector must have .* elements> |
6bb0f32d22a5
axis.m: Clean up formatting in %!error tests.
Rik <rik@octave.org>
parents:
22170
diff
changeset
|
650 %! hf = figure ("visible", "off"); |
22170
20257791e358
avoid displaying plots in axis tests (bug #48602)
John W. Eaton <jwe@octave.org>
parents:
22163
diff
changeset
|
651 %! unwind_protect |
20257791e358
avoid displaying plots in axis tests (bug #48602)
John W. Eaton <jwe@octave.org>
parents:
22163
diff
changeset
|
652 %! axis (1:5) |
20257791e358
avoid displaying plots in axis tests (bug #48602)
John W. Eaton <jwe@octave.org>
parents:
22163
diff
changeset
|
653 %! unwind_protect_cleanup |
20257791e358
avoid displaying plots in axis tests (bug #48602)
John W. Eaton <jwe@octave.org>
parents:
22163
diff
changeset
|
654 %! close (hf); |
20257791e358
avoid displaying plots in axis tests (bug #48602)
John W. Eaton <jwe@octave.org>
parents:
22163
diff
changeset
|
655 %! end_unwind_protect |
20257791e358
avoid displaying plots in axis tests (bug #48602)
John W. Eaton <jwe@octave.org>
parents:
22163
diff
changeset
|
656 |
22218
6bb0f32d22a5
axis.m: Clean up formatting in %!error tests.
Rik <rik@octave.org>
parents:
22170
diff
changeset
|
657 %!error <expecting no args, or a numeric vector with .* elements> |
6bb0f32d22a5
axis.m: Clean up formatting in %!error tests.
Rik <rik@octave.org>
parents:
22170
diff
changeset
|
658 %! hf = figure ("visible", "off"); |
22170
20257791e358
avoid displaying plots in axis tests (bug #48602)
John W. Eaton <jwe@octave.org>
parents:
22163
diff
changeset
|
659 %! unwind_protect |
20257791e358
avoid displaying plots in axis tests (bug #48602)
John W. Eaton <jwe@octave.org>
parents:
22163
diff
changeset
|
660 %! axis ({1,2}) |
20257791e358
avoid displaying plots in axis tests (bug #48602)
John W. Eaton <jwe@octave.org>
parents:
22163
diff
changeset
|
661 %! unwind_protect_cleanup |
20257791e358
avoid displaying plots in axis tests (bug #48602)
John W. Eaton <jwe@octave.org>
parents:
22163
diff
changeset
|
662 %! close (hf); |
20257791e358
avoid displaying plots in axis tests (bug #48602)
John W. Eaton <jwe@octave.org>
parents:
22163
diff
changeset
|
663 %! end_unwind_protect |