File: Two_002dDimensional-Plots.html

package info (click to toggle)
octave 6.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 124,192 kB
  • sloc: cpp: 322,665; ansic: 68,088; fortran: 20,980; objc: 8,121; sh: 7,719; yacc: 4,266; lex: 4,123; perl: 1,530; java: 1,366; awk: 1,257; makefile: 424; xml: 147
file content (2216 lines) | stat: -rw-r--r-- 115,045 bytes parent folder | download
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
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Two-Dimensional Plots (GNU Octave (version 6.2.0))</title>

<meta name="description" content="Two-Dimensional Plots (GNU Octave (version 6.2.0))">
<meta name="keywords" content="Two-Dimensional Plots (GNU Octave (version 6.2.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<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="Axis-Configuration.html" rel="next" title="Axis Configuration">
<link href="High_002dLevel-Plotting.html" rel="prev" title="High-Level Plotting">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {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}
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>
<link rel="stylesheet" type="text/css" href="octave.css">


</head>

<body lang="en">
<span id="Two_002dDimensional-Plots"></span><div class="header">
<p>
Next: <a href="Three_002dDimensional-Plots.html" accesskey="n" rel="next">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>
<span id="Two_002dDimensional-Plots-1"></span><h4 class="subsection">15.2.1 Two-Dimensional Plots</h4>

<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="Axis-Configuration.html" accesskey="1">Axis Configuration</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Two_002ddimensional-Function-Plotting.html" accesskey="2">Two-dimensional Function Plotting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Two_002ddimensional-Geometric-Shapes.html" accesskey="3">Two-dimensional Geometric Shapes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<p>The <code>plot</code> function allows you to create simple x-y plots with
linear axes.  For example,
</p>
<div class="example">
<pre class="example">x = -10:0.1:10;
plot (x, sin (x));
xlabel (&quot;x&quot;);
ylabel (&quot;sin (x)&quot;);
title (&quot;Simple 2-D Plot&quot;);
</pre></div>

<p>displays a sine wave shown in <a href="#fig_003aplot">Figure 15.1</a>.  On most systems, this
command will open a separate plot window to display the graph.
</p>
<div class="float"><span id="fig_003aplot"></span>
<div align="center"><img src="plot.png" alt="plot">
</div>
<div class="float-caption"><p><strong>Figure 15.1: </strong>Simple Two-Dimensional Plot.</p></div></div>
<span id="XREFplot"></span><dl>
<dt id="index-plot">: <em></em> <strong>plot</strong> <em>(<var>y</var>)</em></dt>
<dt id="index-plot-1">: <em></em> <strong>plot</strong> <em>(<var>x</var>, <var>y</var>)</em></dt>
<dt id="index-plot-2">: <em></em> <strong>plot</strong> <em>(<var>x</var>, <var>y</var>, <var>fmt</var>)</em></dt>
<dt id="index-plot-3">: <em></em> <strong>plot</strong> <em>(&hellip;, <var>property</var>, <var>value</var>, &hellip;)</em></dt>
<dt id="index-plot-4">: <em></em> <strong>plot</strong> <em>(<var>x1</var>, <var>y1</var>, &hellip;, <var>xn</var>, <var>yn</var>)</em></dt>
<dt id="index-plot-5">: <em></em> <strong>plot</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-plot-6">: <em><var>h</var> =</em> <strong>plot</strong> <em>(&hellip;)</em></dt>
<dd><p>Produce 2-D plots.
</p>
<p>Many different combinations of arguments are possible.  The simplest
form is
</p>
<div class="example">
<pre class="example">plot (<var>y</var>)
</pre></div>

<p>where the argument is taken as the set of <var>y</var> coordinates and the
<var>x</var> coordinates are taken to be the range <code>1:numel (<var>y</var>)</code>.
</p>
<p>If more than one argument is given, they are interpreted as
</p>
<div class="example">
<pre class="example">plot (<var>y</var>, <var>property</var>, <var>value</var>, &hellip;)
</pre></div>

<p>or
</p>
<div class="example">
<pre class="example">plot (<var>x</var>, <var>y</var>, <var>property</var>, <var>value</var>, &hellip;)
</pre></div>

<p>or
</p>
<div class="example">
<pre class="example">plot (<var>x</var>, <var>y</var>, <var>fmt</var>, &hellip;)
</pre></div>

<p>and so on.  Any number of argument sets may appear.  The <var>x</var> and
<var>y</var> values are interpreted as follows:
</p>
<ul>
<li> If a single data argument is supplied, it is taken as the set of <var>y</var>
coordinates and the <var>x</var> coordinates are taken to be the indices of
the elements, starting with 1.

</li><li> If <var>x</var> and <var>y</var> are scalars, a single point is plotted.

</li><li> <code>squeeze()</code> is applied to arguments with more than two dimensions,
but no more than two singleton dimensions.

</li><li> If both arguments are vectors, the elements of <var>y</var> are plotted versus
the elements of <var>x</var>.

</li><li> If <var>x</var> is a vector and <var>y</var> is a matrix, then
the columns (or rows) of <var>y</var> are plotted versus <var>x</var>.
(using whichever combination matches, with columns tried first.)

</li><li> If the <var>x</var> is a matrix and <var>y</var> is a vector,
<var>y</var> is plotted versus the columns (or rows) of <var>x</var>.
(using whichever combination matches, with columns tried first.)

</li><li> If both arguments are matrices, the columns of <var>y</var> are plotted
versus the columns of <var>x</var>.  In this case, both matrices must have
the same number of rows and columns and no attempt is made to transpose
the arguments to make the number of rows match.
</li></ul>

<p>Multiple property-value pairs may be specified, but they must appear
in pairs.  These arguments are applied to the line objects drawn by
<code>plot</code>.  Useful properties to modify are <code>&quot;linestyle&quot;</code>,
<code>&quot;linewidth&quot;</code>, <code>&quot;color&quot;</code>, <code>&quot;marker&quot;</code>,
<code>&quot;markersize&quot;</code>, <code>&quot;markeredgecolor&quot;</code>, <code>&quot;markerfacecolor&quot;</code>.
The full list of properties is documented at
<a href="Line-Properties.html">Line Properties</a>.
</p>
<p>The <var>fmt</var> format argument can also be used to control the plot style.
It is a string composed of four optional parts:
&quot;&lt;linestyle&gt;&lt;marker&gt;&lt;color&gt;&lt;;displayname;&gt;&quot;.
When a marker is specified, but no linestyle, only the markers are
plotted.  Similarly, if a linestyle is specified, but no marker, then
only lines are drawn.  If both are specified then lines and markers will
be plotted.  If no <var>fmt</var> and no <var>property</var>/<var>value</var> pairs are
given, then the default plot style is solid lines with no markers and the
color determined by the <code>&quot;colororder&quot;</code> property of the current axes.
</p>
<p>Format arguments:
</p>
<dl compact="compact">
<dt>linestyle</dt>
<dd>
<table>
<tr><td width="6%">&lsquo;<samp>-</samp>&rsquo;</td><td width="94%">Use solid lines (default).</td></tr>
<tr><td width="6%">&lsquo;<samp>--</samp>&rsquo;</td><td width="94%">Use dashed lines.</td></tr>
<tr><td width="6%">&lsquo;<samp>:</samp>&rsquo;</td><td width="94%">Use dotted lines.</td></tr>
<tr><td width="6%">&lsquo;<samp>-.</samp>&rsquo;</td><td width="94%">Use dash-dotted lines.</td></tr>
</table>

</dd>
<dt>marker</dt>
<dd>
<table>
<tr><td width="6%">&lsquo;<samp>+</samp>&rsquo;</td><td width="94%">crosshair</td></tr>
<tr><td width="6%">&lsquo;<samp>o</samp>&rsquo;</td><td width="94%">circle</td></tr>
<tr><td width="6%">&lsquo;<samp>*</samp>&rsquo;</td><td width="94%">star</td></tr>
<tr><td width="6%">&lsquo;<samp>.</samp>&rsquo;</td><td width="94%">point</td></tr>
<tr><td width="6%">&lsquo;<samp>x</samp>&rsquo;</td><td width="94%">cross</td></tr>
<tr><td width="6%">&lsquo;<samp>s</samp>&rsquo;</td><td width="94%">square</td></tr>
<tr><td width="6%">&lsquo;<samp>d</samp>&rsquo;</td><td width="94%">diamond</td></tr>
<tr><td width="6%">&lsquo;<samp>^</samp>&rsquo;</td><td width="94%">upward-facing triangle</td></tr>
<tr><td width="6%">&lsquo;<samp>v</samp>&rsquo;</td><td width="94%">downward-facing triangle</td></tr>
<tr><td width="6%">&lsquo;<samp>&gt;</samp>&rsquo;</td><td width="94%">right-facing triangle</td></tr>
<tr><td width="6%">&lsquo;<samp>&lt;</samp>&rsquo;</td><td width="94%">left-facing triangle</td></tr>
<tr><td width="6%">&lsquo;<samp>p</samp>&rsquo;</td><td width="94%">pentagram</td></tr>
<tr><td width="6%">&lsquo;<samp>h</samp>&rsquo;</td><td width="94%">hexagram</td></tr>
</table>

</dd>
<dt>color</dt>
<dd>
<table>
<tr><td width="6%">&lsquo;<samp>k</samp>&rsquo;</td><td width="94%">blacK</td></tr>
<tr><td width="6%">&lsquo;<samp>r</samp>&rsquo;</td><td width="94%">Red</td></tr>
<tr><td width="6%">&lsquo;<samp>g</samp>&rsquo;</td><td width="94%">Green</td></tr>
<tr><td width="6%">&lsquo;<samp>b</samp>&rsquo;</td><td width="94%">Blue</td></tr>
<tr><td width="6%">&lsquo;<samp>y</samp>&rsquo;</td><td width="94%">Yellow</td></tr>
<tr><td width="6%">&lsquo;<samp>m</samp>&rsquo;</td><td width="94%">Magenta</td></tr>
<tr><td width="6%">&lsquo;<samp>c</samp>&rsquo;</td><td width="94%">Cyan</td></tr>
<tr><td width="6%">&lsquo;<samp>w</samp>&rsquo;</td><td width="94%">White</td></tr>
</table>

</dd>
<dt><code>&quot;;displayname;&quot;</code></dt>
<dd><p>Here <code>&quot;displayname&quot;</code> is the label to use for the plot legend.
</p></dd>
</dl>

<p>The <var>fmt</var> argument may also be used to assign legend labels.
To do so, include the desired label between semicolons after the
formatting sequence described above, e.g., <code>&quot;+b;Key Title;&quot;</code>.
Note that the last semicolon is required and Octave will generate
an error if it is left out.
</p>
<p>Here are some plot examples:
</p>
<div class="example">
<pre class="example">plot (x, y, &quot;or&quot;, x, y2, x, y3, &quot;m&quot;, x, y4, &quot;+&quot;)
</pre></div>

<p>This command will plot <code>y</code> with red circles, <code>y2</code> with solid
lines, <code>y3</code> with solid magenta lines, and <code>y4</code> with points
displayed as &lsquo;<samp>+</samp>&rsquo;.
</p>
<div class="example">
<pre class="example">plot (b, &quot;*&quot;, &quot;markersize&quot;, 10)
</pre></div>

<p>This command will plot the data in the variable <code>b</code>,
with points displayed as &lsquo;<samp>*</samp>&rsquo; and a marker size of 10.
</p>
<div class="example">
<pre class="example">t = 0:0.1:6.3;
plot (t, cos(t), &quot;-;cos(t);&quot;, t, sin(t), &quot;-b;sin(t);&quot;);
</pre></div>

<p>This will plot the cosine and sine functions and label them accordingly
in the legend.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a vector of graphics handles to
the created line objects.
</p>
<p>To save a plot, in one of several image formats such as PostScript
or PNG, use the <code>print</code> command.
</p>

<p><strong>See also:</strong> <a href="Axis-Configuration.html#XREFaxis">axis</a>, <a href="Plot-Annotations.html#XREFbox">box</a>, <a href="Plot-Annotations.html#XREFgrid">grid</a>, <a href="Manipulation-of-Plot-Windows.html#XREFhold">hold</a>, <a href="Plot-Annotations.html#XREFlegend">legend</a>, <a href="Plot-Annotations.html#XREFtitle">title</a>, <a href="Plot-Annotations.html#XREFxlabel">xlabel</a>, <a href="Plot-Annotations.html#XREFylabel">ylabel</a>, <a href="Axis-Configuration.html#XREFxlim">xlim</a>, <a href="Axis-Configuration.html#XREFylim">ylim</a>, <a href="Two_002ddimensional-Function-Plotting.html#XREFezplot">ezplot</a>, <a href="#XREFerrorbar">errorbar</a>, <a href="Two_002ddimensional-Function-Plotting.html#XREFfplot">fplot</a>, <a href="Graphics-Objects.html#XREFline">line</a>, <a href="Three_002dDimensional-Plots.html#XREFplot3">plot3</a>, <a href="#XREFpolar">polar</a>, <a href="#XREFloglog">loglog</a>, <a href="#XREFsemilogx">semilogx</a>, <a href="#XREFsemilogy">semilogy</a>, <a href="Multiple-Plots-on-One-Page.html#XREFsubplot">subplot</a>.
</p></dd></dl>


<p>The <code>plotyy</code> function may be used to create a plot with two
independent y axes.
</p>
<span id="XREFplotyy"></span><dl>
<dt id="index-plotyy">: <em></em> <strong>plotyy</strong> <em>(<var>x1</var>, <var>y1</var>, <var>x2</var>, <var>y2</var>)</em></dt>
<dt id="index-plotyy-1">: <em></em> <strong>plotyy</strong> <em>(&hellip;, <var>fun</var>)</em></dt>
<dt id="index-plotyy-2">: <em></em> <strong>plotyy</strong> <em>(&hellip;, <var>fun1</var>, <var>fun2</var>)</em></dt>
<dt id="index-plotyy-3">: <em></em> <strong>plotyy</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-plotyy-4">: <em>[<var>ax</var>, <var>h1</var>, <var>h2</var>] =</em> <strong>plotyy</strong> <em>(&hellip;)</em></dt>
<dd><p>Plot two sets of data with independent y-axes and a common x-axis.
</p>
<p>The arguments <var>x1</var> and <var>y1</var> define the arguments for the first plot
and <var>x1</var> and <var>y2</var> for the second.
</p>
<p>By default the arguments are evaluated with
<code>feval (@plot, <var>x</var>, <var>y</var>)</code>.  However the type of plot can be
modified with the <var>fun</var> argument, in which case the plots are
generated by <code>feval (<var>fun</var>, <var>x</var>, <var>y</var>)</code>.  <var>fun</var> can be
a function handle, an inline function, or a string of a function name.
</p>
<p>The function to use for each of the plots can be independently defined
with <var>fun1</var> and <var>fun2</var>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then it defines
the principal axes in which to plot the <var>x1</var> and <var>y1</var> data.
</p>
<p>The return value <var>ax</var> is a vector with the axes handles of the two
y-axes.  <var>h1</var> and <var>h2</var> are handles to the objects generated by the
plot commands.
</p>
<div class="example">
<pre class="example">x = 0:0.1:2*pi;
y1 = sin (x);
y2 = exp (x - 1);
ax = plotyy (x, y1, x - 1, y2, @plot, @semilogy);
xlabel (&quot;X&quot;);
ylabel (ax(1), &quot;Axis 1&quot;);
ylabel (ax(2), &quot;Axis 2&quot;);
</pre></div>

