File: Plot-Annotations.html

package info (click to toggle)
octave 10.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 145,388 kB
  • sloc: cpp: 335,976; ansic: 82,241; fortran: 20,963; objc: 9,402; sh: 8,756; yacc: 4,392; lex: 4,333; perl: 1,544; java: 1,366; awk: 1,259; makefile: 659; xml: 192
file content (745 lines) | stat: -rw-r--r-- 51,693 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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Plot Annotations (GNU Octave (version 10.3.0))</title>

<meta name="description" content="Plot Annotations (GNU Octave (version 10.3.0))">
<meta name="keywords" content="Plot Annotations (GNU Octave (version 10.3.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="High_002dLevel-Plotting.html" rel="up" title="High-Level Plotting">
<link href="Multiple-Plots-on-One-Page.html" rel="next" title="Multiple Plots on One Page">
<link href="Three_002dDimensional-Plots.html" rel="prev" title="Three-Dimensional Plots">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span:hover a.copiable-link {visibility: visible}
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
ul.mark-bullet {list-style-type: disc}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">


</head>

<body lang="en">
<div class="subsection-level-extent" id="Plot-Annotations">
<div class="nav-panel">
<p>
Next: <a href="Multiple-Plots-on-One-Page.html" accesskey="n" rel="next">Multiple Plots on One Page</a>, Previous: <a href="Three_002dDimensional-Plots.html" accesskey="p" rel="prev">Three-Dimensional Plots</a>, Up: <a href="High_002dLevel-Plotting.html" accesskey="u" rel="up">High-Level Plotting</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Plot-Annotations-1"><span>15.2.3 Plot Annotations<a class="copiable-link" href="#Plot-Annotations-1"> &para;</a></span></h4>

<p>You can add titles, axis labels, legends, and arbitrary text to an
existing plot.  For example:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">x = -10:0.1:10;
plot (x, sin (x));
title (&quot;sin(x) for x = -10:0.1:10&quot;);
xlabel (&quot;x&quot;);
ylabel (&quot;sin (x)&quot;);
text (pi, 0.7, &quot;arbitrary text&quot;);
legend (&quot;sin (x)&quot;);
</pre></div></div>

<p>The functions <code class="code">grid</code> and <code class="code">box</code> may also be used to add grid
and border lines to the plot.  By default, the grid is off and the
border lines are on.
</p>
<p>Finally, arrows, text and rectangular or elliptic boxes can be added to
highlight parts of a plot using the <code class="code">annotation</code> function.  Those objects
are drawn in an invisible axes, on top of every other axes.
</p>
<a class="anchor" id="XREFtitle"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-title"><span><strong class="def-name">title</strong> <code class="def-code-arguments">(<var class="var">string</var>)</code><a class="copiable-link" href="#index-title"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-title-1"><span><strong class="def-name">title</strong> <code class="def-code-arguments">(<var class="var">string</var>, <var class="var">prop</var>, <var class="var">val</var>, &hellip;)</code><a class="copiable-link" href="#index-title-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-title-2"><span><strong class="def-name">title</strong> <code class="def-code-arguments">(<var class="var">hax</var>, &hellip;)</code><a class="copiable-link" href="#index-title-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-title-3"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">title</strong> <code class="def-code-arguments">(&hellip;)</code><a class="copiable-link" href="#index-title-3"> &para;</a></span></dt>
<dd><p>Specify the string used as a title for the current axis.
</p>
<p>An optional list of <var class="var">property</var>/<var class="var">value</var> pairs can be used to change
the appearance of the created title text object.
</p>
<p>If the first argument <var class="var">hax</var> is an axes or legend handle, then add a
title to this object, rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the created text
object.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFxlabel">xlabel</a>, <a class="ref" href="#XREFylabel">ylabel</a>, <a class="ref" href="#XREFzlabel">zlabel</a>, <a class="ref" href="#XREFtext">text</a>.
</p></dd></dl>


