File: Axis-Configuration.html

package info (click to toggle)
octave 4.0.3-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 94,200 kB
  • ctags: 52,925
  • sloc: cpp: 316,850; ansic: 43,469; fortran: 23,670; sh: 13,805; yacc: 8,204; objc: 7,939; lex: 3,631; java: 2,127; makefile: 1,746; perl: 1,022; awk: 988
file content (260 lines) | stat: -rw-r--r-- 12,115 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Octave: Axis Configuration</title>

<meta name="description" content="GNU Octave: Axis Configuration">
<meta name="keywords" content="GNU Octave: Axis Configuration">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Two_002dDimensional-Plots.html#Two_002dDimensional-Plots" rel="up" title="Two-Dimensional Plots">
<link href="Two_002ddimensional-Function-Plotting.html#Two_002ddimensional-Function-Plotting" rel="next" title="Two-dimensional Function Plotting">
<link href="Two_002dDimensional-Plots.html#Two_002dDimensional-Plots" rel="prev" title="Two-Dimensional Plots">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<a name="Axis-Configuration"></a>
<div class="header">
<p>
Next: <a href="Two_002ddimensional-Function-Plotting.html#Two_002ddimensional-Function-Plotting" accesskey="n" rel="next">Two-dimensional Function Plotting</a>, Up: <a href="Two_002dDimensional-Plots.html#Two_002dDimensional-Plots" accesskey="u" rel="up">Two-Dimensional Plots</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Axis-Configuration-1"></a>
<h4 class="subsubsection">15.2.1.1 Axis Configuration</h4>

<p>The axis function may be used to change the axis limits of an existing
plot and various other axis properties, such as the aspect ratio and the
appearance of tic marks.
</p>
<a name="XREFaxis"></a><dl>
<dt><a name="index-axis"></a>Function File: <em></em> <strong>axis</strong> <em>()</em></dt>
<dt><a name="index-axis-1"></a>Function File: <em></em> <strong>axis</strong> <em>([<var>x</var>_lo <var>x</var>_hi])</em></dt>
<dt><a name="index-axis-2"></a>Function File: <em></em> <strong>axis</strong> <em>([<var>x</var>_lo <var>x</var>_hi <var>y</var>_lo <var>y</var>_hi])</em></dt>
<dt><a name="index-axis-3"></a>Function File: <em></em> <strong>axis</strong> <em>([<var>x</var>_lo <var>x</var>_hi <var>y</var>_lo <var>y</var>_hi <var>z</var>_lo <var>z</var>_hi])</em></dt>
<dt><a name="index-axis-4"></a>Function File: <em></em> <strong>axis</strong> <em>(<var>option</var>)</em></dt>
<dt><a name="index-axis-5"></a>Function File: <em></em> <strong>axis</strong> <em>(&hellip;, <var>option</var>)</em></dt>
<dt><a name="index-axis-6"></a>Function File: <em></em> <strong>axis</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt><a name="index-axis-7"></a>Function File: <em><var>limits</var> =</em> <strong>axis</strong> <em>()</em></dt>
<dd><p>Set axis limits and appearance.
</p>
<p>The argument <var>limits</var> should be a 2-, 4-, or 6-element vector.  The
first and second elements specify the lower and upper limits for the
x-axis.  The third and fourth specify the limits for the y-axis, and the
fifth and sixth specify the limits for the z-axis.  The special values
-Inf and Inf may be used to indicate that the limit should automatically be
computed based on the data in the axis.
</p>
<p>Without any arguments, <code>axis</code> turns autoscaling on.
</p>
<p>With one output argument, <code><var>limits</var> = axis</code> returns the current
axis limits.
</p>
<p>The vector argument specifying limits is optional, and additional string
arguments may be used to specify various axis properties.  For example,
</p>
<div class="example">
<pre class="example">axis ([1, 2, 3, 4], &quot;square&quot;);
</pre></div>