<p>When using <code>plotyy</code> in conjunction with <code>subplot</code> make sure to
call <code>subplot</code> first and pass the resulting axes handle to
<code>plotyy</code>.  Do not call <code>subplot</code> with any of the axes handles
returned by <code>plotyy</code> or the other axes will be removed.
</p>

<p><strong>See also:</strong> <a href="#XREFplot">plot</a>, <a href="Multiple-Plots-on-One-Page.html#XREFsubplot">subplot</a>.
</p></dd></dl>


<p>The functions <code>semilogx</code>, <code>semilogy</code>, and <code>loglog</code> are
similar to the <code>plot</code> function, but produce plots in which one or
both of the axes use log scales.
</p>
<span id="XREFsemilogx"></span><dl>
<dt id="index-semilogx">: <em></em> <strong>semilogx</strong> <em>(<var>y</var>)</em></dt>
<dt id="index-semilogx-1">: <em></em> <strong>semilogx</strong> <em>(<var>x</var>, <var>y</var>)</em></dt>
<dt id="index-semilogx-2">: <em></em> <strong>semilogx</strong> <em>(<var>x</var>, <var>y</var>, <var>property</var>, <var>value</var>, &hellip;)</em></dt>
<dt id="index-semilogx-3">: <em></em> <strong>semilogx</strong> <em>(<var>x</var>, <var>y</var>, <var>fmt</var>)</em></dt>
<dt id="index-semilogx-4">: <em></em> <strong>semilogx</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-semilogx-5">: <em><var>h</var> =</em> <strong>semilogx</strong> <em>(&hellip;)</em></dt>
<dd><p>Produce a 2-D plot using a logarithmic scale for the x-axis.
</p>
<p>See the documentation of <code>plot</code> for a description of the
arguments that <code>semilogx</code> will accept.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the created plot.
</p>
<p><strong>See also:</strong> <a href="#XREFplot">plot</a>, <a href="#XREFsemilogy">semilogy</a>, <a href="#XREFloglog">loglog</a>.
</p></dd></dl>


<span id="XREFsemilogy"></span><dl>
<dt id="index-semilogy">: <em></em> <strong>semilogy</strong> <em>(<var>y</var>)</em></dt>
<dt id="index-semilogy-1">: <em></em> <strong>semilogy</strong> <em>(<var>x</var>, <var>y</var>)</em></dt>
<dt id="index-semilogy-2">: <em></em> <strong>semilogy</strong> <em>(<var>x</var>, <var>y</var>, <var>property</var>, <var>value</var>, &hellip;)</em></dt>
<dt id="index-semilogy-3">: <em></em> <strong>semilogy</strong> <em>(<var>x</var>, <var>y</var>, <var>fmt</var>)</em></dt>
<dt id="index-semilogy-4">: <em></em> <strong>semilogy</strong> <em>(<var>h</var>, &hellip;)</em></dt>
<dt id="index-semilogy-5">: <em><var>h</var> =</em> <strong>semilogy</strong> <em>(&hellip;)</em></dt>
<dd><p>Produce a 2-D plot using a logarithmic scale for the y-axis.
</p>
<p>See the documentation of <code>plot</code> for a description of the
arguments that <code>semilogy</code> will accept.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the created plot.
</p>
<p><strong>See also:</strong> <a href="#XREFplot">plot</a>, <a href="#XREFsemilogx">semilogx</a>, <a href="#XREFloglog">loglog</a>.
</p></dd></dl>


<span id="XREFloglog"></span><dl>
<dt id="index-loglog">: <em></em> <strong>loglog</strong> <em>(<var>y</var>)</em></dt>
<dt id="index-loglog-1">: <em></em> <strong>loglog</strong> <em>(<var>x</var>, <var>y</var>)</em></dt>
<dt id="index-loglog-2">: <em></em> <strong>loglog</strong> <em>(<var>x</var>, <var>y</var>, <var>prop</var>, <var>value</var>, &hellip;)</em></dt>
<dt id="index-loglog-3">: <em></em> <strong>loglog</strong> <em>(<var>x</var>, <var>y</var>, <var>fmt</var>)</em></dt>
<dt id="index-loglog-4">: <em></em> <strong>loglog</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-loglog-5">: <em><var>h</var> =</em> <strong>loglog</strong> <em>(&hellip;)</em></dt>
<dd><p>Produce a 2-D plot using logarithmic scales for both axes.
</p>
<p>See the documentation of <code>plot</code> for a description of the arguments
that <code>loglog</code> will accept.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the created plot.
</p>
<p><strong>See also:</strong> <a href="#XREFplot">plot</a>, <a href="#XREFsemilogx">semilogx</a>, <a href="#XREFsemilogy">semilogy</a>.
</p></dd></dl>


<p>The functions <code>bar</code>, <code>barh</code>, <code>stairs</code>, and <code>stem</code>
are useful for displaying discrete data.  For example,
</p>
<div class="example">
<pre class="example">randn (&quot;state&quot;, 1);
hist (randn (10000, 1), 30);
xlabel (&quot;Value&quot;);
ylabel (&quot;Count&quot;);
title (&quot;Histogram of 10,000 normally distributed random numbers&quot;);
</pre></div>

<p>produces the histogram of 10,000 normally distributed random numbers
shown in <a href="#fig_003ahist">Figure 15.2</a>.  Note that, <code>randn (&quot;state&quot;, 1);</code>, initializes
the random number generator for <code>randn</code> to a known value so that the
returned values are reproducible; This guarantees that the figure produced
is identical to the one in this manual.
</p>
<div class="float"><span id="fig_003ahist"></span>
<div align="center"><img src="hist.png" alt="hist">
</div>
<div class="float-caption"><p><strong>Figure 15.2: </strong>Histogram.</p></div></div>
<span id="XREFbar"></span><dl>
<dt id="index-bar">: <em></em> <strong>bar</strong> <em>(<var>y</var>)</em></dt>
<dt id="index-bar-1">: <em></em> <strong>bar</strong> <em>(<var>x</var>, <var>y</var>)</em></dt>
<dt id="index-bar-2">: <em></em> <strong>bar</strong> <em>(&hellip;, <var>w</var>)</em></dt>
<dt id="index-bar-3">: <em></em> <strong>bar</strong> <em>(&hellip;, <var>style</var>)</em></dt>
<dt id="index-bar-4">: <em></em> <strong>bar</strong> <em>(&hellip;, <var>prop</var>, <var>val</var>, &hellip;)</em></dt>
<dt id="index-bar-5">: <em></em> <strong>bar</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-bar-6">: <em><var>h</var> =</em> <strong>bar</strong> <em>(&hellip;, <var>prop</var>, <var>val</var>, &hellip;)</em></dt>
<dd><p>Produce a bar graph from two vectors of X-Y data.
</p>
<p>If only one argument is given, <var>y</var>, it is taken as a vector of Y values
and the X coordinates are the range <code>1:numel (<var>y</var>)</code>.
</p>
<p>The optional input <var>w</var> controls the width of the bars.  A value of
1.0 will cause each bar to exactly touch any adjacent bars.
The default width is 0.8.
</p>
<p>If <var>y</var> is a matrix, then each column of <var>y</var> is taken to be a
separate bar graph plotted on the same graph.  By default the columns
are plotted side-by-side.  This behavior can be changed by the <var>style</var>
argument which can take the following values:
</p>
<dl compact="compact">
<dt><code>&quot;grouped&quot;</code> (default)</dt>
<dd><p>Side-by-side bars with a gap between bars and centered over the
X-coordinate.
</p>
</dd>
<dt><code>&quot;stacked&quot;</code></dt>
<dd><p>Bars are stacked so that each X value has a single bar composed of
multiple segments.
</p>
</dd>
<dt><code>&quot;hist&quot;</code></dt>
<dd><p>Side-by-side bars with no gap between bars and centered over the
X-coordinate.
</p>
</dd>
<dt><code>&quot;histc&quot;</code></dt>
<dd><p>Side-by-side bars with no gap between bars and left-aligned to the
X-coordinate.
</p></dd>
</dl>

<p>Optional property/value pairs are passed directly to the underlying patch
objects.  The full list of properties is documented at
<a href="Patch-Properties.html">Patch Properties</a>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a vector of handles to the created
&quot;bar series&quot; hggroups with one handle per column of the variable <var>y</var>.
This series makes it possible to change a common element in one bar series
object and have the change reflected in the other &quot;bar series&quot;.
For example,
</p>
<div class="example">
<pre class="example">h = bar (rand (5, 10));
set (h(1), &quot;basevalue&quot;, 0.5);
</pre></div>

<p>changes the position on the base of all of the bar series.
</p>
<p>The following example modifies the face and edge colors using
property/value pairs.
</p>
<div class="example">
<pre class="example">bar (randn (1, 100), &quot;facecolor&quot;, &quot;r&quot;, &quot;edgecolor&quot;, &quot;b&quot;);
</pre></div>

<p>The color of the bars is taken from the figure&rsquo;s colormap, such that
</p>
<div class="example">
<pre class="example">bar (rand (10, 3));
colormap (summer (64));
</pre></div>

<p>will change the colors used for the bars.  The color of bars can also be set
manually using the <code>&quot;facecolor&quot;</code> property as shown below.
</p>
<div class="example">
<pre class="example">h = bar (rand (10, 3));
set (h(1), &quot;facecolor&quot;, &quot;r&quot;)
set (h(2), &quot;facecolor&quot;, &quot;g&quot;)
set (h(3), &quot;facecolor&quot;, &quot;b&quot;)
</pre></div>


<p><strong>See also:</strong> <a href="#XREFbarh">barh</a>, <a href="#XREFhist">hist</a>, <a href="#XREFpie">pie</a>, <a href="#XREFplot">plot</a>, <a href="Graphics-Objects.html#XREFpatch">patch</a>.
</p></dd></dl>


<span id="XREFbarh"></span><dl>
<dt id="index-barh">: <em></em> <strong>barh</strong> <em>(<var>y</var>)</em></dt>
<dt id="index-barh-1">: <em></em> <strong>barh</strong> <em>(<var>x</var>, <var>y</var>)</em></dt>
<dt id="index-barh-2">: <em></em> <strong>barh</strong> <em>(&hellip;, <var>w</var>)</em></dt>
<dt id="index-barh-3">: <em></em> <strong>barh</strong> <em>(&hellip;, <var>style</var>)</em></dt>
<dt id="index-barh-4">: <em></em> <strong>barh</strong> <em>(&hellip;, <var>prop</var>, <var>val</var>, &hellip;)</em></dt>
<dt id="index-barh-5">: <em></em> <strong>barh</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-barh-6">: <em><var>h</var> =</em> <strong>barh</strong> <em>(&hellip;, <var>prop</var>, <var>val</var>, &hellip;)</em></dt>
<dd><p>Produce a horizontal bar graph from two vectors of X-Y data.
</p>
<p>If only one argument is given, it is taken as a vector of Y values
and the X coordinates are the range <code>1:numel (<var>y</var>)</code>.
</p>
<p>The optional input <var>w</var> controls the width of the bars.  A value of
1.0 will cause each bar to exactly touch any adjacent bars.
The default width is 0.8.
</p>
<p>If <var>y</var> is a matrix, then each column of <var>y</var> is taken to be a
separate bar graph plotted on the same graph.  By default the columns
are plotted side-by-side.  This behavior can be changed by the <var>style</var>
argument which can take the following values:
</p>
<dl compact="compact">
<dt><code>&quot;grouped&quot;</code> (default)</dt>
<dd><p>Side-by-side bars with a gap between bars and centered over the
Y-coordinate.
</p>
</dd>
<dt><code>&quot;stacked&quot;</code></dt>
<dd><p>Bars are stacked so that each Y value has a single bar composed of
multiple segments.
</p>
</dd>
<dt><code>&quot;hist&quot;</code></dt>
<dd><p>Side-by-side bars with no gap between bars and centered over the
Y-coordinate.
</p>
</dd>
<dt><code>&quot;histc&quot;</code></dt>
<dd><p>Side-by-side bars with no gap between bars and left-aligned to the
Y-coordinate.
</p></dd>
</dl>

<p>Optional property/value pairs are passed directly to the underlying patch
objects.  The full list of properties is documented at
<a href="Patch-Properties.html">Patch Properties</a>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the created
bar series hggroup.  For a description of the use of the
bar series, see <a href="#XREFbar">bar</a>.
</p>
<p><strong>See also:</strong> <a href="#XREFbar">bar</a>, <a href="#XREFhist">hist</a>, <a href="#XREFpie">pie</a>, <a href="#XREFplot">plot</a>, <a href="Graphics-Objects.html#XREFpatch">patch</a>.
</p></dd></dl>


<span id="XREFhist"></span><dl>
<dt id="index-hist">: <em></em> <strong>hist</strong> <em>(<var>y</var>)</em></dt>
<dt id="index-hist-1">: <em></em> <strong>hist</strong> <em>(<var>y</var>, <var>nbins</var>)</em></dt>
<dt id="index-hist-2">: <em></em> <strong>hist</strong> <em>(<var>y</var>, <var>x</var>)</em></dt>
<dt id="index-hist-3">: <em></em> <strong>hist</strong> <em>(<var>y</var>, <var>x</var>, <var>norm</var>)</em></dt>
<dt id="index-hist-4">: <em></em> <strong>hist</strong> <em>(&hellip;, <var>prop</var>, <var>val</var>, &hellip;)</em></dt>
<dt id="index-hist-5">: <em></em> <strong>hist</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-hist-6">: <em>[<var>nn</var>, <var>xx</var>] =</em> <strong>hist</strong> <em>(&hellip;)</em></dt>
<dd><p>Produce histogram counts or plots.
</p>
<p>With one vector input argument, <var>y</var>, plot a histogram of the values
with 10 bins.  The range of the histogram bins is determined by the
range of the data (difference between maximum and minimum value in <var>y</var>).
Extreme values are lumped into the first and last bins.  If <var>y</var> is a
matrix then plot a histogram where each bin contains one bar per input
column of <var>y</var>.
</p>
<p>If the optional second argument is a scalar, <var>nbins</var>, it defines the
number of bins.
</p>
<p>If the optional second argument is a vector, <var>x</var>, it defines the centers
of the bins.  The width of the bins is determined from the adjacent values
in the vector.  The total number of bins is <code>numel (<var>x</var>)</code>.
</p>
<p>If a third argument is provided, the histogram is normalized such that
the sum of the bars is equal to <var>norm</var>.
</p>
<p>The histogram&rsquo;s appearance may be modified by specifying property/value
pairs to the underlying patch object.  For example, the face and edge color
may be modified:
</p>
<div class="example">
<pre class="example">hist (randn (1, 100), 25, &quot;facecolor&quot;, &quot;r&quot;, &quot;edgecolor&quot;, &quot;b&quot;);
</pre></div>