<a class="anchor" id="XREFlegend"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-legend"><span><strong class="def-name">legend</strong> <code class="def-code-arguments">()</code><a class="copiable-link" href="#index-legend"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-legend-1"><span><strong class="def-name">legend</strong> <code class="def-code-arguments"><var class="var">command</var></code><a class="copiable-link" href="#index-legend-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-legend-2"><span><strong class="def-name">legend</strong> <code class="def-code-arguments">(<var class="var">str1</var>, <var class="var">str2</var>, &hellip;)</code><a class="copiable-link" href="#index-legend-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-legend-3"><span><strong class="def-name">legend</strong> <code class="def-code-arguments">(<var class="var">charmat</var>)</code><a class="copiable-link" href="#index-legend-3"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-legend-4"><span><strong class="def-name">legend</strong> <code class="def-code-arguments">({<var class="var">cellstr</var>})</code><a class="copiable-link" href="#index-legend-4"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-legend-5"><span><strong class="def-name">legend</strong> <code class="def-code-arguments">(&hellip;, <var class="var">property</var>, <var class="var">value</var>, &hellip;)</code><a class="copiable-link" href="#index-legend-5"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-legend-6"><span><strong class="def-name">legend</strong> <code class="def-code-arguments">(<var class="var">hobjs</var>, &hellip;)</code><a class="copiable-link" href="#index-legend-6"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-legend-7"><span><strong class="def-name">legend</strong> <code class="def-code-arguments">(&quot;<var class="var">command</var>&quot;)</code><a class="copiable-link" href="#index-legend-7"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-legend-8"><span><strong class="def-name">legend</strong> <code class="def-code-arguments">(<var class="var">hax</var>, &hellip;)</code><a class="copiable-link" href="#index-legend-8"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-legend-9"><span><strong class="def-name">legend</strong> <code class="def-code-arguments">(<var class="var">hleg</var>, &hellip;)</code><a class="copiable-link" href="#index-legend-9"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-legend-10"><span><code class="def-type"><var class="var">hleg</var> =</code> <strong class="def-name">legend</strong> <code class="def-code-arguments">(&hellip;)</code><a class="copiable-link" href="#index-legend-10"> &para;</a></span></dt>
<dd>
<p>Display a legend for the current axes using the specified strings as labels.
</p>
<p>Legend entries may be specified as individual character string arguments,
a character array, or a cell array of character strings.  When label names
might be confused with legend properties, or <var class="var">command</var> arguments,
the labels should be protected by specifying them as a cell array of
strings.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then add a legend to this
axes, rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>If the first argument <var class="var">hleg</var> is a legend handle, then operate on this
legend rather than the legend of the current axes.
</p>
<p>Legend labels are associated with the axes&rsquo; children; The first label is
assigned to the first object that was plotted in the axes, the second label
to the next object plotted, etc.  To label specific data objects, without
labeling all objects, provide their graphic handles in the input
<var class="var">hobjs</var>.
</p>
<p>The following customizations are available using <var class="var">command</var>:
</p>
<dl class="table">
<dt><code class="code">&quot;show&quot;</code></dt>
<dd><p>Show legend on the plot
</p>
</dd>
<dt><code class="code">&quot;hide&quot;</code></dt>
<dd><p>Hide legend on the plot
</p>
</dd>
<dt><code class="code">&quot;toggle&quot;</code></dt>
<dd><p>Toggle between <code class="code">&quot;hide&quot;</code> and <code class="code">&quot;show&quot;</code>
</p>
</dd>
<dt><code class="code">&quot;boxon&quot;</code></dt>
<dd><p>Show a box around legend (default)
</p>
</dd>
<dt><code class="code">&quot;boxoff&quot;</code></dt>
<dd><p>Hide the box around legend
</p>
</dd>
<dt><code class="code">&quot;right&quot;</code></dt>
<dd><p>Place label text to the right of the keys (default)
</p>
</dd>
<dt><code class="code">&quot;left&quot;</code></dt>
<dd><p>Place label text to the left of the keys
</p>
</dd>
<dt><code class="code">&quot;off&quot;</code></dt>
<dd><p>Delete the legend object
</p></dd>
</dl>

<p>The <code class="code">legend</code> function creates a graphics object which has various
properties that can be manipulated with <code class="code">get</code>/<code class="code">set</code>.
Alternatively, properties can be set directly when calling <code class="code">legend</code> by
including <var class="var">property</var>/<var class="var">value</var> pairs.  If using this calling form, the
labels must be specified as a cell array of strings.  Graphics object
properties are documented in detail at <a class="ref" href="Graphics-Object-Properties.html">Graphics Object Properties</a>.
</p>
<p>Following is a subset of supported legend properties:
</p>
<dl class="table">
<dt><code class="code">autoupdate</code>: <code class="code">&quot;off&quot;</code> | {<code class="code">&quot;on&quot;</code>}</dt>
<dd><p>Control whether the number of legend items is updated automatically when
objects are added to (or deleted from) the peer axes.  For example:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">## Create a single plot with its legend.
figure ();
plot (1:10);
legend (&quot;Slope 1&quot;);
## Add another plot and specify its displayname so that
## the legend is correctly updated.
hold on;
plot ((1:10) * 2, &quot;displayname&quot;, &quot;Slope 2&quot;);
## Stop automatic updates for further plots.
legend (&quot;autoupdate&quot;, &quot;off&quot;);
plot ((1:10) * 3);
</pre></div></div>

</dd>
<dt><code class="code">box</code>: <code class="code">&quot;off&quot;</code> | {<code class="code">&quot;on&quot;</code>}</dt>
<dd><p>Control whether the legend has a surrounding box.
</p>
</dd>
<dt><code class="code">location</code>: <code class="code">&quot;best&quot;</code> | <code class="code">&quot;bestoutside&quot;</code> |</dt>
<dd><p><code class="code">&quot;east&quot;</code> | <code class="code">&quot;eastoutside&quot;</code> | <code class="code">&quot;none&quot;</code> | <code class="code">&quot;north&quot;</code> |
{<code class="code">&quot;northeast&quot;</code>} | <code class="code">&quot;northeastoutside&quot;</code> |
<code class="code">&quot;northoutside&quot;</code> | <code class="code">&quot;northwest&quot;</code>| <code class="code">&quot;northwestoutside&quot;</code> |
<code class="code">&quot;south&quot;</code> | <code class="code">&quot;southeast&quot;</code> | <code class="code">&quot;southeastoutside&quot;</code> |
<code class="code">&quot;southoutside&quot;</code> | <code class="code">&quot;southwest&quot;</code> | <code class="code">&quot;southwestoutside&quot;</code> |
<code class="code">&quot;west&quot;</code> | <code class="code">&quot;westoutside&quot;</code>
Control the location of the legend.
</p>
</dd>
<dt><code class="code">numcolumns</code>: scalar interger, def. <code class="code">1</code></dt>
<dd><p>Control the number of columns used in the layout of the legend items.
For example:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">figure ();
plot (rand (30));
legend (&quot;numcolumns&quot;, 3);
</pre></div></div>