<p>forces a square aspect ratio, and
</p>
<div class="example">
<pre class="example">axis (&quot;tic&quot;, &quot;labely&quot;);
</pre></div>

<p>turns tic marks on for all axes and tic mark labels on for the y-axis only.
</p>
<p>The following options control the aspect ratio of the axes.
</p>
<dl compact="compact">
<dt><code>&quot;square&quot;</code></dt>
<dd><p>Force a square aspect ratio.
</p>
</dd>
<dt><code>&quot;equal&quot;</code></dt>
<dd><p>Force x distance to equal y-distance.
</p>
</dd>
<dt><code>&quot;normal&quot;</code></dt>
<dd><p>Restore default aspect ratio.
</p></dd>
</dl>

<p>The following options control the way axis limits are interpreted.
</p>
<dl compact="compact">
<dt><code>&quot;auto&quot;</code></dt>
<dd><p>Set the specified axes to have nice limits around the data or all if no
axes are specified.
</p>
</dd>
<dt><code>&quot;manual&quot;</code></dt>
<dd><p>Fix the current axes limits.
</p>
</dd>
<dt><code>&quot;tight&quot;</code></dt>
<dd><p>Fix axes to the limits of the data.
</p>
</dd>
<dt><code>&quot;image&quot;</code></dt>
<dd><p>Equivalent to <code>&quot;tight&quot;</code> and <code>&quot;equal&quot;</code>.
</p></dd>
</dl>

<p>The following options affect the appearance of tic marks.
</p>
<dl compact="compact">
<dt><code>&quot;on&quot;</code></dt>
<dd><p>Turn tic marks and labels on for all axes.
</p>
</dd>
<dt><code>&quot;off&quot;</code></dt>
<dd><p>Turn tic marks off for all axes.
</p>
</dd>
<dt><code>&quot;tic[xyz]&quot;</code></dt>
<dd><p>Turn tic marks on for all axes, or turn them on for the specified axes and
off for the remainder.
</p>
</dd>
<dt><code>&quot;label[xyz]&quot;</code></dt>
<dd><p>Turn tic labels on for all axes, or turn them on for the specified axes
and off for the remainder.
</p>
</dd>
<dt><code>&quot;nolabel&quot;</code></dt>
<dd><p>Turn tic labels off for all axes.
</p></dd>
</dl>

<p>Note, if there are no tic marks for an axis, there can be no labels.
</p>
<p>The following options affect the direction of increasing values on the axes.
</p>
<dl compact="compact">
<dt><code>&quot;ij&quot;</code></dt>
<dd><p>Reverse y-axis, so lower values are nearer the top.
</p>
</dd>
<dt><code>&quot;xy&quot;</code></dt>
<dd><p>Restore y-axis, so higher values are nearer the top.
</p></dd>
</dl>

<p>If the first argument <var>hax</var> is an axes handle, then operate on this
axes rather than the current axes returned by <code>gca</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFxlim">xlim</a>, <a href="#XREFylim">ylim</a>, <a href="#XREFzlim">zlim</a>, <a href="Aspect-Ratio.html#XREFdaspect">daspect</a>, <a href="Aspect-Ratio.html#XREFpbaspect">pbaspect</a>, <a href="Plot-Annotations.html#XREFbox">box</a>, <a href="Plot-Annotations.html#XREFgrid">grid</a>.
</p></dd></dl>