<p>The histogram&rsquo;s colors also depend upon the current colormap.
</p>
<div class="example">
<pre class="example">hist (rand (10, 3));
colormap (summer ());
</pre></div>

<p>The full list of patch properties is documented at <a href="Patch-Properties.html">Patch Properties</a>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>If an output is requested then no plot is made.  Instead, return the values
<var>nn</var> (numbers of elements) and <var>xx</var> (bin centers) such that
<code>bar (<var>xx</var>, <var>nn</var>)</code> will plot the histogram.
</p>

<p><strong>See also:</strong> <a href="Basic-Statistical-Functions.html#XREFhistc">histc</a>, <a href="#XREFbar">bar</a>, <a href="#XREFpie">pie</a>, <a href="#XREFrose">rose</a>.
</p></dd></dl>


<span id="XREFstemleaf"></span><dl>
<dt id="index-stemleaf">: <em></em> <strong>stemleaf</strong> <em>(<var>x</var>, <var>caption</var>)</em></dt>
<dt id="index-stemleaf-1">: <em></em> <strong>stemleaf</strong> <em>(<var>x</var>, <var>caption</var>, <var>stem_sz</var>)</em></dt>
<dt id="index-stemleaf-2">: <em><var>plotstr</var> =</em> <strong>stemleaf</strong> <em>(&hellip;)</em></dt>
<dd><p>Compute and display a stem and leaf plot of the vector <var>x</var>.
</p>
<p>The input <var>x</var> should be a vector of integers.  Any non-integer values
will be converted to integer by <code><var>x</var> = fix (<var>x</var>)</code>.  By default
each element of <var>x</var> will be plotted with the last digit of the element
as a leaf value and the remaining digits as the stem.  For example, 123
will be plotted with the stem &lsquo;<samp>12</samp>&rsquo; and the leaf &lsquo;<samp>3</samp>&rsquo;.  The second
argument, <var>caption</var>, should be a character array which provides a
description of the data.  It is included as a heading for the output.
</p>
<p>The optional input <var>stem_sz</var> sets the width of each stem.
The stem width is determined by <code>10^(<var>stem_sz</var> + 1)</code>.
The default stem width is 10.
</p>
<p>The output of <code>stemleaf</code> is composed of two parts: a
&quot;Fenced Letter Display,&quot; followed by the stem-and-leaf plot itself.
The Fenced Letter Display is described in <cite>Exploratory Data Analysis</cite>.
Briefly, the entries are as shown:
</p>
<div class="example">
<pre class="example">

        Fenced Letter Display
#% nx|___________________     nx = numel (x)
M% mi|       md         |     mi median index, md median
H% hi|hl              hu| hs  hi lower hinge index, hl,hu hinges,
1    |x(1)         x(nx)|     hs h_spreadx(1), x(nx) first
           _______            and last data value.
     ______|step |_______     step 1.5*h_spread
    f|ifl            ifh|     inner fence, lower and higher
     |nfl            nfh|     no.\ of data points within fences
    F|ofl            ofh|     outer fence, lower and higher
     |nFl            nFh|     no.\ of data points outside outer
                              fences
</pre></div>

<p>The stem-and-leaf plot shows on each line the stem value followed by the
string made up of the leaf digits.  If the <var>stem_sz</var> is not 1 the
successive leaf values are separated by &quot;,&quot;.
</p>
<p>With no return argument, the plot is immediately displayed.  If an output
argument is provided, the plot is returned as an array of strings.
</p>
<p>The leaf digits are not sorted.  If sorted leaf values are desired, use
<code><var>xs</var> = sort (<var>x</var>)</code> before calling <code>stemleaf (<var>xs</var>)</code>.
</p>
<p>The stem and leaf plot and associated displays are described in:
Chapter 3, <cite>Exploratory Data Analysis</cite> by J. W. Tukey,
Addison-Wesley, 1977.
</p>
<p><strong>See also:</strong> <a href="#XREFhist">hist</a>, <a href="#XREFprintd">printd</a>.
</p></dd></dl>


<span id="XREFprintd"></span><dl>
<dt id="index-printd">: <em></em> <strong>printd</strong> <em>(<var>obj</var>, <var>filename</var>)</em></dt>
<dt id="index-printd-1">: <em><var>out_file</var> =</em> <strong>printd</strong> <em>(&hellip;)</em></dt>
<dd>
<p>Convert any object acceptable to <code>disp</code> into the format selected by
the suffix of <var>filename</var>.
</p>
<p>If the return argument <var>out_file</var> is given, the name of the created
file is returned.
</p>
<p>This function is intended to facilitate manipulation of the output of
functions such as <code>stemleaf</code>.
</p>
<p><strong>See also:</strong> <a href="#XREFstemleaf">stemleaf</a>.
</p></dd></dl>


<span id="XREFstairs"></span><dl>
<dt id="index-stairs">: <em></em> <strong>stairs</strong> <em>(<var>y</var>)</em></dt>
<dt id="index-stairs-1">: <em></em> <strong>stairs</strong> <em>(<var>x</var>, <var>y</var>)</em></dt>
<dt id="index-stairs-2">: <em></em> <strong>stairs</strong> <em>(&hellip;, <var>style</var>)</em></dt>
<dt id="index-stairs-3">: <em></em> <strong>stairs</strong> <em>(&hellip;, <var>prop</var>, <var>val</var>, &hellip;)</em></dt>
<dt id="index-stairs-4">: <em></em> <strong>stairs</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-stairs-5">: <em><var>h</var> =</em> <strong>stairs</strong> <em>(&hellip;)</em></dt>
<dt id="index-stairs-6">: <em>[<var>xstep</var>, <var>ystep</var>] =</em> <strong>stairs</strong> <em>(&hellip;)</em></dt>
<dd><p>Produce a stairstep plot.
</p>
<p>The arguments <var>x</var> and <var>y</var> may be vectors or matrices.
If only one argument is given, it is taken as a vector of Y values
and the X coordinates are taken to be the indices of the elements
(<code><var>x</var> = 1:numel (<var>y</var>)</code>).
</p>
<p>The style to use for the plot can be defined with a line style <var>style</var>
of the same format as the <code>plot</code> command.
</p>
<p>Multiple property/value pairs may be specified, but they must appear in
pairs. The full list of properties is documented at
<a href="Line-Properties.html">Line Properties</a>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>If one output argument is requested, return a graphics handle to the
created plot.  If two output arguments are specified, the data are generated
but not plotted.  For example,
</p>
<div class="example">
<pre class="example">stairs (x, y);
</pre></div>

<p>and
</p>
<div class="example">
<pre class="example">[xs, ys] = stairs (x, y);
plot (xs, ys);
</pre></div>

<p>are equivalent.
</p>
<p><strong>See also:</strong> <a href="#XREFbar">bar</a>, <a href="#XREFhist">hist</a>, <a href="#XREFplot">plot</a>, <a href="#XREFstem">stem</a>.
</p></dd></dl>


<span id="XREFstem"></span><dl>
<dt id="index-stem">: <em></em> <strong>stem</strong> <em>(<var>y</var>)</em></dt>
<dt id="index-stem-1">: <em></em> <strong>stem</strong> <em>(<var>x</var>, <var>y</var>)</em></dt>
<dt id="index-stem-2">: <em></em> <strong>stem</strong> <em>(&hellip;, <var>linespec</var>)</em></dt>
<dt id="index-stem-3">: <em></em> <strong>stem</strong> <em>(&hellip;, &quot;filled&quot;)</em></dt>
<dt id="index-stem-4">: <em></em> <strong>stem</strong> <em>(&hellip;, <var>prop</var>, <var>val</var>, &hellip;)</em></dt>
<dt id="index-stem-5">: <em></em> <strong>stem</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-stem-6">: <em><var>h</var> =</em> <strong>stem</strong> <em>(&hellip;)</em></dt>
<dd><p>Plot a 2-D stem graph.
</p>
<p>If only one argument is given, it is taken as the y-values and the
x-coordinates are taken from the indices of the elements.
</p>
<p>If <var>y</var> is a matrix, then each column of the matrix is plotted as
a separate stem graph.  In this case <var>x</var> can either be a vector,
the same length as the number of rows in <var>y</var>, or it can be a
matrix of the same size as <var>y</var>.
</p>
<p>The default color is <code>&quot;b&quot;</code> (blue), the default line style is
<code>&quot;-&quot;</code>, and the default marker is <code>&quot;o&quot;</code>.  The line style can
be altered by the <var>linespec</var> argument in the same manner as the
<code>plot</code> command.  If the <code>&quot;filled&quot;</code> argument is present the
markers at the top of the stems will be filled in.  For example,
</p>
<div class="example">
<pre class="example">x = 1:10;
y = 2*x;
stem (x, y, &quot;r&quot;);
</pre></div>

<p>plots 10 stems with heights from 2 to 20 in red;
</p>
<p>Optional property/value pairs may be specified to control the appearance
of the plot.  The full list of properties is documented at
<a href="Line-Properties.html">Line Properties</a>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a handle to a &quot;stem series&quot;
hggroup.  The single hggroup handle has all of the graphical elements
comprising the plot as its children; This allows the properties of
multiple graphics objects to be changed by modifying just a single
property of the &quot;stem series&quot; hggroup.
</p>
<p>For example,
</p>
<div class="example">
<pre class="example">x = [0:10]';
y = [sin(x), cos(x)]
h = stem (x, y);
set (h(2), &quot;color&quot;, &quot;g&quot;);
set (h(1), &quot;basevalue&quot;, -1)
</pre></div>

<p>changes the color of the second &quot;stem series&quot; and moves the base
line of the first.
</p>
<p>Stem Series Properties
</p>
<dl compact="compact">
<dt>linestyle</dt>
<dd><p>The linestyle of the stem.  (Default: <code>&quot;-&quot;</code>)
</p>
</dd>
<dt>linewidth</dt>
<dd><p>The width of the stem.  (Default: 0.5)
</p>
</dd>
<dt>color</dt>
<dd><p>The color of the stem, and if not separately specified, the marker.
(Default: <code>&quot;b&quot;</code> [blue])
</p>
</dd>
<dt>marker</dt>
<dd><p>The marker symbol to use at the top of each stem.  (Default: <code>&quot;o&quot;</code>)
</p>
</dd>
<dt>markeredgecolor</dt>
<dd><p>The edge color of the marker.  (Default: <code>&quot;color&quot;</code> property)
</p>
</dd>
<dt>markerfacecolor</dt>
<dd><p>The color to use for &quot;filling&quot; the marker.
(Default: <code>&quot;none&quot;</code> [unfilled])
</p>
</dd>
<dt>markersize</dt>
<dd><p>The size of the marker.  (Default: 6)
</p>
</dd>
<dt>baseline</dt>
<dd><p>The handle of the line object which implements the baseline.  Use <code>set</code>
with the returned handle to change graphic properties of the baseline.
</p>
</dd>
<dt>basevalue</dt>
<dd><p>The y-value where the baseline is drawn.  (Default: 0)
</p></dd>
</dl>

<p><strong>See also:</strong> <a href="#XREFstem3">stem3</a>, <a href="#XREFbar">bar</a>, <a href="#XREFhist">hist</a>, <a href="#XREFplot">plot</a>, <a href="#XREFstairs">stairs</a>.
</p></dd></dl>


<span id="XREFstem3"></span><dl>
<dt id="index-stem3">: <em></em> <strong>stem3</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>)</em></dt>
<dt id="index-stem3-1">: <em></em> <strong>stem3</strong> <em>(&hellip;, <var>linespec</var>)</em></dt>
<dt id="index-stem3-2">: <em></em> <strong>stem3</strong> <em>(&hellip;, &quot;filled&quot;)</em></dt>
<dt id="index-stem3-3">: <em></em> <strong>stem3</strong> <em>(&hellip;, <var>prop</var>, <var>val</var>, &hellip;)</em></dt>
<dt id="index-stem3-4">: <em></em> <strong>stem3</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-stem3-5">: <em><var>h</var> =</em> <strong>stem3</strong> <em>(&hellip;)</em></dt>
<dd><p>Plot a 3-D stem graph.
</p>
<p>Stems are drawn from the height <var>z</var> to the location in the x-y plane
determined by <var>x</var> and <var>y</var>.  The default color is <code>&quot;b&quot;</code> (blue),
the default line style is <code>&quot;-&quot;</code>, and the default marker is
<code>&quot;o&quot;</code>.
</p>
<p>The line style can be altered by the <var>linespec</var> argument in the same
manner as the <code>plot</code> command.  If the <code>&quot;filled&quot;</code> argument is
present the markers at the top of the stems will be filled in.
</p>
<p>Optional property/value pairs may be specified to control the appearance
of the plot.  The full list of properties is documented at
<a href="Line-Properties.html">Line Properties</a>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a handle to the &quot;stem series&quot;
hggroup containing the line and marker objects used for the plot.
See <a href="#XREFstem">XREFstem</a>, for a description of the &quot;stem series&quot;
object.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example">theta = 0:0.2:6;
stem3 (cos (theta), sin (theta), theta);
</pre></div>

<p>plots 31 stems with heights from 0 to 6 lying on a circle.
</p>
<p>Implementation Note: Color definitions with RGB-triples are not valid.
</p>
<p><strong>See also:</strong> <a href="#XREFstem">stem</a>, <a href="#XREFbar">bar</a>, <a href="#XREFhist">hist</a>, <a href="#XREFplot">plot</a>.
</p></dd></dl>