<p>Setting <code class="code">numcolumns</code> also forces the <code class="code">numcolumnsmode</code> property
to be set to <code class="code">&quot;manual&quot;</code>.
</p>
</dd>
<dt><code class="code">orientation</code>: <code class="code">&quot;horizontal&quot;</code> | {<code class="code">&quot;vertical&quot;</code>}</dt>
<dd><p>Control whether the legend items are arranged vertically (column-wise) or
horizontally (row-wise).
</p>
</dd>
<dt><code class="code">string</code>: string | cell array of strings</dt>
<dd><p>List of labels for the legend items.  For example:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">figure ();
plot (rand (20));
## Let legend choose names automatically
hl = legend ();
## Selectively change some names
str = get (hl, &quot;string&quot;);
str(1:5:end) = &quot;Garbage&quot;;
set (hl, &quot;string&quot;, str);
</pre></div></div>

</dd>
<dt><code class="code">textcolor</code>: colorspec, def. <code class="code">[0   0   0]</code></dt>
<dd><p>Control the color of the text strings for legend item.
</p>
</dd>
</dl>

<p>The full list of supported legend specific properties can be found at
<a class="ref" href="Legend-Properties.html">Legend Properties</a>.
</p>
<p>A legend is implemented as an additional axes object with the <code class="code">tag</code>
property set to <code class="code">&quot;legend&quot;</code>.  Properties of the legend object may be
manipulated directly by using <code class="code">set</code>.
</p>
<p>The optional output value <var class="var">hleg</var> is a handle to the legend object.
</p>
<p>Implementation Note: The legend label text is either provided in the call to
<code class="code">legend</code> or is taken from the <code class="code">DisplayName</code> property of the
graphics objects.  Only data objects, such as line, patch, and surface, have
this property whereas axes, figures, etc. do not so they are never present
in a legend.  If no labels or <code class="code">DisplayName</code> properties are available,
then the label text is simply <code class="code">&quot;data1&quot;</code>, <code class="code">&quot;data2&quot;</code>, &hellip;,
<code class="code">&quot;dataN&quot;</code>.
</p>
<p>The legend <code class="code">FontSize</code> property is initially set to 90% of the axes
<code class="code">FontSize</code> to which it is attached.  Use <code class="code">set</code> to override this
if necessary.
</p></dd></dl>


<a class="anchor" id="XREFtext"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-text"><span><strong class="def-name">text</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">string</var>)</code><a class="copiable-link" href="#index-text"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-text-1"><span><strong class="def-name">text</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">string</var>)</code><a class="copiable-link" href="#index-text-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-text-2"><span><strong class="def-name">text</strong> <code class="def-code-arguments">(&hellip;, <var class="var">prop</var>, <var class="var">val</var>, &hellip;)</code><a class="copiable-link" href="#index-text-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-text-3"><span><strong class="def-name">text</strong> <code class="def-code-arguments">(<var class="var">hax</var>, &hellip;)</code><a class="copiable-link" href="#index-text-3"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-text-4"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">text</strong> <code class="def-code-arguments">(&hellip;)</code><a class="copiable-link" href="#index-text-4"> &para;</a></span></dt>
<dd><p>Create a text object with text <var class="var">string</var> at position <var class="var">x</var>, <var class="var">y</var>,
(<var class="var">z</var>) on the current axes.
</p>
<p>Multiple locations can be specified if <var class="var">x</var>, <var class="var">y</var>, (<var class="var">z</var>) are
vectors.  Multiple strings can be specified with a character matrix or
a cell array of strings.
</p>
<p>Optional property/value pairs may be used to control the appearance of the
text.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then add text to this
axes, rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a vector of graphics handles to the
created text objects.
</p>
<p>Example 1 : multi-line text via 3 different methods
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">text (0.5, 0.8, {&quot;Line 1&quot;, &quot;Line 2&quot;})
text (0.5, 0.6, [&quot;Line 1&quot;; &quot;Line 2&quot;])
text (0.5, 0.4, &quot;Line 1\nLine 2&quot;)
</pre></div></div>

<p>Example 2 : text at multiple locations
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">text ([0.2, 0.2], [0.8, 0.6], &quot;Same text at two locations&quot;)
text ([0.4, 0.4], [0.8, 0.6], {&quot;Point 1 Text&quot;, &quot;Point 2 text&quot;})
text ([0.6, 0.6], [0.8, 0.6], {{&quot;Point 1 Line 1&quot;, &quot;Point 1 Line 2},
                               &quot;Point 2 text&quot;})
</pre></div></div>

<p>Example 2 : adjust appearance using text properties
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">ht = text (0.5, 0.5, &quot;Hello World&quot;, &quot;fontsize&quot;, 20);
set (ht, &quot;color&quot;, &quot;red&quot;);
</pre></div></div>