<p>Similarly the axis limits of the colormap can be changed with the caxis
function.
</p>
<a name="XREFcaxis"></a><dl>
<dt><a name="index-caxis"></a>Function File: <em></em> <strong>caxis</strong> <em>([cmin cmax])</em></dt>
<dt><a name="index-caxis-1"></a>Function File: <em></em> <strong>caxis</strong> <em>(&quot;auto&quot;)</em></dt>
<dt><a name="index-caxis-2"></a>Function File: <em></em> <strong>caxis</strong> <em>(&quot;manual&quot;)</em></dt>
<dt><a name="index-caxis-3"></a>Function File: <em></em> <strong>caxis</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt><a name="index-caxis-4"></a>Function File: <em><var>limits</var> =</em> <strong>caxis</strong> <em>()</em></dt>
<dd><p>Query or set color axis limits for plots.
</p>
<p>The limits argument should be a 2-element vector specifying the lower and
upper limits to assign to the first and last value in the colormap.  Data
values outside this range are clamped to the first and last colormap
entries.
</p>
<p>If the <code>&quot;auto&quot;</code> option is given then automatic colormap limits are
applied.  The automatic algorithm sets <var>cmin</var> to the minimum data value
and <var>cmax</var> to the maximum data value.  If <code>&quot;manual&quot;</code> is specified
then the <code>&quot;climmode&quot;</code> property is set to <code>&quot;manual&quot;</code> and the
numeric values in the <code>&quot;clim&quot;</code> property are used for limits.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then operate on
this axis rather than the current axes returned by <code>gca</code>.
</p>
<p>Called without arguments the current color axis limits are returned.
</p>
<p><strong>See also:</strong> <a href="Representing-Images.html#XREFcolormap">colormap</a>.
</p></dd></dl>


<p>The <code>xlim</code>, <code>ylim</code>, and <code>zlim</code> functions may be used to
get or set individual axis limits.  Each has the same form.
</p>
<a name="XREFylim"></a><a name="XREFzlim"></a><a name="index-ylim"></a>
<a name="index-zlim"></a>
<a name="XREFxlim"></a><dl>
<dt><a name="index-xlim"></a>Function File: <em><var>xlimits</var> =</em> <strong>xlim</strong> <em>()</em></dt>
<dt><a name="index-xlim-1"></a>Function File: <em><var>xmode</var> =</em> <strong>xlim</strong> <em>(&quot;mode&quot;)</em></dt>
<dt><a name="index-xlim-2"></a>Function File: <em></em> <strong>xlim</strong> <em>([<var>x_lo</var> <var>x_hi</var>])</em></dt>
<dt><a name="index-xlim-3"></a>Function File: <em></em> <strong>xlim</strong> <em>(&quot;auto&quot;)</em></dt>
<dt><a name="index-xlim-4"></a>Function File: <em></em> <strong>xlim</strong> <em>(&quot;manual&quot;)</em></dt>
<dt><a name="index-xlim-5"></a>Function File: <em></em> <strong>xlim</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dd><p>Query or set the limits of the x-axis for the current plot.
</p>
<p>Called without arguments <code>xlim</code> returns the x-axis limits of the
current plot.
</p>
<p>With the input query <code>&quot;mode&quot;</code>, return the current x-limit
calculation mode which is either <code>&quot;auto&quot;</code> or <code>&quot;manual&quot;</code>.
</p>
<p>If passed a 2-element vector [<var>x_lo</var> <var>x_hi</var>], the limits of the
x-axis are set to these values and the mode is set to <code>&quot;manual&quot;</code>.
</p>
<p>The current plotting mode can be changed by using either <code>&quot;auto&quot;</code>
or <code>&quot;manual&quot;</code> as the argument.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then operate on
this axis rather than the current axes returned by <code>gca</code>.
</p>
<p><strong>See also:</strong> <a href="#XREFylim">ylim</a>, <a href="#XREFzlim">zlim</a>, <a href="#XREFaxis">axis</a>, <a href="Graphics-Objects.html#XREFset">set</a>, <a href="Graphics-Objects.html#XREFget">get</a>, <a href="Graphics-Objects.html#XREFgca">gca</a>.
</p></dd></dl>


<hr>
<div class="header">
<p>
Next: <a href="Two_002ddimensional-Function-Plotting.html#Two_002ddimensional-Function-Plotting" accesskey="n" rel="next">Two-dimensional Function Plotting</a>, Up: <a href="Two_002dDimensional-Plots.html#Two_002dDimensional-Plots" accesskey="u" rel="up">Two-Dimensional Plots</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>