<span id="XREFscatter"></span><dl>
<dt id="index-scatter">: <em></em> <strong>scatter</strong> <em>(<var>x</var>, <var>y</var>)</em></dt>
<dt id="index-scatter-1">: <em></em> <strong>scatter</strong> <em>(<var>x</var>, <var>y</var>, <var>s</var>)</em></dt>
<dt id="index-scatter-2">: <em></em> <strong>scatter</strong> <em>(<var>x</var>, <var>y</var>, <var>s</var>, <var>c</var>)</em></dt>
<dt id="index-scatter-3">: <em></em> <strong>scatter</strong> <em>(&hellip;, <var>style</var>)</em></dt>
<dt id="index-scatter-4">: <em></em> <strong>scatter</strong> <em>(&hellip;, &quot;filled&quot;)</em></dt>
<dt id="index-scatter-5">: <em></em> <strong>scatter</strong> <em>(&hellip;, <var>prop</var>, <var>val</var>, &hellip;)</em></dt>
<dt id="index-scatter-6">: <em></em> <strong>scatter</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-scatter-7">: <em><var>h</var> =</em> <strong>scatter</strong> <em>(&hellip;)</em></dt>
<dd><p>Draw a 2-D scatter plot.
</p>
<p>A marker is plotted at each point defined by the coordinates in the vectors
<var>x</var> and <var>y</var>.
</p>
<p>The size of the markers is determined by <var>s</var>, which can be a scalar
or a vector of the same length as <var>x</var> and <var>y</var>.  If <var>s</var>
is not given, or is an empty matrix, then a default value of 36 square
points is used (The marker size itself is <code>sqrt (s)</code>).
</p>
<p>The color of the markers is determined by <var>c</var>, which can be a string
defining a fixed color; a 3-element vector giving the red, green, and blue
components of the color; a vector of the same length as <var>x</var> that gives
a scaled index into the current colormap; or an Nx3 matrix
defining the RGB color of each marker individually.
</p>
<p>The marker to use can be changed with the <var>style</var> argument; it is a
string defining a marker in the same manner as the <code>plot</code> command.
If no marker is specified it defaults to <code>&quot;o&quot;</code> or circles.
If the argument <code>&quot;filled&quot;</code> is given then the markers are filled.
</p>
<p>Additional property/value pairs are passed directly to the underlying
patch object.  The full list of properties is documented at
<a href="Patch-Properties.html">Patch Properties</a>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the created
scatter object.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example">x = randn (100, 1);
y = randn (100, 1);
scatter (x, y, [], sqrt (x.^2 + y.^2));
</pre></div>


<p><strong>See also:</strong> <a href="Three_002dDimensional-Plots.html#XREFscatter3">scatter3</a>, <a href="Graphics-Objects.html#XREFpatch">patch</a>, <a href="#XREFplot">plot</a>.
</p></dd></dl>


<span id="XREFplotmatrix"></span><dl>
<dt id="index-plotmatrix">: <em></em> <strong>plotmatrix</strong> <em>(<var>x</var>, <var>y</var>)</em></dt>
<dt id="index-plotmatrix-1">: <em></em> <strong>plotmatrix</strong> <em>(<var>x</var>)</em></dt>
<dt id="index-plotmatrix-2">: <em></em> <strong>plotmatrix</strong> <em>(&hellip;, <var>style</var>)</em></dt>
<dt id="index-plotmatrix-3">: <em></em> <strong>plotmatrix</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-plotmatrix-4">: <em>[<var>h</var>, <var>ax</var>, <var>bigax</var>, <var>p</var>, <var>pax</var>] =</em> <strong>plotmatrix</strong> <em>(&hellip;)</em></dt>
<dd><p>Scatter plot of the columns of one matrix against another.
</p>
<p>Given the arguments <var>x</var> and <var>y</var> that have a matching number of
rows, <code>plotmatrix</code> plots a set of axes corresponding to
</p>
<div class="example">
<pre class="example">plot (<var>x</var>(:, i), <var>y</var>(:, j))
</pre></div>

<p>When called with a single argument <var>x</var> this is equivalent to
</p>
<div class="example">
<pre class="example">plotmatrix (<var>x</var>, <var>x</var>)
</pre></div>

<p>except that the diagonal of the set of axes will be replaced with the
histogram <code>hist (<var>x</var>(:, i))</code>.
</p>
<p>The marker to use can be changed with the <var>style</var> argument, that is a
string defining a marker in the same manner as the <code>plot</code> command.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> provides handles to the individual
graphics objects in the scatter plots, whereas <var>ax</var> returns the
handles to the scatter plot axes objects.
</p>
<p><var>bigax</var> is a hidden axes object that surrounds the other axes, such
that the commands <code>xlabel</code>, <code>title</code>, etc., will be associated
with this hidden axes.
</p>
<p>Finally, <var>p</var> returns the graphics objects associated with the histogram
and <var>pax</var> the corresponding axes objects.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example">plotmatrix (randn (100, 3), &quot;g+&quot;)
</pre></div>


<p><strong>See also:</strong> <a href="#XREFscatter">scatter</a>, <a href="#XREFplot">plot</a>.
</p></dd></dl>


<span id="XREFpareto"></span><dl>
<dt id="index-pareto">: <em></em> <strong>pareto</strong> <em>(<var>y</var>)</em></dt>
<dt id="index-pareto-1">: <em></em> <strong>pareto</strong> <em>(<var>y</var>, <var>x</var>)</em></dt>
<dt id="index-pareto-2">: <em></em> <strong>pareto</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-pareto-3">: <em><var>h</var> =</em> <strong>pareto</strong> <em>(&hellip;)</em></dt>
<dd><p>Draw a Pareto chart.
</p>
<p>A Pareto chart is a bar graph that arranges information in such a way
that priorities for process improvement can be established; It organizes
and displays information to show the relative importance of data.  The chart
is similar to the histogram or bar chart, except that the bars are arranged
in decreasing magnitude from left to right along the x-axis.
</p>
<p>The fundamental idea (Pareto principle) behind the use of Pareto
diagrams is that the majority of an effect is due to a small subset of the
causes.  For quality improvement, the first few contributing causes
(leftmost bars as presented on the diagram) to a problem usually account for
the majority of the result.  Thus, targeting these &quot;major causes&quot; for
elimination results in the most cost-effective improvement scheme.
</p>
<p>Typically only the magnitude data <var>y</var> is present in which case
<var>x</var> is taken to be the range <code>1 : length (<var>y</var>)</code>.  If <var>x</var>
is given it may be a string array, a cell array of strings, or a numerical
vector.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a 2-element vector with a graphics
handle for the created bar plot and a second handle for the created line
plot.
</p>
<p>An example of the use of <code>pareto</code> is
</p>
<div class="example">
<pre class="example">Cheese = {&quot;Cheddar&quot;, &quot;Swiss&quot;, &quot;Camembert&quot;, ...
          &quot;Munster&quot;, &quot;Stilton&quot;, &quot;Blue&quot;};
Sold = [105, 30, 70, 10, 15, 20];
pareto (Sold, Cheese);
</pre></div>

<p><strong>See also:</strong> <a href="#XREFbar">bar</a>, <a href="#XREFbarh">barh</a>, <a href="#XREFhist">hist</a>, <a href="#XREFpie">pie</a>, <a href="#XREFplot">plot</a>.
</p></dd></dl>


<span id="XREFrose"></span><dl>
<dt id="index-rose">: <em></em> <strong>rose</strong> <em>(<var>th</var>)</em></dt>
<dt id="index-rose-1">: <em></em> <strong>rose</strong> <em>(<var>th</var>, <var>nbins</var>)</em></dt>
<dt id="index-rose-2">: <em></em> <strong>rose</strong> <em>(<var>th</var>, <var>bins</var>)</em></dt>
<dt id="index-rose-3">: <em></em> <strong>rose</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-rose-4">: <em><var>h</var> =</em> <strong>rose</strong> <em>(&hellip;)</em></dt>
<dt id="index-rose-5">: <em>[<var>thout</var> <var>rout</var>] =</em> <strong>rose</strong> <em>(&hellip;)</em></dt>
<dd><p>Plot an angular histogram.
</p>
<p>With one vector argument, <var>th</var>, plot the histogram with 20 angular bins.
If <var>th</var> is a matrix then each column of <var>th</var> produces a separate
histogram.
</p>
<p>If <var>nbins</var> is given and is a scalar, then the histogram is produced with
<var>nbin</var> bins.  If <var>bins</var> is a vector, then the center of each bin is
defined by the values in <var>bins</var> and the number of bins is
given by the number of elements in <var>bins</var>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a vector of graphics handles to the
line objects representing each histogram.
</p>
<p>If two output arguments are requested then no plot is made and
the polar vectors necessary to plot the histogram are returned instead.
</p>
<p>Example
</p>
<div class="example">
<pre class="example">[th, r] = rose ([2*randn(1e5,1), pi + 2*randn(1e5,1)]);
polar (th, r);
</pre></div>

<p>Programming Note: When specifying bin centers with the <var>bins</var> input,
the edges for bins 2 to N-1 are spaced so that <code><var>bins</var>(i)</code> is
centered between the edges.  The final edge is drawn halfway between bin N
and bin 1.  This guarantees that all input <var>th</var> will be placed into one
of the bins, but also means that for some combinations bin 1 and bin N may
not be centered on the user&rsquo;s given values.
</p>
<p><strong>See also:</strong> <a href="#XREFhist">hist</a>, <a href="#XREFpolar">polar</a>.
</p></dd></dl>


<p>The <code>contour</code>, <code>contourf</code> and <code>contourc</code> functions
produce two-dimensional contour plots from three-dimensional data.
</p>
<span id="XREFcontour"></span><dl>
<dt id="index-contour">: <em></em> <strong>contour</strong> <em>(<var>z</var>)</em></dt>
<dt id="index-contour-1">: <em></em> <strong>contour</strong> <em>(<var>z</var>, <var>vn</var>)</em></dt>
<dt id="index-contour-2">: <em></em> <strong>contour</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>)</em></dt>
<dt id="index-contour-3">: <em></em> <strong>contour</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>, <var>vn</var>)</em></dt>
<dt id="index-contour-4">: <em></em> <strong>contour</strong> <em>(&hellip;, <var>style</var>)</em></dt>
<dt id="index-contour-5">: <em></em> <strong>contour</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-contour-6">: <em>[<var>c</var>, <var>h</var>] =</em> <strong>contour</strong> <em>(&hellip;)</em></dt>
<dd><p>Create a 2-D contour plot.
</p>
<p>Plot level curves (contour lines) of the matrix <var>z</var>, using the
contour matrix <var>c</var> computed by <code>contourc</code> from the same
arguments; see the latter for their interpretation.
</p>
<p>The appearance of contour lines can be defined with a line style <var>style</var>
in the same manner as <code>plot</code>.  Only line style and color are used;
Any markers defined by <var>style</var> are ignored.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional output <var>c</var> contains the contour levels in <code>contourc</code>
format.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the hggroup
comprising the contour lines.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example">x = 0:3;
y = 0:2;
z = y' * x;
contour (x, y, z, 2:3)
</pre></div>


<p><strong>See also:</strong> <a href="Two_002ddimensional-Function-Plotting.html#XREFezcontour">ezcontour</a>, <a href="#XREFcontourc">contourc</a>, <a href="#XREFcontourf">contourf</a>, <a href="#XREFcontour3">contour3</a>, <a href="Plot-Annotations.html#XREFclabel">clabel</a>, <a href="Three_002dDimensional-Plots.html#XREFmeshc">meshc</a>, <a href="Three_002dDimensional-Plots.html#XREFsurfc">surfc</a>, <a href="Axis-Configuration.html#XREFcaxis">caxis</a>, <a href="Representing-Images.html#XREFcolormap">colormap</a>, <a href="#XREFplot">plot</a>.
</p>
</dd></dl>


<span id="XREFcontourf"></span><dl>
<dt id="index-contourf">: <em></em> <strong>contourf</strong> <em>(<var>z</var>)</em></dt>
<dt id="index-contourf-1">: <em></em> <strong>contourf</strong> <em>(<var>z</var>, <var>vn</var>)</em></dt>
<dt id="index-contourf-2">: <em></em> <strong>contourf</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>)</em></dt>
<dt id="index-contourf-3">: <em></em> <strong>contourf</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>, <var>vn</var>)</em></dt>
<dt id="index-contourf-4">: <em></em> <strong>contourf</strong> <em>(&hellip;, <var>style</var>)</em></dt>
<dt id="index-contourf-5">: <em></em> <strong>contourf</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-contourf-6">: <em>[<var>c</var>, <var>h</var>] =</em> <strong>contourf</strong> <em>(&hellip;)</em></dt>
<dd><p>Create a 2-D contour plot with filled intervals.
</p>
<p>Plot level curves (contour lines) of the matrix <var>z</var> and fill the region
between lines with colors from the current colormap.
</p>
<p>The level curves are taken from the contour matrix <var>c</var> computed by
<code>contourc</code> for the same arguments; see the latter for their
interpretation.
</p>
<p>The appearance of contour lines can be defined with a line style <var>style</var>
in the same manner as <code>plot</code>.  Only line style and color are used;
Any markers defined by <var>style</var> are ignored.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional output <var>c</var> contains the contour levels in <code>contourc</code>
format.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the hggroup
comprising the contour lines.
</p>
<p>The following example plots filled contours of the <code>peaks</code> function.
</p>
<div class="example">
<pre class="example">[x, y, z] = peaks (50);
contourf (x, y, z, -7:9)
</pre></div>

<p><strong>See also:</strong> <a href="Two_002ddimensional-Function-Plotting.html#XREFezcontourf">ezcontourf</a>, <a href="#XREFcontour">contour</a>, <a href="#XREFcontourc">contourc</a>, <a href="#XREFcontour3">contour3</a>, <a href="Plot-Annotations.html#XREFclabel">clabel</a>, <a href="Three_002dDimensional-Plots.html#XREFmeshc">meshc</a>, <a href="Three_002dDimensional-Plots.html#XREFsurfc">surfc</a>, <a href="Axis-Configuration.html#XREFcaxis">caxis</a>, <a href="Representing-Images.html#XREFcolormap">colormap</a>, <a href="#XREFplot">plot</a>.
</p></dd></dl>


<span id="XREFcontourc"></span><dl>
<dt id="index-contourc">: <em>[<var>c</var>, <var>lev</var>] =</em> <strong>contourc</strong> <em>(<var>z</var>)</em></dt>
<dt id="index-contourc-1">: <em>[<var>c</var>, <var>lev</var>] =</em> <strong>contourc</strong> <em>(<var>z</var>, <var>vn</var>)</em></dt>
<dt id="index-contourc-2">: <em>[<var>c</var>, <var>lev</var>] =</em> <strong>contourc</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>)</em></dt>
<dt id="index-contourc-3">: <em>[<var>c</var>, <var>lev</var>] =</em> <strong>contourc</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>, <var>vn</var>)</em></dt>
<dd><p>Compute contour lines (isolines of constant Z value).
</p>
<p>The matrix <var>z</var> contains height values above the rectangular grid
determined by <var>x</var> and <var>y</var>.  If only a single input <var>z</var> is
provided then <var>x</var> is taken to be <code>1:columns (<var>z</var>)</code> and <var>y</var>
is taken to be <code>1:rows (<var>z</var>)</code>.  The minimum data size is 2x2.
</p>
<p>The optional input <var>vn</var> is either a scalar denoting the number of
contour lines to compute or a vector containing the Z values where lines
will be computed.  When <var>vn</var> is a vector the number of contour lines
is <code>numel (<var>vn</var>)</code>.  However, to compute a single contour line
at a given value use <code><var>vn</var> = [val, val]</code>.  If <var>vn</var> is omitted
it defaults to 10.
</p>
<p>The return value <var>c</var> is a 2x<var>n</var> matrix containing the
contour lines in the following format
</p>
<div class="example">
<pre class="example"><var>c</var> = [lev1, x1, x2, &hellip;, levn, x1, x2, ...
     len1, y1, y2, &hellip;, lenn, y1, y2, &hellip;]