<p>Programming Notes: The full list of properties is documented at
<a class="ref" href="Text-Properties.html">Text Properties</a>.
</p>
<p>Any numeric entries in a cell array will be converted to text using
<code class="code">sprintf (&quot;%g&quot;)</code>.  For more precise control of the appearance convert
any numeric entries to strings using <code class="code">num2str</code>, <code class="code">sprintf</code>, etc.,
before calling <code class="code">text</code>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="Interacting-with-Plots.html#XREFgtext">gtext</a>, <a class="ref" href="#XREFtitle">title</a>, <a class="ref" href="#XREFxlabel">xlabel</a>, <a class="ref" href="#XREFylabel">ylabel</a>, <a class="ref" href="#XREFzlabel">zlabel</a>.
</p></dd></dl>


<a class="anchor" id="XREFxlabel"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-xlabel"><span><strong class="def-name">xlabel</strong> <code class="def-code-arguments">(<var class="var">string</var>)</code><a class="copiable-link" href="#index-xlabel"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-xlabel-1"><span><strong class="def-name">xlabel</strong> <code class="def-code-arguments">(<var class="var">string</var>, <var class="var">property</var>, <var class="var">val</var>, &hellip;)</code><a class="copiable-link" href="#index-xlabel-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-xlabel-2"><span><strong class="def-name">xlabel</strong> <code class="def-code-arguments">(<var class="var">hax</var>, &hellip;)</code><a class="copiable-link" href="#index-xlabel-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-xlabel-3"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">xlabel</strong> <code class="def-code-arguments">(&hellip;)</code><a class="copiable-link" href="#index-xlabel-3"> &para;</a></span></dt>
<dd><p>Specify the string used to label the x-axis of the current axis.
</p>
<p>An optional list of <var class="var">property</var>/<var class="var">value</var> pairs can be used to change
the properties of the created text label.
</p>
<p>The full list of text object properties is documented at
<a class="ref" href="Text-Properties.html">Text Properties</a>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then operate on
this axes rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the created text
object.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFylabel">ylabel</a>, <a class="ref" href="#XREFzlabel">zlabel</a>, <a class="ref" href="Timing-Utilities.html#XREFdatetick">datetick</a>, <a class="ref" href="#XREFtitle">title</a>, <a class="ref" href="#XREFtext">text</a>.
</p></dd></dl>


<a class="anchor" id="XREFylabel"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-ylabel"><span><strong class="def-name">ylabel</strong> <code class="def-code-arguments">(<var class="var">string</var>)</code><a class="copiable-link" href="#index-ylabel"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-ylabel-1"><span><strong class="def-name">ylabel</strong> <code class="def-code-arguments">(<var class="var">string</var>, <var class="var">property</var>, <var class="var">val</var>, &hellip;)</code><a class="copiable-link" href="#index-ylabel-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-ylabel-2"><span><strong class="def-name">ylabel</strong> <code class="def-code-arguments">(<var class="var">hax</var>, &hellip;)</code><a class="copiable-link" href="#index-ylabel-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-ylabel-3"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">ylabel</strong> <code class="def-code-arguments">(&hellip;)</code><a class="copiable-link" href="#index-ylabel-3"> &para;</a></span></dt>
<dd><p>Specify the string used to label the y-axis of the current axis.
</p>
<p>If <var class="var">hax</var> is specified then label the axis defined by <var class="var">hax</var>.
</p>
<p>An optional list of <var class="var">property</var>/<var class="var">value</var> pairs can be used to change
the properties of the created text label.
</p>
<p>The full list of text object properties is documented at
<a class="ref" href="Text-Properties.html">Text Properties</a>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then operate on
this axes rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the created text
object.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFxlabel">xlabel</a>, <a class="ref" href="#XREFzlabel">zlabel</a>, <a class="ref" href="Timing-Utilities.html#XREFdatetick">datetick</a>, <a class="ref" href="#XREFtitle">title</a>, <a class="ref" href="#XREFtext">text</a>.
</p></dd></dl>


<a class="anchor" id="XREFzlabel"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-zlabel"><span><strong class="def-name">zlabel</strong> <code class="def-code-arguments">(<var class="var">string</var>)</code><a class="copiable-link" href="#index-zlabel"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-zlabel-1"><span><strong class="def-name">zlabel</strong> <code class="def-code-arguments">(<var class="var">string</var>, <var class="var">property</var>, <var class="var">val</var>, &hellip;)</code><a class="copiable-link" href="#index-zlabel-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-zlabel-2"><span><strong class="def-name">zlabel</strong> <code class="def-code-arguments">(<var class="var">hax</var>, &hellip;)</code><a class="copiable-link" href="#index-zlabel-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-zlabel-3"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">zlabel</strong> <code class="def-code-arguments">(&hellip;)</code><a class="copiable-link" href="#index-zlabel-3"> &para;</a></span></dt>
<dd><p>Specify the string used to label the z-axis of the current axis.
</p>
<p>An optional list of <var class="var">property</var>/<var class="var">value</var> pairs can be used to change
the properties of the created text label.
</p>
<p>The full list of text object properties is documented at
<a class="ref" href="Text-Properties.html">Text Properties</a>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then operate on
this axes rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the created text
object.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFxlabel">xlabel</a>, <a class="ref" href="#XREFylabel">ylabel</a>, <a class="ref" href="Timing-Utilities.html#XREFdatetick">datetick</a>, <a class="ref" href="#XREFtitle">title</a>, <a class="ref" href="#XREFtext">text</a>.
</p></dd></dl>


