Mercurial > hg > octave-nkf
annotate scripts/plot/axis.m @ 9357:95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Wed, 17 Jun 2009 18:49:46 -0400 |
parents | 96abf8f7e5b6 |
children | 7b74a7fd4761 |
rev | line source |
---|---|
7017 | 1 ## Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003, 2004, |
8920 | 2 ## 2005, 2006, 2007, 2008, 2009 John W. Eaton |
2313 | 3 ## |
4 ## This file is part of Octave. | |
5 ## | |
6 ## Octave is free software; you can redistribute it and/or modify it | |
7 ## under the terms of the GNU General Public License as published by | |
7016 | 8 ## the Free Software Foundation; either version 3 of the License, or (at |
9 ## your option) any later version. | |
2313 | 10 ## |
11 ## Octave is distributed in the hope that it will be useful, but | |
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 ## General Public License for more details. | |
15 ## | |
16 ## You should have received a copy of the GNU General Public License | |
7016 | 17 ## along with Octave; see the file COPYING. If not, see |
18 ## <http://www.gnu.org/licenses/>. | |
590 | 19 |
3368 | 20 ## -*- texinfo -*- |
21 ## @deftypefn {Function File} {} axis (@var{limits}) | |
3667 | 22 ## Set axis limits for plots. |
3426 | 23 ## |
3368 | 24 ## The argument @var{limits} should be a 2, 4, or 6 element vector. The |
25 ## first and second elements specify the lower and upper limits for the x | |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
8953
diff
changeset
|
26 ## axis. The third and fourth specify the limits for the y-axis, and the |
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
8953
diff
changeset
|
27 ## fifth and sixth specify the limits for the z-axis. |
3426 | 28 ## |
4945 | 29 ## Without any arguments, @code{axis} turns autoscaling on. |
30 ## | |
8507 | 31 ## With one output argument, @code{x = axis} returns the current axes |
3667 | 32 ## |
3668 | 33 ## The vector argument specifying limits is optional, and additional |
34 ## string arguments may be used to specify various axis properties. For | |
3667 | 35 ## example, |
36 ## | |
37 ## @example | |
38 ## axis ([1, 2, 3, 4], "square"); | |
39 ## @end example | |
40 ## | |
41 ## @noindent | |
3668 | 42 ## forces a square aspect ratio, and |
43 ## | |
44 ## @example | |
45 ## axis ("labely", "tic"); | |
46 ## @end example | |
47 ## | |
48 ## @noindent | |
49 ## turns tic marks on for all axes and tic mark labels on for the y-axis | |
50 ## only. | |
3667 | 51 ## |
52 ## @noindent | |
53 ## The following options control the aspect ratio of the axes. | |
54 ## | |
55 ## @table @code | |
56 ## @item "square" | |
57 ## Force a square aspect ratio. | |
58 ## @item "equal" | |
59 ## Force x distance to equal y-distance. | |
60 ## @item "normal" | |
61 ## Restore the balance. | |
62 ## @end table | |
63 ## | |
64 ## @noindent | |
65 ## The following options control the way axis limits are interpreted. | |
66 ## | |
67 ## @table @code | |
68 ## @item "auto" | |
69 ## Set the specified axes to have nice limits around the data | |
70 ## or all if no axes are specified. | |
71 ## @item "manual" | |
72 ## Fix the current axes limits. | |
73 ## @item "tight" | |
9277
be84e9654feb
Update axis.m documentation to reflect addition of "tight" option.
Rik <rdrider0-list@yahoo.com>
parents:
9209
diff
changeset
|
74 ## Fix axes to the limits of the data. |
3667 | 75 ## @end table |
76 ## | |
77 ## @noindent | |
78 ## The option @code{"image"} is equivalent to @code{"tight"} and | |
79 ## @code{"equal"}. | |
80 ## | |
81 ## @noindent | |
82 ## The following options affect the appearance of tic marks. | |
83 ## | |
84 ## @table @code | |
85 ## @item "on" | |
86 ## Turn tic marks and labels on for all axes. | |
87 ## @item "off" | |
88 ## Turn tic marks off for all axes. | |
89 ## @item "tic[xyz]" | |
3668 | 90 ## Turn tic marks on for all axes, or turn them on for the |
91 ## specified axes and off for the remainder. | |
3667 | 92 ## @item "label[xyz]" |
3668 | 93 ## Turn tic labels on for all axes, or turn them on for the |
94 ## specified axes and off for the remainder. | |
3667 | 95 ## @item "nolabel" |
96 ## Turn tic labels off for all axes. | |
97 ## @end table | |
98 ## Note, if there are no tic marks for an axis, there can be no labels. | |
99 ## | |
100 ## @noindent | |
101 ## The following options affect the direction of increasing values on | |
102 ## the axes. | |
103 ## | |
104 ## @table @code | |
105 ## @item "ij" | |
106 ## Reverse y-axis, so lower values are nearer the top. | |
107 ## @item "xy" | |
108 ## Restore y-axis, so higher values are nearer the top. | |
109 ## @end table | |
4945 | 110 ## |
7189 | 111 ## If an axes handle is passed as the first argument, then operate on |
112 ## this axes rather than the current axes. | |
3368 | 113 ## @end deftypefn |
590 | 114 |
2314 | 115 ## Author: jwe |
116 | |
7189 | 117 function varargout = axis (varargin) |
590 | 118 |
7215 | 119 [h, varargin, nargin] = __plt_get_axis_arg__ ("axis", varargin{:}); |
7216 | 120 |
7215 | 121 oldh = gca (); |
122 unwind_protect | |
123 axes (h); | |
7189 | 124 varargout = cell (max (nargin == 0, nargout), 1); |
125 if (isempty (varargout)) | |
7215 | 126 __axis__ (h, varargin{:}); |
7189 | 127 else |
7215 | 128 [varargout{:}] = __axis__ (h, varargin{:}); |
7189 | 129 endif |
7215 | 130 unwind_protect_cleanup |
131 axes (oldh); | |
132 end_unwind_protect | |
590 | 133 |
7189 | 134 endfunction |
135 | |
136 function curr_axis = __axis__ (ca, ax, varargin) | |
137 | |
138 if (nargin == 1) | |
4945 | 139 if (nargout == 0) |
6257 | 140 set (ca, "xlimmode", "auto", "ylimmode", "auto", "zlimmode", "auto"); |
4945 | 141 else |
6257 | 142 xlim = get (ca, "xlim"); |
143 ylim = get (ca, "ylim"); | |
144 zlim = get (ca, "zlim"); | |
145 curr_axis = [xlim, ylim, zlim]; | |
4945 | 146 endif |
3667 | 147 |
5443 | 148 elseif (ischar (ax)) |
4340 | 149 len = length (ax); |
3667 | 150 |
151 ## '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
|
152 if (strcmpi (ax, "ij")) |
6257 | 153 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
|
154 elseif (strcmpi (ax, "xy")) |
6257 | 155 set (ca, "ydir", "normal"); |
3667 | 156 |
157 ## aspect ratio | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
158 elseif (strcmpi (ax, "image")) |
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
|
159 __axis__ (ca, "equal") |
7376 | 160 __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
|
161 elseif (strcmpi (ax, "square")) |
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
|
162 if (__gnuplot_has_feature__ ("screen_coordinates_for_{lrtb}margin")) |
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
|
163 set (ca, "dataaspectratio", [1, 1, 1]); |
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
|
164 else |
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
|
165 x = xlim; |
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
|
166 y = ylim; |
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
|
167 set (ca, "dataaspectratio", [(y(2)-y(1)), (x(2)-x(1)), 1]); |
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
|
168 endif |
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
|
169 elseif (strcmp (ax, "equal")) |
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
|
170 if (__gnuplot_has_feature__ ("screen_coordinates_for_{lrtb}margin")) |
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
|
171 x = xlim; |
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
|
172 y = ylim; |
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
|
173 set (ca, "dataaspectratio", [(x(2)-x(1)), (y(2)-y(1)), 1]); |
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
|
174 else |
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
|
175 set (ca, "dataaspectratio", [1, 1, 1]); |
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
|
176 endif |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
177 elseif (strcmpi (ax, "normal")) |
6257 | 178 set (ca, "dataaspectratiomode", "auto"); |
3667 | 179 |
180 ## axis limits | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
181 elseif (len >= 4 && strcmpi (ax(1:4), "auto")) |
4340 | 182 if (len > 4) |
6257 | 183 if (any (ax == "x")) |
184 set (ca, "xlimmode", "auto"); | |
185 endif | |
186 if (any (ax == "y")) | |
187 set (ca, "ylimmode", "auto"); | |
188 endif | |
189 if (any (ax == "z")) | |
190 set (ca, "zlimmode", "auto"); | |
191 endif | |
3667 | 192 else |
6257 | 193 set (ca, "xlimmode", "auto", "ylimmode", "auto", "zlimmode", "auto"); |
3667 | 194 endif |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
195 elseif (strcmpi (ax, "manual")) |
3667 | 196 ## fixes the axis limits, like axis(axis) should; |
6257 | 197 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
|
198 elseif (strcmpi (ax, "tight")) |
7376 | 199 ## sets the axis limits to the min and max of all data. |
200 __do_tight_option__ (ca); | |
3667 | 201 ## tic marks |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
202 elseif (strcmpi (ax, "on") || strcmpi (ax, "tic")) |
6257 | 203 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
|
204 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
|
205 set (ca, "xticklabelmode", "auto", "yticklabelmode", "auto", |
6257 | 206 "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
|
207 endif |
6765 | 208 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
|
209 elseif (strcmpi (ax, "off")) |
6257 | 210 set (ca, "xtick", [], "ytick", [], "ztick", []); |
6765 | 211 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
|
212 elseif (len > 3 && strcmpi (ax(1:3), "tic")) |
4340 | 213 if (any (ax == "x")) |
6257 | 214 set (ca, "xtickmode", "auto"); |
3667 | 215 else |
6257 | 216 set (ca, "xtick", []); |
3667 | 217 endif |
4340 | 218 if (any (ax == "y")) |
6257 | 219 set (ca, "ytickmode", "auto"); |
3667 | 220 else |
6257 | 221 set (ca, "ytick", []); |
3667 | 222 endif |
4340 | 223 if (any (ax == "z")) |
6257 | 224 set (ca, "ztickmode", "auto"); |
3667 | 225 else |
6257 | 226 set (ca, "ztick", []); |
3667 | 227 endif |
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, "label")) |
6257 | 229 set (ca, "xticklabelmode", "auto", "yticklabelmode", "auto", |
230 "zticklabelmode", "auto"); | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
7994
diff
changeset
|
231 elseif (strcmpi (ax, "nolabel")) |
6257 | 232 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
|
233 elseif (len > 5 && strcmpi (ax(1:5), "label")) |
4340 | 234 if (any (ax == "x")) |
6257 | 235 set (ca, "xticklabelmode", "auto"); |
3667 | 236 else |
6257 | 237 set (ca, "xticklabel", ""); |
3667 | 238 endif |
4340 | 239 if (any (ax == "y")) |
6257 | 240 set (ca, "yticklabelmode", "auto"); |
3667 | 241 else |
6257 | 242 set (ca, "yticklabel", ""); |
3667 | 243 endif |
4340 | 244 if (any (ax == "z")) |
6257 | 245 set (ca, "zticklabelmode", "auto"); |
3667 | 246 else |
6257 | 247 set (ca, "zticklabel", ""); |
3667 | 248 endif |
249 | |
250 else | |
4259 | 251 warning ("unknown axis option '%s'", ax); |
3667 | 252 endif |
253 | |
4030 | 254 elseif (isvector (ax)) |
590 | 255 |
256 len = length (ax); | |
257 | |
258 if (len != 2 && len != 4 && len != 6) | |
259 error ("axis: expecting vector with 2, 4, or 6 elements"); | |
260 endif | |
261 | |
5627 | 262 for i = 1:2:len |
263 if (ax(i) == ax(i+1)) | |
264 error ("axis: limits(%d) cannot equal limits(%d)", i, i+1); | |
265 endif | |
266 endfor | |
267 | |
590 | 268 if (len > 1) |
6257 | 269 set (ca, "xlim", [ax(1), ax(2)]); |
590 | 270 endif |
271 | |
272 if (len > 3) | |
6257 | 273 set (ca, "ylim", [ax(3), ax(4)]); |
590 | 274 endif |
275 | |
276 if (len > 5) | |
6257 | 277 set (ca, "zlim", [ax(5), ax(6)]); |
590 | 278 endif |
279 | |
280 else | |
595 | 281 error ("axis: expecting no args, or a vector with 2, 4, or 6 elements"); |
590 | 282 endif |
283 | |
7376 | 284 if (! isempty (varargin)) |
7189 | 285 __axis__ (ca, varargin{:}); |
3667 | 286 endif |
6447 | 287 |
590 | 288 endfunction |
3667 | 289 |
7376 | 290 function lims = __get_tight_lims__ (ca, ax) |
291 | |
292 ## Get the limits for axis ("tight"). | |
293 ## AX should be one of "x", "y", or "z". | |
7994
8ccd9b0bf6bc
plot/axis.m (__get_tight_lims__): don't fail if data is not a vector
John W. Eaton <jwe@octave.org>
parents:
7376
diff
changeset
|
294 kids = findobj (ca, "-property", strcat (ax, "data")); |
7376 | 295 if (isempty (kids)) |
296 ## Return the current limits. | |
7994
8ccd9b0bf6bc
plot/axis.m (__get_tight_lims__): don't fail if data is not a vector
John W. Eaton <jwe@octave.org>
parents:
7376
diff
changeset
|
297 lims = get (ca, strcat (ax, "lim")); |
7376 | 298 else |
7994
8ccd9b0bf6bc
plot/axis.m (__get_tight_lims__): don't fail if data is not a vector
John W. Eaton <jwe@octave.org>
parents:
7376
diff
changeset
|
299 data = get (kids, strcat (ax, "data")); |
7376 | 300 if (iscell (data)) |
9317
96abf8f7e5b6
axis.m: Fix bug for 'axis tight' with multiple lines, modify demo.
Ben Abbott <bpabbott@mac.com>
parents:
9277
diff
changeset
|
301 data = data (find (! cellfun (@isempty, data))); |
96abf8f7e5b6
axis.m: Fix bug for 'axis tight' with multiple lines, modify demo.
Ben Abbott <bpabbott@mac.com>
parents:
9277
diff
changeset
|
302 if (! isempty (data)) |
9357
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
303 lims_min = min (cellfun (@min, cellfun (@min, data, 'UniformOutput', false)(:))); |
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
304 lims_max = max (cellfun (@max, cellfun (@max, data, 'UniformOutput', false)(:))); |
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
305 lims = [lims_min, lims_max]; |
9317
96abf8f7e5b6
axis.m: Fix bug for 'axis tight' with multiple lines, modify demo.
Ben Abbott <bpabbott@mac.com>
parents:
9277
diff
changeset
|
306 else |
96abf8f7e5b6
axis.m: Fix bug for 'axis tight' with multiple lines, modify demo.
Ben Abbott <bpabbott@mac.com>
parents:
9277
diff
changeset
|
307 lims = [0, 1]; |
96abf8f7e5b6
axis.m: Fix bug for 'axis tight' with multiple lines, modify demo.
Ben Abbott <bpabbott@mac.com>
parents:
9277
diff
changeset
|
308 endif |
7376 | 309 else |
7994
8ccd9b0bf6bc
plot/axis.m (__get_tight_lims__): don't fail if data is not a vector
John W. Eaton <jwe@octave.org>
parents:
7376
diff
changeset
|
310 lims = [min(data(:)), max(data(:))]; |
8610
85c9906abfd1
use endif and endfor instead of end
John W. Eaton <jwe@octave.org>
parents:
8507
diff
changeset
|
311 endif |
85c9906abfd1
use endif and endfor instead of end
John W. Eaton <jwe@octave.org>
parents:
8507
diff
changeset
|
312 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
|
313 |
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
314 |
7376 | 315 endfunction |
316 | |
317 function __do_tight_option__ (ca) | |
318 | |
319 set (ca, | |
320 "xlim", __get_tight_lims__ (ca, "x"), | |
321 "ylim", __get_tight_lims__ (ca, "y"), | |
322 "zlim", __get_tight_lims__ (ca, "z")); | |
323 | |
324 endfunction | |
325 | |
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
|
326 %!demo |
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
|
327 %! t=0:0.01:2*pi; x=sin(t); |
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
|
328 %! |
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
|
329 %! subplot(221); |
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
|
330 %! plot(t, x); |
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
|
331 %! title("normal plot"); |
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
|
332 %! |
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
|
333 %! subplot(222); |
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
|
334 %! plot(t, x); |
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
|
335 %! title("square plot"); |
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
|
336 %! axis("square"); |
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
|
337 %! |
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
|
338 %! subplot(223); |
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
|
339 %! plot(t, x); |
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
|
340 %! title("equal plot"); |
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
|
341 %! axis("equal"); |
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
|
342 %! |
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
|
343 %! subplot(224); |
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
|
344 %! plot(t, x); |
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
|
345 %! title("normal plot again"); |
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
|
346 %! axis("normal"); |
7376 | 347 |
3667 | 348 %!demo |
349 %! t=0:0.01:2*pi; x=sin(t); | |
350 %! | |
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
|
351 %! subplot(121); |
6746 | 352 %! plot(t, x); |
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
|
353 %! title("ij plot"); |
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
|
354 %! axis("ij"); |
3667 | 355 %! |
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
|
356 %! subplot(122); |
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
|
357 %! plot(t, x); |
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
|
358 %! title("xy plot"); |
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
|
359 %! axis("xy"); |
3667 | 360 |
361 %!demo | |
362 %! t=0:0.01:2*pi; x=sin(t); | |
363 %! | |
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
|
364 %! subplot(331); |
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
|
365 %! plot(t, x); |
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
|
366 %! title("x tics and labels"); |
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
|
367 %! axis("ticx"); |
3667 | 368 %! |
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
|
369 %! subplot(332); |
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
|
370 %! plot(t, x); |
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
|
371 %! title("y tics and labels"); |
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
|
372 %! axis("ticy"); |
3667 | 373 %! |
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
|
374 %! subplot(333); |
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
|
375 %! plot(t, x); |
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
|
376 %! title("axis off"); |
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
|
377 %! axis("off"); |
3667 | 378 %! |
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
|
379 %! subplot(334); |
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
|
380 %! plot(t, x); |
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
|
381 %! title("x and y tics, x labels"); |
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
|
382 %! axis("labelx","tic"); |
3667 | 383 %! |
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
|
384 %! subplot(335); |
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
|
385 %! plot(t, x); |
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
|
386 %! title("x and y tics, y labels"); |
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
|
387 %! axis("labely","tic"); |
3667 | 388 %! |
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
|
389 %! subplot(336); |
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
|
390 %! plot(t, x); |
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
|
391 %! title("all tics but no labels"); |
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
|
392 %! axis("nolabel","tic"); |
3667 | 393 %! |
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
|
394 %! subplot(337); |
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
|
395 %! plot(t, x); |
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
|
396 %! title("x tics, no labels"); |
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
|
397 %! axis("nolabel","ticx"); |
3667 | 398 %! |
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
|
399 %! subplot(338); |
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
|
400 %! plot(t, x); |
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
|
401 %! title("y tics, no labels"); |
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
|
402 %! axis("nolabel","ticy"); |
3667 | 403 %! |
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
|
404 %! subplot(339); |
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
|
405 %! plot(t, x); |
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
|
406 %! title("all tics and labels"); |
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
|
407 %! axis("on"); |
3667 | 408 |
409 %!demo | |
410 %! t=0:0.01:2*pi; x=sin(t); | |
411 %! | |
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
|
412 %! subplot(321); |
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
|
413 %! plot(t, x); |
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
|
414 %! title("axes at [0 3 0 1]") |
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
|
415 %! axis([0,3,0,1]); |
3667 | 416 %! |
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
|
417 %! subplot(322); |
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
|
418 %! plot(t, x); |
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
|
419 %! title("auto"); |
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
|
420 %! axis("auto"); |
3667 | 421 %! |
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
|
422 %! subplot(323); |
3667 | 423 %! plot(t, x, ";sine [0:2pi];"); hold on; |
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
|
424 %! plot(-3:3,-3:3, ";line (-3,-3)->(3,3);"); hold off; |
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
|
425 %! title("manual"); |
3667 | 426 %! axis("manual"); |
427 %! | |
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
|
428 %! subplot(324); |
3667 | 429 %! plot(t, x, ";sine [0:2pi];"); |
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
|
430 %! title("axes at [0 3 0 1], then autox"); |
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
|
431 %! axis([0,3,0,1]); axis("autox"); |
3667 | 432 %! |
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
|
433 %! subplot(325); |
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
|
434 %! plot(t, x, ";sine [0:2p];"); |
3667 | 435 %! axis([3,6,0,1]); axis("autoy"); |
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
|
436 %! title("axes at [3 6 0 1], then autoy"); |
3667 | 437 %! |
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
|
438 %! subplot(326); |
9317
96abf8f7e5b6
axis.m: Fix bug for 'axis tight' with multiple lines, modify demo.
Ben Abbott <bpabbott@mac.com>
parents:
9277
diff
changeset
|
439 %! plot(t, sin(t), t, -2*sin(t/2)) |
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
|
440 %! axis("tight"); |
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
|
441 %! title("tight"); |
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
|
442 |
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
|
443 %!demo |
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
|
444 %! clf |
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
|
445 %! axis image |
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
|
446 %! x=0:0.1:10; |
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
|
447 %! plot(x,sin(x)) |
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
|
448 %! axis image |
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
|
449 %! title("image") |
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
|
450 |
9357
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
451 %!demo |
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
452 %! clf |
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
453 %! [x,y,z] = peaks(50); |
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
454 %! x1 = max(x(:)); |
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
455 %! pcolor(x-x1,y-x1/2,z) |
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
456 %! hold on |
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
457 %! [x,y,z] = sombrero; |
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
458 %! s = x1/max(x(:)); |
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
459 %! pcolor(s*x+x1,s*y+x1/2,5*z) |
95ec56601497
axis.m: Fix bug for 'axis tight' with multiple surface plots, add demo.
Ben Abbott <bpabbott@mac.com>
parents:
9317
diff
changeset
|
460 %! 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
|
461 |