</pre></div>

<p>in which contour line <var>n</var> has a level (height) of <var>levn</var> and
length of <var>lenn</var>.
</p>
<p>The optional return value <var>lev</var> is a vector with the Z values of
the contour levels.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example">x = 0:2;
y = x;
z = x' * y;
c = contourc (x, y, z, 2:3)
  &rArr; c =
        2.0000   1.0000   1.0000   2.0000   2.0000   3.0000   1.5000   2.0000
        4.0000   2.0000   2.0000   1.0000   1.0000   2.0000   2.0000   1.5000
</pre></div>

<p><strong>See also:</strong> <a href="#XREFcontour">contour</a>, <a href="#XREFcontourf">contourf</a>, <a href="#XREFcontour3">contour3</a>, <a href="Plot-Annotations.html#XREFclabel">clabel</a>.
</p></dd></dl>


<span id="XREFcontour3"></span><dl>
<dt id="index-contour3">: <em></em> <strong>contour3</strong> <em>(<var>z</var>)</em></dt>
<dt id="index-contour3-1">: <em></em> <strong>contour3</strong> <em>(<var>z</var>, <var>vn</var>)</em></dt>
<dt id="index-contour3-2">: <em></em> <strong>contour3</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>)</em></dt>
<dt id="index-contour3-3">: <em></em> <strong>contour3</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>, <var>vn</var>)</em></dt>
<dt id="index-contour3-4">: <em></em> <strong>contour3</strong> <em>(&hellip;, <var>style</var>)</em></dt>
<dt id="index-contour3-5">: <em></em> <strong>contour3</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-contour3-6">: <em>[<var>c</var>, <var>h</var>] =</em> <strong>contour3</strong> <em>(&hellip;)</em></dt>
<dd><p>Create a 3-D contour plot.
</p>
<p><code>contour3</code> plots level curves (contour lines) of the matrix <var>z</var>
at a Z level corresponding to each contour.  This is in contrast to
<code>contour</code> which plots all of the contour lines at the same Z level
and produces a 2-D plot.
</p>
<p>The level curves are taken from the contour matrix <var>c</var> computed by
<code>contourc</code> for the same arguments; see the latter for their
interpretation.
</p>
<p>The appearance of contour lines can be defined with a line style <var>style</var>
in the same manner as <code>plot</code>.  Only line style and color are used;
Any markers defined by <var>style</var> are ignored.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional output <var>c</var> are the contour levels in <code>contourc</code>
format.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the hggroup
comprising the contour lines.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example">contour3 (peaks (19));
colormap cool;
hold on;
surf (peaks (19), &quot;facecolor&quot;, &quot;none&quot;, &quot;edgecolor&quot;, &quot;black&quot;);
</pre></div>


<p><strong>See also:</strong> <a href="#XREFcontour">contour</a>, <a href="#XREFcontourc">contourc</a>, <a href="#XREFcontourf">contourf</a>, <a href="Plot-Annotations.html#XREFclabel">clabel</a>, <a href="Three_002dDimensional-Plots.html#XREFmeshc">meshc</a>, <a href="Three_002dDimensional-Plots.html#XREFsurfc">surfc</a>, <a href="Axis-Configuration.html#XREFcaxis">caxis</a>, <a href="Representing-Images.html#XREFcolormap">colormap</a>, <a href="#XREFplot">plot</a>.
</p></dd></dl>


<p>The <code>errorbar</code>, <code>semilogxerr</code>, <code>semilogyerr</code>, and
<code>loglogerr</code> functions produce plots with error bar markers.  For
example,
</p>
<div class="example">
<pre class="example">rand (&quot;state&quot;, 2);
x = 0:0.1:10;
y = sin (x);
lerr = 0.1 .* rand (size (x));
uerr = 0.1 .* rand (size (x));
errorbar (x, y, lerr, uerr);
axis ([0, 10, -1.1, 1.1]);
xlabel (&quot;x&quot;);
ylabel (&quot;sin (x)&quot;);
title (&quot;Errorbar plot of sin (x)&quot;);
</pre></div>

<p>produces the figure shown in <a href="#fig_003aerrorbar">Figure 15.3</a>.
</p>
<div class="float"><span id="fig_003aerrorbar"></span>
<div align="center"><img src="errorbar.png" alt="errorbar">
</div>
<div class="float-caption"><p><strong>Figure 15.3: </strong>Errorbar plot.</p></div></div>
<span id="XREFerrorbar"></span><dl>
<dt id="index-errorbar">: <em></em> <strong>errorbar</strong> <em>(<var>y</var>, <var>ey</var>)</em></dt>
<dt id="index-errorbar-1">: <em></em> <strong>errorbar</strong> <em>(<var>y</var>, &hellip;, <var>fmt</var>)</em></dt>
<dt id="index-errorbar-2">: <em></em> <strong>errorbar</strong> <em>(<var>x</var>, <var>y</var>, <var>ey</var>)</em></dt>
<dt id="index-errorbar-3">: <em></em> <strong>errorbar</strong> <em>(<var>x</var>, <var>y</var>, <var>err</var>, <var>fmt</var>)</em></dt>
<dt id="index-errorbar-4">: <em></em> <strong>errorbar</strong> <em>(<var>x</var>, <var>y</var>, <var>lerr</var>, <var>uerr</var>, <var>fmt</var>)</em></dt>
<dt id="index-errorbar-5">: <em></em> <strong>errorbar</strong> <em>(<var>x</var>, <var>y</var>, <var>ex</var>, <var>ey</var>, <var>fmt</var>)</em></dt>
<dt id="index-errorbar-6">: <em></em> <strong>errorbar</strong> <em>(<var>x</var>, <var>y</var>, <var>lx</var>, <var>ux</var>, <var>ly</var>, <var>uy</var>, <var>fmt</var>)</em></dt>
<dt id="index-errorbar-7">: <em></em> <strong>errorbar</strong> <em>(<var>x1</var>, <var>y1</var>, &hellip;, <var>fmt</var>, <var>xn</var>, <var>yn</var>, &hellip;)</em></dt>
<dt id="index-errorbar-8">: <em></em> <strong>errorbar</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-errorbar-9">: <em><var>h</var> =</em> <strong>errorbar</strong> <em>(&hellip;)</em></dt>
<dd><p>Create a 2-D plot with errorbars.
</p>
<p>Many different combinations of arguments are possible.  The simplest form is
</p>
<div class="example">
<pre class="example">errorbar (<var>y</var>, <var>ey</var>)
</pre></div>

<p>where the first argument is taken as the set of <var>y</var> coordinates, the
second argument <var>ey</var> are the errors around the <var>y</var> values, and the
<var>x</var> coordinates are taken to be the indices of the elements
(<code>1:numel (<var>y</var>)</code>).
</p>
<p>The general form of the function is
</p>
<div class="example">
<pre class="example">errorbar (<var>x</var>, <var>y</var>, <var>err1</var>, &hellip;, <var>fmt</var>, &hellip;)
</pre></div>

<p>After the <var>x</var> and <var>y</var> arguments there can be 1, 2, or 4
parameters specifying the error values depending on the nature of the error
values and the plot format <var>fmt</var>.
</p>
<dl compact="compact">
<dt><var>err</var> (scalar)</dt>
<dd><p>When the error is a scalar all points share the same error value.
The errorbars are symmetric and are drawn from <var>data</var>-<var>err</var> to
<var>data</var>+<var>err</var>.
The <var>fmt</var> argument determines whether <var>err</var> is in the x-direction,
y-direction (default), or both.
</p>
</dd>
<dt><var>err</var> (vector or matrix)</dt>
<dd><p>Each data point has a particular error value.
The errorbars are symmetric and are drawn from <var>data</var>(n)-<var>err</var>(n) to
<var>data</var>(n)+<var>err</var>(n).
</p>
</dd>
<dt><var>lerr</var>, <var>uerr</var> (scalar)</dt>
<dd><p>The errors have a single low-side value and a single upper-side value.
The errorbars are not symmetric and are drawn from <var>data</var>-<var>lerr</var> to
<var>data</var>+<var>uerr</var>.
</p>
</dd>
<dt><var>lerr</var>, <var>uerr</var> (vector or matrix)</dt>
<dd><p>Each data point has a low-side error and an upper-side error.
The errorbars are not symmetric and are drawn from
<var>data</var>(n)-<var>lerr</var>(n) to <var>data</var>(n)+<var>uerr</var>(n).
</p></dd>
</dl>

<p>Any number of data sets (<var>x1</var>,<var>y1</var>, <var>x2</var>,<var>y2</var>, &hellip;) may
appear as long as they are separated by a format string <var>fmt</var>.
</p>
<p>If <var>y</var> is a matrix, <var>x</var> and the error parameters must also be
matrices having the same dimensions.  The columns of <var>y</var> are plotted
versus the corresponding columns of <var>x</var> and errorbars are taken from
the corresponding columns of the error parameters.
</p>
<p>If <var>fmt</var> is missing, the yerrorbars (&quot;~&quot;) plot style is assumed.
</p>
<p>If the <var>fmt</var> argument is supplied then it is interpreted, as in normal
plots, to specify the line style, marker, and color.  In addition,
<var>fmt</var> may include an errorbar style which <strong>must precede</strong> the
ordinary format codes.  The following errorbar styles are supported:
</p>
<dl compact="compact">
<dt>&lsquo;<samp>~</samp>&rsquo;</dt>
<dd><p>Set yerrorbars plot style (default).
</p>
</dd>
<dt>&lsquo;<samp>&gt;</samp>&rsquo;</dt>
<dd><p>Set xerrorbars plot style.
</p>
</dd>
<dt>&lsquo;<samp>~&gt;</samp>&rsquo;</dt>
<dd><p>Set xyerrorbars plot style.
</p>
</dd>
<dt>&lsquo;<samp>#~</samp>&rsquo;</dt>
<dd><p>Set yboxes plot style.
</p>
</dd>
<dt>&lsquo;<samp>#</samp>&rsquo;</dt>
<dd><p>Set xboxes plot style.
</p>
</dd>
<dt>&lsquo;<samp>#~&gt;</samp>&rsquo;</dt>
<dd><p>Set xyboxes plot style.
</p></dd>
</dl>

<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a handle to the hggroup object
representing the data plot and errorbars.
</p>
<p>Note: For compatibility with <small>MATLAB</small> a line is drawn through all data
points.  However, most scientific errorbar plots are a scatter plot of
points with errorbars.  To accomplish this, add a marker style to the
<var>fmt</var> argument such as <code>&quot;.&quot;</code>.  Alternatively, remove the line
by modifying the returned graphic handle with
<code>set (h, &quot;linestyle&quot;, &quot;none&quot;)</code>.
</p>
<p>Examples:
</p>
<div class="example">
<pre class="example">errorbar (<var>x</var>, <var>y</var>, <var>ex</var>, &quot;&gt;.r&quot;)
</pre></div>

<p>produces an xerrorbar plot of <var>y</var> versus <var>x</var> with <var>x</var>
errorbars drawn from <var>x</var>-<var>ex</var> to <var>x</var>+<var>ex</var>.  The marker
<code>&quot;.&quot;</code> is used so no connecting line is drawn and the errorbars
appear in red.
</p>
<div class="example">
<pre class="example">errorbar (<var>x</var>, <var>y1</var>, <var>ey</var>, &quot;~&quot;,
          <var>x</var>, <var>y2</var>, <var>ly</var>, <var>uy</var>)
</pre></div>

<p>produces yerrorbar plots with <var>y1</var> and <var>y2</var> versus <var>x</var>.
Errorbars for <var>y1</var> are drawn from <var>y1</var>-<var>ey</var> to
<var>y1</var>+<var>ey</var>, errorbars for <var>y2</var> from <var>y2</var>-<var>ly</var> to
<var>y2</var>+<var>uy</var>.
</p>
<div class="example">
<pre class="example">errorbar (<var>x</var>, <var>y</var>, <var>lx</var>, <var>ux</var>,
          <var>ly</var>, <var>uy</var>, &quot;~&gt;&quot;)
</pre></div>

<p>produces an xyerrorbar plot of <var>y</var> versus <var>x</var> in which
<var>x</var> errorbars are drawn from <var>x</var>-<var>lx</var> to <var>x</var>+<var>ux</var>
and <var>y</var> errorbars from <var>y</var>-<var>ly</var> to <var>y</var>+<var>uy</var>.
</p>
<p><strong>See also:</strong> <a href="#XREFsemilogxerr">semilogxerr</a>, <a href="#XREFsemilogyerr">semilogyerr</a>, <a href="#XREFloglogerr">loglogerr</a>, <a href="#XREFplot">plot</a>.
</p></dd></dl>


<span id="XREFsemilogxerr"></span><dl>
<dt id="index-semilogxerr">: <em></em> <strong>semilogxerr</strong> <em>(<var>y</var>, <var>ey</var>)</em></dt>
<dt id="index-semilogxerr-1">: <em></em> <strong>semilogxerr</strong> <em>(<var>y</var>, &hellip;, <var>fmt</var>)</em></dt>
<dt id="index-semilogxerr-2">: <em></em> <strong>semilogxerr</strong> <em>(<var>x</var>, <var>y</var>, <var>ey</var>)</em></dt>
<dt id="index-semilogxerr-3">: <em></em> <strong>semilogxerr</strong> <em>(<var>x</var>, <var>y</var>, <var>err</var>, <var>fmt</var>)</em></dt>
<dt id="index-semilogxerr-4">: <em></em> <strong>semilogxerr</strong> <em>(<var>x</var>, <var>y</var>, <var>lerr</var>, <var>uerr</var>, <var>fmt</var>)</em></dt>
<dt id="index-semilogxerr-5">: <em></em> <strong>semilogxerr</strong> <em>(<var>x</var>, <var>y</var>, <var>ex</var>, <var>ey</var>, <var>fmt</var>)</em></dt>
<dt id="index-semilogxerr-6">: <em></em> <strong>semilogxerr</strong> <em>(<var>x</var>, <var>y</var>, <var>lx</var>, <var>ux</var>, <var>ly</var>, <var>uy</var>, <var>fmt</var>)</em></dt>
<dt id="index-semilogxerr-7">: <em></em> <strong>semilogxerr</strong> <em>(<var>x1</var>, <var>y1</var>, &hellip;, <var>fmt</var>, <var>xn</var>, <var>yn</var>, &hellip;)</em></dt>
<dt id="index-semilogxerr-8">: <em></em> <strong>semilogxerr</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-semilogxerr-9">: <em><var>h</var> =</em> <strong>semilogxerr</strong> <em>(&hellip;)</em></dt>
<dd><p>Produce 2-D plots using a logarithmic scale for the x-axis and errorbars
at each data point.
</p>
<p>Many different combinations of arguments are possible.  The most common
form is
</p>
<div class="example">
<pre class="example">semilogxerr (<var>x</var>, <var>y</var>, <var>ey</var>, <var>fmt</var>)
</pre></div>