<a class="anchor" id="XREFclabel"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-clabel"><span><strong class="def-name">clabel</strong> <code class="def-code-arguments">(<var class="var">c</var>, <var class="var">h</var>)</code><a class="copiable-link" href="#index-clabel"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-clabel-1"><span><strong class="def-name">clabel</strong> <code class="def-code-arguments">(<var class="var">c</var>, <var class="var">h</var>, <var class="var">v</var>)</code><a class="copiable-link" href="#index-clabel-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-clabel-2"><span><strong class="def-name">clabel</strong> <code class="def-code-arguments">(<var class="var">c</var>, <var class="var">h</var>, &quot;manual&quot;)</code><a class="copiable-link" href="#index-clabel-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-clabel-3"><span><strong class="def-name">clabel</strong> <code class="def-code-arguments">(<var class="var">c</var>)</code><a class="copiable-link" href="#index-clabel-3"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-clabel-4"><span><strong class="def-name">clabel</strong> <code class="def-code-arguments">(&hellip;, <var class="var">prop</var>, <var class="var">val</var>, &hellip;)</code><a class="copiable-link" href="#index-clabel-4"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-clabel-5"><span><code class="def-type"><var class="var">hlabels</var> =</code> <strong class="def-name">clabel</strong> <code class="def-code-arguments">(&hellip;)</code><a class="copiable-link" href="#index-clabel-5"> &para;</a></span></dt>
<dd><p>Add labels to the contours of a contour plot.
</p>
<p>The contour levels are specified by the contour matrix <var class="var">c</var> which is
returned by <code class="code">contour</code>, <code class="code">contourc</code>, <code class="code">contourf</code>, and
<code class="code">contour3</code>.  Contour labels are rotated to match the local line
orientation and centered on the line.  The position of labels along the
contour line is chosen randomly.
</p>
<p>If the argument <var class="var">h</var> is a handle to a contour group object, then label
this plot rather than the one in the current axes returned by <code class="code">gca</code>.
</p>
<p>By default, all contours are labeled.  However, the contours to label can be
specified by the vector <var class="var">v</var>.  If the <code class="code">&quot;manual&quot;</code> argument is
given then the contours to label can be selected with the mouse.
</p>
<p>Additional property/value pairs that are valid properties of text objects
can be given and are passed to the underlying text objects.  Moreover,
the contour group property <code class="code">&quot;LabelSpacing&quot;</code> is available which
determines the spacing between labels on a contour to be specified.  The
default is 144 points, or 2 inches.
</p>
<p>The optional return value <var class="var">hlabels</var> is a vector of graphics handles to
the text objects representing each label.
The <code class="code">&quot;userdata&quot;</code> property of the text objects contains the numerical
value of the contour label.
</p>
<p>The full list of text object properties is documented at
<a class="ref" href="Text-Properties.html">Text Properties</a>.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">[c, h] = contour (peaks (), -4 : 6);
clabel (c, h, -4:2:6, &quot;fontsize&quot;, 12);
</pre></div></div>


<p><strong class="strong">See also:</strong> <a class="ref" href="Two_002dDimensional-Plots.html#XREFcontour">contour</a>, <a class="ref" href="Two_002dDimensional-Plots.html#XREFcontourf">contourf</a>, <a class="ref" href="Two_002dDimensional-Plots.html#XREFcontour3">contour3</a>, <a class="ref" href="Three_002dDimensional-Plots.html#XREFmeshc">meshc</a>, <a class="ref" href="Three_002dDimensional-Plots.html#XREFsurfc">surfc</a>, <a class="ref" href="#XREFtext">text</a>.
</p></dd></dl>


<a class="anchor" id="XREFbox"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-box"><span><strong class="def-name">box</strong><a class="copiable-link" href="#index-box"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-box-1"><span><strong class="def-name">box</strong> <code class="def-code-arguments">on</code><a class="copiable-link" href="#index-box-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-box-2"><span><strong class="def-name">box</strong> <code class="def-code-arguments">off</code><a class="copiable-link" href="#index-box-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-box-3"><span><strong class="def-name">box</strong> <code class="def-code-arguments">(<var class="var">hax</var>, &hellip;)</code><a class="copiable-link" href="#index-box-3"> &para;</a></span></dt>
<dd><p>Control display of the axes border.
</p>
<p>The argument may be either <code class="code">&quot;on&quot;</code> or <code class="code">&quot;off&quot;</code>.  If it is
omitted, the current box state is toggled.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then operate on this
axes rather than the current axes returned by <code class="code">gca</code>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="Axis-Configuration.html#XREFaxis">axis</a>, <a class="ref" href="#XREFgrid">grid</a>.
</p></dd></dl>