<p>which produces a semi-logarithmic plot of <var>y</var> versus <var>x</var>
with errors in the <var>y</var>-scale defined by <var>ey</var> and the plot
format defined by <var>fmt</var>.  See <a href="#XREFerrorbar">errorbar</a>, for available
formats and additional information.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFerrorbar">errorbar</a>, <a href="#XREFsemilogyerr">semilogyerr</a>, <a href="#XREFloglogerr">loglogerr</a>.
</p></dd></dl>


<span id="XREFsemilogyerr"></span><dl>
<dt id="index-semilogyerr">: <em></em> <strong>semilogyerr</strong> <em>(<var>y</var>, <var>ey</var>)</em></dt>
<dt id="index-semilogyerr-1">: <em></em> <strong>semilogyerr</strong> <em>(<var>y</var>, &hellip;, <var>fmt</var>)</em></dt>
<dt id="index-semilogyerr-2">: <em></em> <strong>semilogyerr</strong> <em>(<var>x</var>, <var>y</var>, <var>ey</var>)</em></dt>
<dt id="index-semilogyerr-3">: <em></em> <strong>semilogyerr</strong> <em>(<var>x</var>, <var>y</var>, <var>err</var>, <var>fmt</var>)</em></dt>
<dt id="index-semilogyerr-4">: <em></em> <strong>semilogyerr</strong> <em>(<var>x</var>, <var>y</var>, <var>lerr</var>, <var>uerr</var>, <var>fmt</var>)</em></dt>
<dt id="index-semilogyerr-5">: <em></em> <strong>semilogyerr</strong> <em>(<var>x</var>, <var>y</var>, <var>ex</var>, <var>ey</var>, <var>fmt</var>)</em></dt>
<dt id="index-semilogyerr-6">: <em></em> <strong>semilogyerr</strong> <em>(<var>x</var>, <var>y</var>, <var>lx</var>, <var>ux</var>, <var>ly</var>, <var>uy</var>, <var>fmt</var>)</em></dt>
<dt id="index-semilogyerr-7">: <em></em> <strong>semilogyerr</strong> <em>(<var>x1</var>, <var>y1</var>, &hellip;, <var>fmt</var>, <var>xn</var>, <var>yn</var>, &hellip;)</em></dt>
<dt id="index-semilogyerr-8">: <em></em> <strong>semilogyerr</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-semilogyerr-9">: <em><var>h</var> =</em> <strong>semilogyerr</strong> <em>(&hellip;)</em></dt>
<dd><p>Produce 2-D plots using a logarithmic scale for the y-axis and errorbars
at each data point.
</p>
<p>Many different combinations of arguments are possible.  The most common
form is
</p>
<div class="example">
<pre class="example">semilogyerr (<var>x</var>, <var>y</var>, <var>ey</var>, <var>fmt</var>)
</pre></div>

<p>which produces a semi-logarithmic plot of <var>y</var> versus <var>x</var>
with errors in the <var>y</var>-scale defined by <var>ey</var> and the plot
format defined by <var>fmt</var>.  See <a href="#XREFerrorbar">errorbar</a>, for available
formats and additional information.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFerrorbar">errorbar</a>, <a href="#XREFsemilogxerr">semilogxerr</a>, <a href="#XREFloglogerr">loglogerr</a>.
</p></dd></dl>


<span id="XREFloglogerr"></span><dl>
<dt id="index-loglogerr">: <em></em> <strong>loglogerr</strong> <em>(<var>y</var>, <var>ey</var>)</em></dt>
<dt id="index-loglogerr-1">: <em></em> <strong>loglogerr</strong> <em>(<var>y</var>, &hellip;, <var>fmt</var>)</em></dt>
<dt id="index-loglogerr-2">: <em></em> <strong>loglogerr</strong> <em>(<var>x</var>, <var>y</var>, <var>ey</var>)</em></dt>
<dt id="index-loglogerr-3">: <em></em> <strong>loglogerr</strong> <em>(<var>x</var>, <var>y</var>, <var>err</var>, <var>fmt</var>)</em></dt>
<dt id="index-loglogerr-4">: <em></em> <strong>loglogerr</strong> <em>(<var>x</var>, <var>y</var>, <var>lerr</var>, <var>uerr</var>, <var>fmt</var>)</em></dt>
<dt id="index-loglogerr-5">: <em></em> <strong>loglogerr</strong> <em>(<var>x</var>, <var>y</var>, <var>ex</var>, <var>ey</var>, <var>fmt</var>)</em></dt>
<dt id="index-loglogerr-6">: <em></em> <strong>loglogerr</strong> <em>(<var>x</var>, <var>y</var>, <var>lx</var>, <var>ux</var>, <var>ly</var>, <var>uy</var>, <var>fmt</var>)</em></dt>
<dt id="index-loglogerr-7">: <em></em> <strong>loglogerr</strong> <em>(<var>x1</var>, <var>y1</var>, &hellip;, <var>fmt</var>, <var>xn</var>, <var>yn</var>, &hellip;)</em></dt>
<dt id="index-loglogerr-8">: <em></em> <strong>loglogerr</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-loglogerr-9">: <em><var>h</var> =</em> <strong>loglogerr</strong> <em>(&hellip;)</em></dt>
<dd><p>Produce 2-D plots on a double logarithm axis with errorbars.
</p>
<p>Many different combinations of arguments are possible.  The most common
form is
</p>
<div class="example">
<pre class="example">loglogerr (<var>x</var>, <var>y</var>, <var>ey</var>, <var>fmt</var>)
</pre></div>

<p>which produces a double logarithm plot of <var>y</var> versus <var>x</var>
with errors in the <var>y</var>-scale defined by <var>ey</var> and the plot
format defined by <var>fmt</var>.  See <a href="#XREFerrorbar">errorbar</a>, for available
formats and additional information.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p><strong>See also:</strong> <a href="#XREFerrorbar">errorbar</a>, <a href="#XREFsemilogxerr">semilogxerr</a>, <a href="#XREFsemilogyerr">semilogyerr</a>.
</p></dd></dl>


<p>Finally, the <code>polar</code> function allows you to easily plot data in
polar coordinates.  However, the display coordinates remain rectangular
and linear.  For example,
</p>
<div class="example">
<pre class="example">polar (0:0.1:10*pi, 0:0.1:10*pi);
title (&quot;Example polar plot from 0 to 10*pi&quot;);
</pre></div>

<p>produces the spiral plot shown in <a href="#fig_003apolar">Figure 15.4</a>.
</p>
<div class="float"><span id="fig_003apolar"></span>
<div align="center"><img src="polar.png" alt="polar">
</div>
<div class="float-caption"><p><strong>Figure 15.4: </strong>Polar plot.</p></div></div>
<span id="XREFpolar"></span><dl>
<dt id="index-polar">: <em></em> <strong>polar</strong> <em>(<var>theta</var>, <var>rho</var>)</em></dt>
<dt id="index-polar-1">: <em></em> <strong>polar</strong> <em>(<var>theta</var>, <var>rho</var>, <var>fmt</var>)</em></dt>
<dt id="index-polar-2">: <em></em> <strong>polar</strong> <em>(<var>cplx</var>)</em></dt>
<dt id="index-polar-3">: <em></em> <strong>polar</strong> <em>(<var>cplx</var>, <var>fmt</var>)</em></dt>
<dt id="index-polar-4">: <em></em> <strong>polar</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-polar-5">: <em><var>h</var> =</em> <strong>polar</strong> <em>(&hellip;)</em></dt>
<dd><p>Create a 2-D plot from polar coordinates <var>theta</var> and <var>rho</var>.
</p>
<p>The input <var>theta</var> is assumed to be radians and is converted to degrees
for plotting.  If you have degrees then you must convert
(see <a href="Coordinate-Transformations.html#XREFcart2pol">cart2pol</a>) to radians before passing the data to this
function.
</p>
<p>If a single complex input <var>cplx</var> is given then the real part is used
for <var>theta</var> and the imaginary part is used for <var>rho</var>.
</p>
<p>The optional argument <var>fmt</var> specifies the line format in the same way
as <code>plot</code>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the created plot.
</p>
<p>Implementation Note: The polar axis is drawn using line and text objects
encapsulated in an hggroup.  The hggroup properties are linked to the
original axes object such that altering an appearance property, for example
<code>fontname</code>, will update the polar axis.  Two new properties are
added to the original axes&ndash;<code>rtick</code>, <code>ttick</code>&ndash;which replace
<code>xtick</code>, <code>ytick</code>.  The first is a list of tick locations in the
radial (rho) direction; The second is a list of tick locations in the
angular (theta) direction specified in degrees, i.e., in the range 0&ndash;359.
</p>
<p><strong>See also:</strong> <a href="#XREFrose">rose</a>, <a href="#XREFcompass">compass</a>, <a href="#XREFplot">plot</a>, <a href="Coordinate-Transformations.html#XREFcart2pol">cart2pol</a>.
</p></dd></dl>


<span id="XREFpie"></span><dl>
<dt id="index-pie">: <em></em> <strong>pie</strong> <em>(<var>x</var>)</em></dt>
<dt id="index-pie-1">: <em></em> <strong>pie</strong> <em>(&hellip;, <var>explode</var>)</em></dt>
<dt id="index-pie-2">: <em></em> <strong>pie</strong> <em>(&hellip;, <var>labels</var>)</em></dt>
<dt id="index-pie-3">: <em></em> <strong>pie</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-pie-4">: <em><var>h</var> =</em> <strong>pie</strong> <em>(&hellip;)</em></dt>
<dd><p>Plot a 2-D pie chart.
</p>
<p>When called with a single vector argument, produce a pie chart of the
elements in <var>x</var>.  The size of the ith slice is the percentage that the
element <var>x</var>i represents of the total sum of <var>x</var>:
<code>pct = <var>x</var>(i) / sum (<var>x</var>)</code>.
</p>
<p>The optional input <var>explode</var> is a vector of the same length as <var>x</var>
that, if nonzero, &quot;explodes&quot; the slice from the pie chart.
</p>
<p>The optional input <var>labels</var> is a cell array of strings of the same
length as <var>x</var> specifying the label for each slice.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a list of handles to the patch
and text objects generating the plot.
</p>
<p>Note: If <code>sum (<var>x</var>) &le; 1</code> then the elements of <var>x</var> are
interpreted as percentages directly and are not normalized by <code>sum
(x)</code>.  Furthermore, if the sum is less than 1 then there will be a missing
slice in the pie plot to represent the missing, unspecified percentage.
</p>

<p><strong>See also:</strong> <a href="#XREFpie3">pie3</a>, <a href="#XREFbar">bar</a>, <a href="#XREFhist">hist</a>, <a href="#XREFrose">rose</a>.
</p></dd></dl>


<span id="XREFpie3"></span><dl>
<dt id="index-pie3">: <em></em> <strong>pie3</strong> <em>(<var>x</var>)</em></dt>
<dt id="index-pie3-1">: <em></em> <strong>pie3</strong> <em>(&hellip;, <var>explode</var>)</em></dt>
<dt id="index-pie3-2">: <em></em> <strong>pie3</strong> <em>(&hellip;, <var>labels</var>)</em></dt>
<dt id="index-pie3-3">: <em></em> <strong>pie3</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-pie3-4">: <em><var>h</var> =</em> <strong>pie3</strong> <em>(&hellip;)</em></dt>
<dd><p>Plot a 3-D pie chart.
</p>
<p>Called with a single vector argument, produces a 3-D pie chart of the
elements in <var>x</var>.  The size of the ith slice is the percentage that the
element <var>x</var>i represents of the total sum of <var>x</var>:
<code>pct = <var>x</var>(i) / sum (<var>x</var>)</code>.
</p>
<p>The optional input <var>explode</var> is a vector of the same length as <var>x</var>
that, if nonzero, &quot;explodes&quot; the slice from the pie chart.
</p>
<p>The optional input <var>labels</var> is a cell array of strings of the same
length as <var>x</var> specifying the label for each slice.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a list of graphics handles to the
patch, surface, and text objects generating the plot.
</p>
<p>Note: If <code>sum (<var>x</var>) &le; 1</code> then the elements of <var>x</var> are
interpreted as percentages directly and are not normalized by <code>sum
(x)</code>.  Furthermore, if the sum is less than 1 then there will be a missing
slice in the pie plot to represent the missing, unspecified percentage.
</p>

<p><strong>See also:</strong> <a href="#XREFpie">pie</a>, <a href="#XREFbar">bar</a>, <a href="#XREFhist">hist</a>, <a href="#XREFrose">rose</a>.
</p></dd></dl>