<a class="anchor" id="XREFgrid"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-grid"><span><strong class="def-name">grid</strong><a class="copiable-link" href="#index-grid"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-grid-1"><span><strong class="def-name">grid</strong> <code class="def-code-arguments">on</code><a class="copiable-link" href="#index-grid-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-grid-2"><span><strong class="def-name">grid</strong> <code class="def-code-arguments">off</code><a class="copiable-link" href="#index-grid-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-grid-3"><span><strong class="def-name">grid</strong> <code class="def-code-arguments">minor</code><a class="copiable-link" href="#index-grid-3"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-grid-4"><span><strong class="def-name">grid</strong> <code class="def-code-arguments">minor on</code><a class="copiable-link" href="#index-grid-4"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-grid-5"><span><strong class="def-name">grid</strong> <code class="def-code-arguments">minor off</code><a class="copiable-link" href="#index-grid-5"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-grid-6"><span><strong class="def-name">grid</strong> <code class="def-code-arguments">(<var class="var">hax</var>, &hellip;)</code><a class="copiable-link" href="#index-grid-6"> &para;</a></span></dt>
<dd><p>Control the display of plot grid lines.
</p>
<p>The function state input may be either <code class="code">&quot;on&quot;</code> or <code class="code">&quot;off&quot;</code>.
If it is omitted, the current grid state is toggled.
</p>
<p>When the first argument is <code class="code">&quot;minor&quot;</code> all subsequent commands
modify the minor grid rather than the major grid.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then operate on
this axes rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>To control the grid lines for an individual axes use the <code class="code">set</code>
function.  For example:
</p>
<div class="example">
<pre class="example-preformatted">set (gca, &quot;ygrid&quot;, &quot;on&quot;);
</pre></div>

<p><strong class="strong">See also:</strong> <a class="ref" href="Axis-Configuration.html#XREFaxis">axis</a>, <a class="ref" href="#XREFbox">box</a>.
</p></dd></dl>


<a class="anchor" id="XREFcolorbar"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-colorbar"><span><strong class="def-name">colorbar</strong><a class="copiable-link" href="#index-colorbar"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-colorbar-1"><span><strong class="def-name">colorbar</strong> <code class="def-code-arguments">(&hellip;, <var class="var">loc</var>)</code><a class="copiable-link" href="#index-colorbar-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-colorbar-2"><span><strong class="def-name">colorbar</strong> <code class="def-code-arguments">(<var class="var">delete_option</var>)</code><a class="copiable-link" href="#index-colorbar-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-colorbar-3"><span><strong class="def-name">colorbar</strong> <code class="def-code-arguments">(<var class="var">hcb</var>, &hellip;)</code><a class="copiable-link" href="#index-colorbar-3"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-colorbar-4"><span><strong class="def-name">colorbar</strong> <code class="def-code-arguments">(<var class="var">hax</var>, &hellip;)</code><a class="copiable-link" href="#index-colorbar-4"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-colorbar-5"><span><strong class="def-name">colorbar</strong> <code class="def-code-arguments">(&hellip;, &quot;peer&quot;, <var class="var">hax</var>, &hellip;)</code><a class="copiable-link" href="#index-colorbar-5"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-colorbar-6"><span><strong class="def-name">colorbar</strong> <code class="def-code-arguments">(&hellip;, &quot;location&quot;, <var class="var">loc</var>, &hellip;)</code><a class="copiable-link" href="#index-colorbar-6"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-colorbar-7"><span><strong class="def-name">colorbar</strong> <code class="def-code-arguments">(&hellip;, <var class="var">prop</var>, <var class="var">val</var>, &hellip;)</code><a class="copiable-link" href="#index-colorbar-7"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-colorbar-8"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">colorbar</strong> <code class="def-code-arguments">(&hellip;)</code><a class="copiable-link" href="#index-colorbar-8"> &para;</a></span></dt>
<dd><p>Add a colorbar to the current axes.
</p>
<p>A colorbar displays the current colormap along with numerical rulings
so that the color scale can be interpreted.
</p>
<p>The optional input <var class="var">loc</var> determines the location of the
colorbar.  If present, it must be the last argument to <code class="code">colorbar</code>.
Valid values for <var class="var">loc</var> are
</p>
<dl class="table">
<dt><code class="code">&quot;EastOutside&quot;</code></dt>
<dd><p>Place the colorbar outside the plot to the right.  This is the default.
</p>
</dd>
<dt><code class="code">&quot;East&quot;</code></dt>
<dd><p>Place the colorbar inside the plot to the right.
</p>
</dd>
<dt><code class="code">&quot;WestOutside&quot;</code></dt>
<dd><p>Place the colorbar outside the plot to the left.
</p>
</dd>
<dt><code class="code">&quot;West&quot;</code></dt>
<dd><p>Place the colorbar inside the plot to the left.
</p>
</dd>
<dt><code class="code">&quot;NorthOutside&quot;</code></dt>
<dd><p>Place the colorbar above the plot.
</p>
</dd>
<dt><code class="code">&quot;North&quot;</code></dt>
<dd><p>Place the colorbar at the top of the plot.
</p>
</dd>
<dt><code class="code">&quot;SouthOutside&quot;</code></dt>
<dd><p>Place the colorbar under the plot.
</p>
</dd>
<dt><code class="code">&quot;South&quot;</code></dt>
<dd><p>Place the colorbar at the bottom of the plot.
</p></dd>
</dl>

<p>To remove a colorbar from a plot use any one of the following keywords for
the <var class="var">delete_option</var>: <code class="code">&quot;off&quot;</code>, <code class="code">&quot;delete&quot;</code>, <code class="code">&quot;hide&quot;</code>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then the colorbar is
added to this axes, rather than the current axes returned by <code class="code">gca</code>.
Alternatively, If the argument <code class="code">&quot;peer&quot;</code> is given, then the following
argument is treated as the axes handle in which to add the colorbar.  The
<code class="code">&quot;peer&quot;</code> calling syntax may be removed in the future and is not
recommended.
</p>
<p>If the first argument <var class="var">hcb</var> is a handle to a colorbar object, then
operate on this colorbar directly.
</p>
<p>Additional property/value pairs are passed directly to the underlying axes
object.  The full list of properties is documented at
<a class="ref" href="Axes-Properties.html">Axes Properties</a>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the created
colorbar object.
</p>
<p>Implementation Note: A colorbar is created as an additional axes object
with the <code class="code">&quot;tag&quot;</code> property set to <code class="code">&quot;colorbar&quot;</code>.  The created
object has the extra property <code class="code">&quot;location&quot;</code> which controls the
positioning of the colorbar.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="Representing-Images.html#XREFcolormap">colormap</a>.
</p></dd></dl>