<span id="XREFquiver"></span><dl>
<dt id="index-quiver">: <em></em> <strong>quiver</strong> <em>(<var>u</var>, <var>v</var>)</em></dt>
<dt id="index-quiver-1">: <em></em> <strong>quiver</strong> <em>(<var>x</var>, <var>y</var>, <var>u</var>, <var>v</var>)</em></dt>
<dt id="index-quiver-2">: <em></em> <strong>quiver</strong> <em>(&hellip;, <var>s</var>)</em></dt>
<dt id="index-quiver-3">: <em></em> <strong>quiver</strong> <em>(&hellip;, <var>style</var>)</em></dt>
<dt id="index-quiver-4">: <em></em> <strong>quiver</strong> <em>(&hellip;, &quot;filled&quot;)</em></dt>
<dt id="index-quiver-5">: <em></em> <strong>quiver</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-quiver-6">: <em><var>h</var> =</em> <strong>quiver</strong> <em>(&hellip;)</em></dt>
<dd>
<p>Plot a 2-D vector field with arrows.
</p>
<p>Plot the (<var>u</var>, <var>v</var>) components of a vector field at the grid points
defined by (<var>x</var>, <var>y</var>).  If the grid is uniform then <var>x</var> and
<var>y</var> can be specified as vectors and <code>meshgrid</code> is used to create
the 2-D grid.
</p>
<p>If <var>x</var> and <var>y</var> are not given they are assumed to be
<code>(1:<var>m</var>, 1:<var>n</var>)</code> where
<code>[<var>m</var>, <var>n</var>] = size (<var>u</var>)</code>.
</p>
<p>The optional input <var>s</var> is a scalar defining a scaling factor to use for
the arrows of the field relative to the mesh spacing.  A value of 1.0 will
result in the longest vector exactly filling one grid square.  A value of 0
disables all scaling.  The default value is 0.9.
</p>
<p>The style to use for the plot can be defined with a line style <var>style</var>
of the same format as the <code>plot</code> command.  If a marker is specified
then the markers are drawn at the origin of the vectors (which are the grid
points defined by <var>x</var> and <var>y</var>).  When a marker is specified, the
arrowhead is not drawn.  If the argument <code>&quot;filled&quot;</code> is given then the
markers are filled.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a graphics handle to a quiver object.
A quiver object regroups the components of the quiver plot (body, arrow,
and marker), and allows them to be changed together.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example">[x, y] = meshgrid (1:2:20);
h = quiver (x, y, sin (2*pi*x/10), sin (2*pi*y/10));
set (h, &quot;maxheadsize&quot;, 0.33);
</pre></div>


<p><strong>See also:</strong> <a href="#XREFquiver3">quiver3</a>, <a href="#XREFcompass">compass</a>, <a href="#XREFfeather">feather</a>, <a href="#XREFplot">plot</a>.
</p></dd></dl>


<span id="XREFquiver3"></span><dl>
<dt id="index-quiver3">: <em></em> <strong>quiver3</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>, <var>u</var>, <var>v</var>, <var>w</var>)</em></dt>
<dt id="index-quiver3-1">: <em></em> <strong>quiver3</strong> <em>(<var>z</var>, <var>u</var>, <var>v</var>, <var>w</var>)</em></dt>
<dt id="index-quiver3-2">: <em></em> <strong>quiver3</strong> <em>(&hellip;, <var>s</var>)</em></dt>
<dt id="index-quiver3-3">: <em></em> <strong>quiver3</strong> <em>(&hellip;, <var>style</var>)</em></dt>
<dt id="index-quiver3-4">: <em></em> <strong>quiver3</strong> <em>(&hellip;, &quot;filled&quot;)</em></dt>
<dt id="index-quiver3-5">: <em></em> <strong>quiver3</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-quiver3-6">: <em><var>h</var> =</em> <strong>quiver3</strong> <em>(&hellip;)</em></dt>
<dd>
<p>Plot a 3-D vector field with arrows.
</p>
<p>Plot the (<var>u</var>, <var>v</var>, <var>w</var>) components of a vector field at the
grid points defined by (<var>x</var>, <var>y</var>, <var>z</var>).  If the grid is uniform
then <var>x</var>, <var>y</var>, and <var>z</var> can be specified as vectors and
<code>meshgrid</code> is used to create the 3-D grid.
</p>
<p>If <var>x</var> and <var>y</var> are not given they are assumed to be
<code>(1:<var>m</var>, 1:<var>n</var>)</code> where
<code>[<var>m</var>, <var>n</var>] = size (<var>u</var>)</code>.
</p>
<p>The optional input <var>s</var> is a scalar defining a scaling factor to use for
the arrows of the field relative to the mesh spacing.  A value of 1.0 will
result in the longest vector exactly filling one grid cube.  A value of 0
disables all scaling.  The default value is 0.9.
</p>
<p>The style to use for the plot can be defined with a line style <var>style</var>
of the same format as the <code>plot</code> command.  If a marker is specified
then the markers are drawn at the origin of the vectors (which are the grid
points defined by <var>x</var>, <var>y</var>, <var>z</var>).  When a marker is specified,
the arrowhead is not drawn.  If the argument <code>&quot;filled&quot;</code> is given then
the markers are filled.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a graphics handle to a quiver object.
A quiver object regroups the components of the quiver plot (body, arrow,
and marker), and allows them to be changed together.
</p>
<div class="example">
<pre class="example">[x, y, z] = peaks (25);
surf (x, y, z);
hold on;
[u, v, w] = surfnorm (x, y, z / 10);
h = quiver3 (x, y, z, u, v, w);
set (h, &quot;maxheadsize&quot;, 0.33);
</pre></div>


<p><strong>See also:</strong> <a href="#XREFquiver">quiver</a>, <a href="#XREFcompass">compass</a>, <a href="#XREFfeather">feather</a>, <a href="#XREFplot">plot</a>.
</p></dd></dl>


<span id="XREFstreamtube"></span><dl>
<dt id="index-streamtube">: <em></em> <strong>streamtube</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>, <var>u</var>, <var>v</var>, <var>w</var>, <var>sx</var>, <var>sy</var>, <var>sz</var>)</em></dt>
<dt id="index-streamtube-1">: <em></em> <strong>streamtube</strong> <em>(<var>u</var>, <var>v</var>, <var>w</var>, <var>sx</var>, <var>sy</var>, <var>sz</var>)</em></dt>
<dt id="index-streamtube-2">: <em></em> <strong>streamtube</strong> <em>(<var>xyz</var>, <var>x</var>, <var>y</var>, <var>z</var>, <var>div</var>)</em></dt>
<dt id="index-streamtube-3">: <em></em> <strong>streamtube</strong> <em>(<var>xyz</var>, <var>div</var>)</em></dt>
<dt id="index-streamtube-4">: <em></em> <strong>streamtube</strong> <em>(<var>xyz</var>, <var>dia</var>)</em></dt>
<dt id="index-streamtube-5">: <em></em> <strong>streamtube</strong> <em>(&hellip;, <var>options</var>)</em></dt>
<dt id="index-streamtube-6">: <em></em> <strong>streamtube</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-streamtube-7">: <em><var>h</var> =</em> <strong>streamtube</strong> <em>(&hellip;)</em></dt>
<dd><p>Plot tubes scaled by the divergence along streamlines.
</p>
<p><code>streamtube</code> draws tubes whose diameter is scaled by the divergence of
a vector field.  The vector field is given by
<code>[<var>u</var>, <var>v</var>, <var>w</var>]</code> and is defined over a rectangular grid
given by <code>[<var>x</var>, <var>y</var>, <var>z</var>]</code>.  The tubes start at the
seed points <code>[<var>sx</var>, <var>sy</var>, <var>sz</var>]</code> and are plot along
streamlines.
</p>
<p><code>streamtube</code> can also be called with a cell array containing
pre-computed streamline data.  To do this, <var>xyz</var> must be created with
the <code>stream3</code> command.  <var>div</var> is used to scale the tubes.
In order to plot tubes scaled by the vector field divergence, <var>div</var>
must be calculated with the <code>divergence</code> command.
</p>
<p>A tube diameter of zero corresponds to the smallest scaling value along the
streamline and the largest tube diameter corresponds to the largest scaling
value.
</p>
<p>It is also possible to draw a tube along an arbitrary array of vertices
<var>xyz</var>.  The tube diameter can be specified by the vertex array <var>dia</var>
or by a constant.
</p>
<p>The input parameter <var>options</var> is a 2-D vector of the form
<code>[<var>scale</var>, <var>n</var>]</code>.  The first parameter scales the tube
diameter (default 1).  The second parameter specifies the number of vertices
that are used to construct the tube circumference (default 20).
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the plot objects
created for each tube.
</p>

<p><strong>See also:</strong> <a href="#XREFstream3">stream3</a>, <a href="#XREFstreamline">streamline</a>, <a href="#XREFostreamtube">ostreamtube</a>.
</p></dd></dl>


<span id="XREFostreamtube"></span><dl>
<dt id="index-ostreamtube">: <em></em> <strong>ostreamtube</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>, <var>u</var>, <var>v</var>, <var>w</var>, <var>sx</var>, <var>sy</var>, <var>sz</var>)</em></dt>
<dt id="index-ostreamtube-1">: <em></em> <strong>ostreamtube</strong> <em>(<var>u</var>, <var>v</var>, <var>w</var>, <var>sx</var>, <var>sy</var>, <var>sz</var>)</em></dt>
<dt id="index-ostreamtube-2">: <em></em> <strong>ostreamtube</strong> <em>(<var>xyz</var>, <var>x</var>, <var>y</var>, <var>z</var>, <var>u</var>, <var>v</var>, <var>w</var>)</em></dt>
<dt id="index-ostreamtube-3">: <em></em> <strong>ostreamtube</strong> <em>(&hellip;, <var>options</var>)</em></dt>
<dt id="index-ostreamtube-4">: <em></em> <strong>ostreamtube</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-ostreamtube-5">: <em><var>h</var> =</em> <strong>ostreamtube</strong> <em>(&hellip;)</em></dt>
<dd><p>Calculate and display streamtubes.
</p>
<p>Streamtubes are approximated by connecting circular crossflow areas
along a streamline.  The expansion of the flow is determined by the local
crossflow divergence.
</p>
<p>The vector field is given by <code>[<var>u</var>, <var>v</var>, <var>w</var>]</code> and is
defined over a rectangular grid given by <code>[<var>x</var>, <var>y</var>, <var>z</var>]</code>.
The streamtubes start at the seed points
<code>[<var>sx</var>, <var>sy</var>, <var>sz</var>]</code>.
</p>
<p>The tubes are colored based on the local vector field strength.
</p>
<p>The input parameter <var>options</var> is a 2-D vector of the form
<code>[<var>scale</var>, <var>n</var>]</code>.  The first parameter scales the start radius
of the streamtubes (default 1).  The second parameter specifies the number
of vertices that are used to construct the tube circumference (default 20).
</p>
<p><code>ostreamtube</code> can be called with a cell array containing pre-computed
streamline data.  To do this, <var>xyz</var> must be created with the
<code>stream3</code> function.  This option is useful if you need to alter the
integrator step size or the maximum number of vertices of the streamline.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the plot
objects created for each streamtube.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example">[x, y, z] = meshgrid (-1:0.1:1, -1:0.1:1, -3:0.1:0);
u = -x / 10 - y;
v = x - y / 10;
w = - ones (size (x)) / 10;
ostreamtube (x, y, z, u, v, w, 1, 0, 0);
</pre></div>


<p><strong>See also:</strong> <a href="#XREFstream3">stream3</a>, <a href="#XREFstreamline">streamline</a>, <a href="#XREFstreamtube">streamtube</a>.
</p></dd></dl>


<span id="XREFstreamline"></span><dl>
<dt id="index-streamline">: <em></em> <strong>streamline</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>, <var>u</var>, <var>v</var>, <var>w</var>, <var>sx</var>, <var>sy</var>, <var>sz</var>)</em></dt>
<dt id="index-streamline-1">: <em></em> <strong>streamline</strong> <em>(<var>u</var>, <var>v</var>, <var>w</var>, <var>sx</var>, <var>sy</var>, <var>sz</var>)</em></dt>
<dt id="index-streamline-2">: <em></em> <strong>streamline</strong> <em>(&hellip;, <var>options</var>)</em></dt>
<dt id="index-streamline-3">: <em></em> <strong>streamline</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-streamline-4">: <em><var>h</var> =</em> <strong>streamline</strong> <em>(&hellip;)</em></dt>
<dd><p>Plot streamlines of 2-D or 3-D vector fields.
</p>
<p>Plot streamlines of a 2-D or 3-D vector field given by
<code>[<var>u</var>, <var>v</var>]</code> or <code>[<var>u</var>, <var>v</var>, <var>w</var>]</code>.  The vector
field is defined over a rectangular grid given by <code>[<var>x</var>, <var>y</var>]</code>
or <code>[<var>x</var>, <var>y</var>, <var>z</var>]</code>.  The streamlines start at the seed
points <code>[<var>sx</var>, <var>sy</var>]</code> or <code>[<var>sx</var>, <var>sy</var>, <var>sz</var>]</code>.
</p>
<p>The input parameter <var>options</var> is a 2-D vector of the form
<code>[<var>stepsize</var>, <var>max_vertices</var>]</code>.  The first parameter
specifies the step size used for trajectory integration (default 0.1).  A
negative value is allowed which will reverse the direction of integration.
The second parameter specifies the maximum number of segments used to
create a streamline (default 10,000).
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the hggroup
comprising the field lines.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example">[x, y] = meshgrid (-1.5:0.2:2, -1:0.2:2);
u = - x / 4 - y;
v = x - y / 4;
streamline (x, y, u, v, 1.7, 1.5);
</pre></div>


<p><strong>See also:</strong> <a href="#XREFstream2">stream2</a>, <a href="#XREFstream3">stream3</a>, <a href="#XREFstreamtube">streamtube</a>, <a href="#XREFostreamtube">ostreamtube</a>.
</p></dd></dl>


<span id="XREFstream2"></span><dl>
<dt id="index-stream2">: <em><var>xy</var> =</em> <strong>stream2</strong> <em>(<var>x</var>, <var>y</var>, <var>u</var>, <var>v</var>, <var>sx</var>, <var>sy</var>)</em></dt>
<dt id="index-stream2-1">: <em><var>xy</var> =</em> <strong>stream2</strong> <em>(<var>u</var>, <var>v</var>, <var>sx</var>, <var>sy</var>)</em></dt>
<dt id="index-stream2-2">: <em><var>xy</var> =</em> <strong>stream2</strong> <em>(&hellip;, <var>options</var>)</em></dt>
<dd><p>Compute 2-D streamline data.
</p>
<p>Calculates streamlines of a vector field given by <code>[<var>u</var>, <var>v</var>]</code>.
The vector field is defined over a rectangular grid given by
<code>[<var>x</var>, <var>y</var>]</code>.  The streamlines start at the seed points
<code>[<var>sx</var>, <var>sy</var>]</code>.  The returned value <var>xy</var> contains a cell
array of vertex arrays.  If the starting point is outside the vector field,
<code>[]</code> is returned.
</p>
<p>The input parameter <var>options</var> is a 2-D vector of the form
<code>[<var>stepsize</var>, <var>max_vertices</var>]</code>.  The first parameter
specifies the step size used for trajectory integration (default 0.1).  A
negative value is allowed which will reverse the direction of integration.
The second parameter specifies the maximum number of segments used to
create a streamline (default 10,000).
</p>
<p>The return value <var>xy</var> is a nverts x 2 matrix containing the
coordinates of the field line segments.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example">[x, y] = meshgrid (0:3);
u = 2 * x;
v = y;
xy = stream2 (x, y, u, v, 1.0, 0.5);
</pre></div>


<p><strong>See also:</strong> <a href="#XREFstreamline">streamline</a>, <a href="#XREFstream3">stream3</a>.
</p></dd></dl>


<span id="XREFstream3"></span><dl>
<dt id="index-stream3">: <em><var>xyz</var> =</em> <strong>stream3</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>, <var>u</var>, <var>v</var>, <var>w</var>, <var>sx</var>, <var>sy</var>, <var>sz</var>)</em></dt>
<dt id="index-stream3-1">: <em><var>xyz</var> =</em> <strong>stream3</strong> <em>(<var>u</var>, <var>v</var>, <var>w</var>, <var>sx</var>, <var>sy</var>, <var>sz</var>)</em></dt>
<dt id="index-stream3-2">: <em><var>xyz</var> =</em> <strong>stream3</strong> <em>(&hellip;, <var>options</var>)</em></dt>
<dd><p>Compute 3-D streamline data.
</p>
<p>Calculate streamlines of a vector field given by <code>[<var>u</var>, <var>v</var>,
<var>w</var>]</code>.  The vector field is defined over a rectangular grid given by
<code>[<var>x</var>, <var>y</var>, <var>z</var>]</code>.  The streamlines start at the seed
points <code>[<var>sx</var>, <var>sy</var>, <var>sz</var>]</code>.  The returned value <var>xyz</var>
contains a cell array of vertex arrays.  If the starting point is outside
the vector field, <code>[]</code> is returned.
</p>
<p>The input parameter <var>options</var> is a 2-D vector of the form
<code>[<var>stepsize</var>, <var>max_vertices</var>]</code>.  The first parameter
specifies the step size used for trajectory integration (default 0.1).  A
negative value is allowed which will reverse the direction of integration.
The second parameter specifies the maximum number of segments used to
create a streamline (default 10,000).
</p>
<p>The return value <var>xyz</var> is a nverts x 3 matrix containing the
coordinates of the field line segments.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example">[x, y, z] = meshgrid (0:3);
u = 2 * x;
v = y;
w = 3 * z;
xyz = stream3 (x, y, z, u, v, w, 1.0, 0.5, 0.0);
</pre></div>


<p><strong>See also:</strong> <a href="#XREFstream2">stream2</a>, <a href="#XREFstreamline">streamline</a>, <a href="#XREFstreamtube">streamtube</a>, <a href="#XREFostreamtube">ostreamtube</a>.
</p></dd></dl>


<span id="XREFcompass"></span><dl>
<dt id="index-compass">: <em></em> <strong>compass</strong> <em>(<var>u</var>, <var>v</var>)</em></dt>
<dt id="index-compass-1">: <em></em> <strong>compass</strong> <em>(<var>z</var>)</em></dt>
<dt id="index-compass-2">: <em></em> <strong>compass</strong> <em>(&hellip;, <var>style</var>)</em></dt>
<dt id="index-compass-3">: <em></em> <strong>compass</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-compass-4">: <em><var>h</var> =</em> <strong>compass</strong> <em>(&hellip;)</em></dt>
<dd>
<p>Plot the <code>(<var>u</var>, <var>v</var>)</code> components of a vector field emanating
from the origin of a polar plot.
</p>
<p>The arrow representing each vector has one end at the origin and the tip at
[<var>u</var>(i), <var>v</var>(i)].  If a single complex argument <var>z</var> is given,
then <code><var>u</var> = real (<var>z</var>)</code> and <code><var>v</var> = imag (<var>z</var>)</code>.
</p>
<p>The style to use for the plot can be defined with a line style <var>style</var>
of the same format as the <code>plot</code> command.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a vector of graphics handles to the
line objects representing the drawn vectors.
</p>
<div class="example">
<pre class="example">a = toeplitz ([1;randn(9,1)], [1,randn(1,9)]);
compass (eig (a));
</pre></div>


<p><strong>See also:</strong> <a href="#XREFpolar">polar</a>, <a href="#XREFfeather">feather</a>, <a href="#XREFquiver">quiver</a>, <a href="#XREFrose">rose</a>, <a href="#XREFplot">plot</a>.
</p></dd></dl>


<span id="XREFfeather"></span><dl>
<dt id="index-feather">: <em></em> <strong>feather</strong> <em>(<var>u</var>, <var>v</var>)</em></dt>
<dt id="index-feather-1">: <em></em> <strong>feather</strong> <em>(<var>z</var>)</em></dt>
<dt id="index-feather-2">: <em></em> <strong>feather</strong> <em>(&hellip;, <var>style</var>)</em></dt>
<dt id="index-feather-3">: <em></em> <strong>feather</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-feather-4">: <em><var>h</var> =</em> <strong>feather</strong> <em>(&hellip;)</em></dt>
<dd>
<p>Plot the <code>(<var>u</var>, <var>v</var>)</code> components of a vector field emanating
from equidistant points on the x-axis.
</p>
<p>If a single complex argument <var>z</var> is given, then
<code><var>u</var> = real (<var>z</var>)</code> and <code><var>v</var> = imag (<var>z</var>)</code>.
</p>
<p>The style to use for the plot can be defined with a line style <var>style</var>
of the same format as the <code>plot</code> command.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a vector of graphics handles to the
line objects representing the drawn vectors.
</p>
<div class="example">
<pre class="example">phi = [0 : 15 : 360] * pi/180;
feather (sin (phi), cos (phi));
</pre></div>


<p><strong>See also:</strong> <a href="#XREFplot">plot</a>, <a href="#XREFquiver">quiver</a>, <a href="#XREFcompass">compass</a>.
</p></dd></dl>


<span id="XREFpcolor"></span><dl>
<dt id="index-pcolor">: <em></em> <strong>pcolor</strong> <em>(<var>x</var>, <var>y</var>, <var>c</var>)</em></dt>
<dt id="index-pcolor-1">: <em></em> <strong>pcolor</strong> <em>(<var>c</var>)</em></dt>
<dt id="index-pcolor-2">: <em></em> <strong>pcolor</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-pcolor-3">: <em><var>h</var> =</em> <strong>pcolor</strong> <em>(&hellip;)</em></dt>
<dd><p>Produce a 2-D density plot.
</p>
<p>A <code>pcolor</code> plot draws rectangles with colors from the matrix <var>c</var>
over the two-dimensional region represented by the matrices <var>x</var> and
<var>y</var>.  <var>x</var> and <var>y</var> are the coordinates of the mesh&rsquo;s vertices
and are typically the output of <code>meshgrid</code>.  If <var>x</var> and <var>y</var> are
vectors, then a typical vertex is (<var>x</var>(j), <var>y</var>(i), <var>c</var>(i,j)).
Thus, columns of <var>c</var> correspond to different <var>x</var> values and rows
of <var>c</var> correspond to different <var>y</var> values.
</p>
<p>The values in <var>c</var> are scaled to span the range of the current
colormap.  Limits may be placed on the color axis by the command
<code>caxis</code>, or by setting the <code>clim</code> property of the parent axis.
</p>
<p>The face color of each cell of the mesh is determined by interpolating
the values of <var>c</var> for each of the cell&rsquo;s vertices; Contrast this with
<code>imagesc</code> which renders one cell for each element of <var>c</var>.
</p>
<p><code>shading</code> modifies an attribute determining the manner by which the
face color of each cell is interpolated from the values of <var>c</var>,
and the visibility of the cells&rsquo; edges.  By default the attribute is
<code>&quot;faceted&quot;</code>, which renders a single color for each cell&rsquo;s face with
the edge visible.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the created
surface object.
</p>

<p><strong>See also:</strong> <a href="Axis-Configuration.html#XREFcaxis">caxis</a>, <a href="Three_002dDimensional-Plots.html#XREFshading">shading</a>, <a href="Three_002dDimensional-Plots.html#XREFmeshgrid">meshgrid</a>, <a href="#XREFcontour">contour</a>, <a href="Displaying-Images.html#XREFimagesc">imagesc</a>.
</p></dd></dl>


<span id="XREFarea"></span><dl>
<dt id="index-area">: <em></em> <strong>area</strong> <em>(<var>y</var>)</em></dt>
<dt id="index-area-1">: <em></em> <strong>area</strong> <em>(<var>x</var>, <var>y</var>)</em></dt>
<dt id="index-area-2">: <em></em> <strong>area</strong> <em>(&hellip;, <var>lvl</var>)</em></dt>
<dt id="index-area-3">: <em></em> <strong>area</strong> <em>(&hellip;, <var>prop</var>, <var>val</var>, &hellip;)</em></dt>
<dt id="index-area-4">: <em></em> <strong>area</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-area-5">: <em><var>h</var> =</em> <strong>area</strong> <em>(&hellip;)</em></dt>
<dd><p>Area plot of the columns of <var>y</var>.
</p>
<p>This plot shows the contributions of each column value to the row sum.
It is functionally similar to <code>plot (<var>x</var>, cumsum (<var>y</var>, 2))</code>,
except that the area under the curve is shaded.
</p>
<p>If the <var>x</var> argument is omitted it defaults to <code>1:rows (<var>y</var>)</code>.
A value <var>lvl</var> can be defined that determines where the base level of
the shading under the curve should be defined.  The default level is 0.
</p>
<p>Additional property/value pairs are passed directly to the underlying patch
object. The full list of properties is documented at
<a href="Patch-Properties.html">Patch Properties</a>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a graphics handle to the hggroup
object comprising the area patch objects.  The <code>&quot;BaseValue&quot;</code> property
of the hggroup can be used to adjust the level where shading begins.
</p>
<p>Example: Verify identity sin^2 + cos^2 = 1
</p>
<div class="example">
<pre class="example">t = linspace (0, 2*pi, 100)';
y = [sin(t).^2, cos(t).^2];
area (t, y);
legend (&quot;sin^2&quot;, &quot;cos^2&quot;, &quot;location&quot;, &quot;NorthEastOutside&quot;);
</pre></div>

<p><strong>See also:</strong> <a href="#XREFplot">plot</a>, <a href="Graphics-Objects.html#XREFpatch">patch</a>.
</p></dd></dl>


<span id="XREFfill"></span><dl>
<dt id="index-fill">: <em></em> <strong>fill</strong> <em>(<var>x</var>, <var>y</var>, <var>c</var>)</em></dt>
<dt id="index-fill-1">: <em></em> <strong>fill</strong> <em>(<var>x1</var>, <var>y1</var>, <var>c1</var>, <var>x2</var>, <var>y2</var>, <var>c2</var>)</em></dt>
<dt id="index-fill-2">: <em></em> <strong>fill</strong> <em>(&hellip;, <var>prop</var>, <var>val</var>)</em></dt>
<dt id="index-fill-3">: <em></em> <strong>fill</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dt id="index-fill-4">: <em><var>h</var> =</em> <strong>fill</strong> <em>(&hellip;)</em></dt>
<dd><p>Create one or more filled 2-D polygons.
</p>
<p>The inputs <var>x</var> and <var>y</var> are the coordinates of the polygon vertices.
If the inputs are matrices then the rows represent different vertices and
each column produces a different polygon.  <code>fill</code> will close any open
polygons before plotting.
</p>
<p>The input <var>c</var> determines the color of the polygon.  The simplest form
is a single color specification such as a <code>plot</code> format or an
RGB-triple.  In this case the polygon(s) will have one unique color.  If
<var>c</var> is a vector or matrix then the color data is first scaled using
<code>caxis</code> and then indexed into the current colormap.  A row vector will
color each polygon (a column from matrices <var>x</var> and <var>y</var>) with a
single computed color.  A matrix <var>c</var> of the same size as <var>x</var> and
<var>y</var> will compute the color of each vertex and then interpolate the face
color between the vertices.
</p>
<p>Multiple property/value pairs for the underlying patch object may be
specified, but they must appear in pairs.  The full list of properties is
documented at <a href="Patch-Properties.html">Patch Properties</a>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p>The optional return value <var>h</var> is a vector of graphics handles to
the created patch objects.
</p>
<p>Example: red square
</p>
<div class="example">
<pre class="example">vertices = [0 0
            1 0
            1 1
            0 1];
fill (vertices(:,1), vertices(:,2), &quot;r&quot;);
axis ([-0.5 1.5, -0.5 1.5])
axis equal
</pre></div>


<p><strong>See also:</strong> <a href="Graphics-Objects.html#XREFpatch">patch</a>, <a href="Axis-Configuration.html#XREFcaxis">caxis</a>, <a href="Representing-Images.html#XREFcolormap">colormap</a>.
</p></dd></dl>


<span id="XREFcomet"></span><dl>
<dt id="index-comet">: <em></em> <strong>comet</strong> <em>(<var>y</var>)</em></dt>
<dt id="index-comet-1">: <em></em> <strong>comet</strong> <em>(<var>x</var>, <var>y</var>)</em></dt>
<dt id="index-comet-2">: <em></em> <strong>comet</strong> <em>(<var>x</var>, <var>y</var>, <var>p</var>)</em></dt>
<dt id="index-comet-3">: <em></em> <strong>comet</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dd><p>Produce a simple comet style animation along the trajectory provided by
the input coordinate vectors (<var>x</var>, <var>y</var>).
</p>
<p>If <var>x</var> is not specified it defaults to the indices of <var>y</var>.
</p>
<p>The speed of the comet may be controlled by <var>p</var>, which represents the
time each point is displayed before moving to the next one.  The default for
<var>p</var> is <code>5 / numel (<var>y</var>)</code>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p><strong>See also:</strong> <a href="#XREFcomet3">comet3</a>.
</p></dd></dl>


<span id="XREFcomet3"></span><dl>
<dt id="index-comet3">: <em></em> <strong>comet3</strong> <em>(<var>z</var>)</em></dt>
<dt id="index-comet3-1">: <em></em> <strong>comet3</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>)</em></dt>
<dt id="index-comet3-2">: <em></em> <strong>comet3</strong> <em>(<var>x</var>, <var>y</var>, <var>z</var>, <var>p</var>)</em></dt>
<dt id="index-comet3-3">: <em></em> <strong>comet3</strong> <em>(<var>hax</var>, &hellip;)</em></dt>
<dd><p>Produce a simple comet style animation along the trajectory provided by
the input coordinate vectors (<var>x</var>, <var>y</var>, <var>z</var>).
</p>
<p>If only <var>z</var> is specified then <var>x</var>, <var>y</var> default to the indices
of <var>z</var>.
</p>
<p>The speed of the comet may be controlled by <var>p</var>, which represents the
time each point is displayed before moving to the next one.  The default for
<var>p</var> is <code>5 / numel (<var>z</var>)</code>.
</p>
<p>If the first argument <var>hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code>gca</code>.
</p>
<p><strong>See also:</strong> <a href="#XREFcomet">comet</a>.
</p></dd></dl>


<hr>
<div class="header">
<p>
Next: <a href="Three_002dDimensional-Plots.html" accesskey="n" rel="next">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>



</body>
</html>