<a class="anchor" id="XREFannotation"></a><span style="display:block; margin-top:-4.5ex;">&nbsp;</span>


<dl class="first-deftypefn">
<dt class="deftypefn" id="index-annotation"><span><strong class="def-name">annotation</strong> <code class="def-code-arguments">(<var class="var">type</var>)</code><a class="copiable-link" href="#index-annotation"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-annotation-1"><span><strong class="def-name">annotation</strong> <code class="def-code-arguments">(&quot;line&quot;, <var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-annotation-1"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-annotation-2"><span><strong class="def-name">annotation</strong> <code class="def-code-arguments">(&quot;arrow&quot;, <var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-annotation-2"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-annotation-3"><span><strong class="def-name">annotation</strong> <code class="def-code-arguments">(&quot;doublearrow&quot;, <var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-annotation-3"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-annotation-4"><span><strong class="def-name">annotation</strong> <code class="def-code-arguments">(&quot;textarrow&quot;, <var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-annotation-4"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-annotation-5"><span><strong class="def-name">annotation</strong> <code class="def-code-arguments">(&quot;textbox&quot;, <var class="var">pos</var>)</code><a class="copiable-link" href="#index-annotation-5"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-annotation-6"><span><strong class="def-name">annotation</strong> <code class="def-code-arguments">(&quot;rectangle&quot;, <var class="var">pos</var>)</code><a class="copiable-link" href="#index-annotation-6"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-annotation-7"><span><strong class="def-name">annotation</strong> <code class="def-code-arguments">(&quot;ellipse&quot;, <var class="var">pos</var>)</code><a class="copiable-link" href="#index-annotation-7"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-annotation-8"><span><strong class="def-name">annotation</strong> <code class="def-code-arguments">(&hellip;, <var class="var">prop</var>, <var class="var">val</var>)</code><a class="copiable-link" href="#index-annotation-8"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-annotation-9"><span><strong class="def-name">annotation</strong> <code class="def-code-arguments">(<var class="var">hf</var>, &hellip;)</code><a class="copiable-link" href="#index-annotation-9"> &para;</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-annotation-10"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">annotation</strong> <code class="def-code-arguments">(&hellip;)</code><a class="copiable-link" href="#index-annotation-10"> &para;</a></span></dt>
<dd><p>Draw annotations to emphasize parts of a figure.
</p>
<p>You may build a default annotation by specifying only the <var class="var">type</var>
of the annotation.
</p>
<p>Otherwise you can select the type of annotation and then set its position
using either <var class="var">x</var> and <var class="var">y</var> coordinates for line-based annotations or a
position vector <var class="var">pos</var> for others.  In either case, coordinates are
interpreted using the <code class="code">&quot;units&quot;</code> property of the annotation object.
The default is <code class="code">&quot;normalized&quot;</code>, which means the lower left hand corner
of the figure has coordinates &lsquo;<samp class="samp">[0 0]</samp>&rsquo; and the upper right hand corner
&lsquo;<samp class="samp">[1 1]</samp>&rsquo;.
</p>
<p>If the first argument <var class="var">hf</var> is a figure handle, then plot into this
figure, rather than the current figure returned by <code class="code">gcf</code>.
</p>
<p>Further arguments can be provided in the form of <var class="var">prop</var>/<var class="var">val</var> pairs
to customize the annotation appearance.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the created
annotation object.  This can be used with the <code class="code">set</code> function to
customize an existing annotation object.
</p>
<p>All annotation objects share two properties:
</p>
<ul class="itemize mark-bullet">
<li><code class="code">&quot;units&quot;</code>: the units in which coordinates are interpreted.<br>
Its value may be one of <code class="code">&quot;centimeters&quot;</code> | <code class="code">&quot;characters&quot;</code> |
<code class="code">&quot;inches&quot;</code> | <code class="code">&quot;{normalized}&quot;</code> | <code class="code">&quot;pixels&quot;</code> |
<code class="code">&quot;points&quot;</code>.

</li><li><code class="code">&quot;position&quot;</code>: a four-element vector [x0 y0 width height].<br>
The vector specifies the coordinates (x0,y0) of the origin of the annotation
object, its width, and its height.  The width and height may be negative,
depending on the orientation of the object.

</li></ul>

<p>Valid annotation types and their specific properties are described
below:
</p>
<dl class="table">
<dt><code class="code">&quot;line&quot;</code></dt>
<dd><p>Constructs a line.  <var class="var">x</var> and <var class="var">y</var> must be two-element vectors
specifying the x and y coordinates of the two ends of the line.
</p>
<p>The line can be customized using <code class="code">&quot;linewidth&quot;</code>, <code class="code">&quot;linestyle&quot;</code>,
and <code class="code">&quot;color&quot;</code> properties the same way as for <code class="code">line</code> objects.
</p>
</dd>
<dt><code class="code">&quot;arrow&quot;</code></dt>
<dd><p>Construct an arrow.  The second point in vectors <var class="var">x</var> and <var class="var">y</var>
specifies the arrowhead coordinates.
</p>
<p>Besides line properties, the arrowhead can be customized using
<code class="code">&quot;headlength&quot;</code>, <code class="code">&quot;headwidth&quot;</code>, and <code class="code">&quot;headstyle&quot;</code>
properties.  Supported values for <code class="code">&quot;headstyle&quot;</code> property are:
[<code class="code">&quot;diamond&quot;</code> | <code class="code">&quot;ellipse&quot;</code> | <code class="code">&quot;plain&quot;</code> |
<code class="code">&quot;rectangle&quot;</code> | <code class="code">&quot;vback1&quot;</code> | <code class="code">&quot;{vback2}&quot;</code> |
<code class="code">&quot;vback3&quot;</code>]
</p>
</dd>
<dt><code class="code">&quot;doublearrow&quot;</code></dt>
<dd><p>Construct a double arrow.  Vectors <var class="var">x</var> and <var class="var">y</var> specify the
arrowhead coordinates.
</p>
<p>The line and the arrowhead can be customized as for arrow annotations, but
some property names are duplicated:
<code class="code">&quot;head1length&quot;</code>/<code class="code">&quot;head2length&quot;</code>,
<code class="code">&quot;head1width&quot;</code>/<code class="code">&quot;head2width&quot;</code>, etc.  The index 1 marks the
properties of the arrowhead at the first point in <var class="var">x</var> and <var class="var">y</var>
coordinates.
</p>
</dd>
<dt><code class="code">&quot;textarrow&quot;</code></dt>
<dd><p>Construct an arrow with a text label at the opposite end from the arrowhead.
</p>
<p>Use the <code class="code">&quot;string&quot;</code> property to change the text string.
The line and the arrowhead can be customized as for arrow annotations, and
the text can be customized using the same properties as <code class="code">text</code> graphics
objects.  Note, however, that some text property names are prefixed with
&quot;text&quot; to distinguish them from arrow properties:
<code class="code">&quot;textbackgroundcolor&quot;</code>, <code class="code">&quot;textcolor&quot;</code>,
<code class="code">&quot;textedgecolor&quot;</code>, <code class="code">&quot;textlinewidth&quot;</code>,
<code class="code">&quot;textmargin&quot;</code>, <code class="code">&quot;textrotation&quot;</code>.
</p>
</dd>
<dt><code class="code">&quot;textbox&quot;</code></dt>
<dd><p>Construct a box with text inside.  <var class="var">pos</var> specifies the
<code class="code">&quot;position&quot;</code> property of the annotation.
</p>
<p>Use the <code class="code">&quot;string&quot;</code> property to change the text string.
You may use <code class="code">&quot;backgroundcolor&quot;</code>, <code class="code">&quot;edgecolor&quot;</code>,
<code class="code">&quot;linestyle&quot;</code>, and <code class="code">&quot;linewidth&quot;</code> properties to customize
the box background color and edge appearance.  A limited set of <code class="code">text</code>
objects properties are also available; Besides <code class="code">&quot;font&hellip;&quot;</code>
properties, you may also use <code class="code">&quot;horizontalalignment&quot;</code> and
<code class="code">&quot;verticalalignment&quot;</code> to position the text inside the box.
</p>
<p>Finally, the <code class="code">&quot;fitboxtotext&quot;</code> property controls the actual extent of
the box.  If <code class="code">&quot;on&quot;</code> (the default) the box limits are fitted to the
text extent.
</p>
</dd>
<dt><code class="code">&quot;rectangle&quot;</code></dt>
<dd><p>Construct a rectangle.  <var class="var">pos</var> specifies the <code class="code">&quot;position&quot;</code> property
of the annotation.
</p>
<p>You may use <code class="code">&quot;facecolor&quot;</code>, <code class="code">&quot;color&quot;</code>, <code class="code">&quot;linestyle&quot;</code>, and
<code class="code">&quot;linewidth&quot;</code> properties to customize the rectangle background color
and edge appearance.
</p>
</dd>
<dt><code class="code">&quot;ellipse&quot;</code></dt>
<dd><p>Construct an ellipse.  <var class="var">pos</var> specifies the <code class="code">&quot;position&quot;</code> property
of the annotation.
</p>
<p>See <code class="code">&quot;rectangle&quot;</code> annotations for customization.
</p></dd>
</dl>


<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFxlabel">xlabel</a>, <a class="ref" href="#XREFylabel">ylabel</a>, <a class="ref" href="#XREFzlabel">zlabel</a>, <a class="ref" href="#XREFtitle">title</a>, <a class="ref" href="#XREFtext">text</a>, <a class="ref" href="Interacting-with-Plots.html#XREFgtext">gtext</a>, <a class="ref" href="#XREFlegend">legend</a>, <a class="ref" href="#XREFcolorbar">colorbar</a>.
</p></dd></dl>


</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Multiple-Plots-on-One-Page.html">Multiple Plots on One Page</a>, Previous: <a href="Three_002dDimensional-Plots.html">Three-Dimensional Plots</a>, Up: <a href="High_002dLevel-Plotting.html">High-Level Plotting</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>