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 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461
|
<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Two-Dimensional Plots (GNU Octave (version 10.3.0))</title>
<meta name="description" content="Two-Dimensional Plots (GNU Octave (version 10.3.0))">
<meta name="keywords" content="Two-Dimensional Plots (GNU Octave (version 10.3.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="High_002dLevel-Plotting.html" rel="up" title="High-Level Plotting">
<link href="Three_002dDimensional-Plots.html" rel="next" title="Three-Dimensional Plots">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.center {text-align:center}
div.example {margin-left: 3.2em}
span:hover a.copiable-link {visibility: visible}
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
ul.mark-bullet {list-style-type: disc}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">
</head>
<body lang="en">
<div class="subsection-level-extent" id="Two_002dDimensional-Plots">
<div class="nav-panel">
<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> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Two_002dDimensional-Plots-1"><span>15.2.1 Two-Dimensional Plots<a class="copiable-link" href="#Two_002dDimensional-Plots-1"> ¶</a></span></h4>
<p>The <code class="code">plot</code> function allows you to create simple x-y plots with
linear axes. For example,
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">x = -10:0.1:10;
plot (x, sin (x));
xlabel ("x");
ylabel ("sin (x)");
title ("Simple 2-D Plot");
</pre></div></div>
<p>displays a sine wave shown in <a class="ref" 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" id="fig_003aplot">
<div class="center"><img class="image" src="plot.png" alt="plot">
</div><div class="caption"><p><strong class="strong">Figure 15.1: </strong>Simple Two-Dimensional Plot.</p></div></div>
<a class="anchor" id="XREFplot"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-plot"><span><strong class="def-name">plot</strong> <code class="def-code-arguments">(<var class="var">y</var>)</code><a class="copiable-link" href="#index-plot"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plot-1"><span><strong class="def-name">plot</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-plot-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plot-2"><span><strong class="def-name">plot</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-plot-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plot-3"><span><strong class="def-name">plot</strong> <code class="def-code-arguments">(…, <var class="var">property</var>, <var class="var">value</var>, …)</code><a class="copiable-link" href="#index-plot-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plot-4"><span><strong class="def-name">plot</strong> <code class="def-code-arguments">(<var class="var">x1</var>, <var class="var">y1</var>, …, <var class="var">xn</var>, <var class="var">yn</var>)</code><a class="copiable-link" href="#index-plot-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plot-5"><span><strong class="def-name">plot</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-plot-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plot-6"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">plot</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-plot-6"> ¶</a></span></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-preformatted">plot (<var class="var">y</var>)
</pre></div>
<p>where the argument is taken as the set of <var class="var">y</var> coordinates and the
<var class="var">x</var> coordinates are taken to be the range <code class="code">1:numel (<var class="var">y</var>)</code>.
</p>
<p>If more than one argument is given, they are interpreted as
</p>
<div class="example">
<pre class="example-preformatted">plot (<var class="var">y</var>, <var class="var">property</var>, <var class="var">value</var>, ...)
</pre></div>
<p>or
</p>
<div class="example">
<pre class="example-preformatted">plot (<var class="var">x</var>, <var class="var">y</var>, <var class="var">property</var>, <var class="var">value</var>, ...)
</pre></div>
<p>or
</p>
<div class="example">
<pre class="example-preformatted">plot (<var class="var">x</var>, <var class="var">y</var>, <var class="var">fmt</var>, ...)
</pre></div>
<p>and so on. Any number of argument sets may appear. The <var class="var">x</var> and
<var class="var">y</var> values are interpreted as follows:
</p>
<ul class="itemize mark-bullet">
<li>If a single data argument is supplied, it is taken as the set of <var class="var">y</var>
coordinates and the <var class="var">x</var> coordinates are taken to be the indices of
the elements, starting with 1.
</li><li>If <var class="var">x</var> and <var class="var">y</var> are scalars, a single point is plotted.
</li><li><code class="code">squeeze()</code> is applied to arguments with more than two dimensions,
but no more than two singleton dimensions.
</li><li>If either <var class="var">x</var> or <var class="var">y</var> is a scalar and the other is a vector, a
series of points are plotted at the coordinates defined by the scalar and
each element of the vector.
</li><li>If both arguments are vectors, the elements of <var class="var">y</var> are plotted versus
the elements of <var class="var">x</var>.
</li><li>If <var class="var">x</var> is a vector and <var class="var">y</var> is a matrix, then
the columns (or rows) of <var class="var">y</var> are plotted versus <var class="var">x</var>.
(using whichever combination matches, with columns tried first.)
</li><li>If the <var class="var">x</var> is a matrix and <var class="var">y</var> is a vector,
<var class="var">y</var> is plotted versus the columns (or rows) of <var class="var">x</var>.
(using whichever combination matches, with columns tried first.)
</li><li>If both arguments are matrices, the columns of <var class="var">y</var> are plotted
versus the columns of <var class="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 class="code">plot</code>. Useful properties to modify are <code class="code">"linestyle"</code>,
<code class="code">"linewidth"</code>, <code class="code">"color"</code>, <code class="code">"marker"</code>,
<code class="code">"markersize"</code>, <code class="code">"markeredgecolor"</code>, <code class="code">"markerfacecolor"</code>.
The full list of properties is documented at
<a class="ref" href="Line-Properties.html">Line Properties</a>.
</p>
<p>The <var class="var">fmt</var> format argument can also be used to control the plot style.
It is a string composed of four optional parts:
"<linestyle><marker><color><;displayname;>".
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 class="var">fmt</var> and no <var class="var">property</var>/<var class="var">value</var> pairs are
given, then the default plot style is solid lines with no markers and the
color determined by the <code class="code">"colororder"</code> property of the current axes.
</p>
<p>Format arguments:
</p>
<dl class="table">
<dt>linestyle</dt>
<dd>
<table class="multitable">
<tbody><tr><td width="6%">‘<samp class="samp">-</samp>’</td><td width="94%">Use solid lines (default).</td></tr>
<tr><td width="6%">‘<samp class="samp">--</samp>’</td><td width="94%">Use dashed lines.</td></tr>
<tr><td width="6%">‘<samp class="samp">:</samp>’</td><td width="94%">Use dotted lines.</td></tr>
<tr><td width="6%">‘<samp class="samp">-.</samp>’</td><td width="94%">Use dash-dotted lines.</td></tr>
</tbody>
</table>
</dd>
<dt>marker</dt>
<dd>
<table class="multitable">
<tbody><tr><td width="6%">‘<samp class="samp">+</samp>’</td><td width="94%">crosshair</td></tr>
<tr><td width="6%">‘<samp class="samp">o</samp>’</td><td width="94%">circle</td></tr>
<tr><td width="6%">‘<samp class="samp">*</samp>’</td><td width="94%">star</td></tr>
<tr><td width="6%">‘<samp class="samp">.</samp>’</td><td width="94%">point</td></tr>
<tr><td width="6%">‘<samp class="samp">x</samp>’</td><td width="94%">cross</td></tr>
<tr><td width="6%">‘<samp class="samp">|</samp>’</td><td width="94%">vertical line</td></tr>
<tr><td width="6%">‘<samp class="samp">_</samp>’</td><td width="94%">horizontal line</td></tr>
<tr><td width="6%">‘<samp class="samp">s</samp>’</td><td width="94%">square</td></tr>
<tr><td width="6%">‘<samp class="samp">d</samp>’</td><td width="94%">diamond</td></tr>
<tr><td width="6%">‘<samp class="samp">^</samp>’</td><td width="94%">upward-facing triangle</td></tr>
<tr><td width="6%">‘<samp class="samp">v</samp>’</td><td width="94%">downward-facing triangle</td></tr>
<tr><td width="6%">‘<samp class="samp">></samp>’</td><td width="94%">right-facing triangle</td></tr>
<tr><td width="6%">‘<samp class="samp"><</samp>’</td><td width="94%">left-facing triangle</td></tr>
<tr><td width="6%">‘<samp class="samp">p</samp>’</td><td width="94%">pentagram</td></tr>
<tr><td width="6%">‘<samp class="samp">h</samp>’</td><td width="94%">hexagram</td></tr>
</tbody>
</table>
</dd>
<dt>color</dt>
<dd>
<table class="multitable">
<tbody><tr><td width="21%">‘<samp class="samp">k</samp>’, <code class="code">"black"</code></td><td width="79%">blacK</td></tr>
<tr><td width="21%">‘<samp class="samp">r</samp>’, <code class="code">"red"</code></td><td width="79%">Red</td></tr>
<tr><td width="21%">‘<samp class="samp">g</samp>’, <code class="code">"green"</code></td><td width="79%">Green</td></tr>
<tr><td width="21%">‘<samp class="samp">b</samp>’, <code class="code">"blue"</code></td><td width="79%">Blue</td></tr>
<tr><td width="21%">‘<samp class="samp">y</samp>’, <code class="code">"yellow"</code></td><td width="79%">Yellow</td></tr>
<tr><td width="21%">‘<samp class="samp">m</samp>’, <code class="code">"magenta"</code></td><td width="79%">Magenta</td></tr>
<tr><td width="21%">‘<samp class="samp">c</samp>’, <code class="code">"cyan"</code></td><td width="79%">Cyan</td></tr>
<tr><td width="21%">‘<samp class="samp">w</samp>’, <code class="code">"white"</code></td><td width="79%">White</td></tr>
</tbody>
</table>
</dd>
<dt><code class="code">";displayname;"</code></dt>
<dd><p>The text between semicolons is used to set the <code class="code">"displayname"</code>
property which determines the label used for the plot legend.
</p>
</dd>
</dl>
<p>The <var class="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 class="code">"+b;Data Series 3;"</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-preformatted">plot (x, y, "or", x, y2, x, y3, "m", x, y4, "+")
</pre></div>
<p>This command will plot <code class="code">y</code> with red circles, <code class="code">y2</code> with solid
lines, <code class="code">y3</code> with solid magenta lines, and <code class="code">y4</code> with points
displayed as ‘<samp class="samp">+</samp>’.
</p>
<div class="example">
<pre class="example-preformatted">plot (b, "*", "markersize", 10)
</pre></div>
<p>This command will plot the data in the variable <code class="code">b</code>,
with points displayed as ‘<samp class="samp">*</samp>’ and a marker size of 10.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">t = 0:0.1:6.3;
plot (t, cos(t), "-;cos(t);", t, sin(t), "-b;sin(t);");
</pre></div></div>
<p>This will plot the cosine and sine functions and label them accordingly
in the legend.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a vector of graphics handles to
the created line objects.
</p>
<p>To save a plot, in one of several image formats such as PostScript
or PNG, use the <code class="code">print</code> command.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="Axis-Configuration.html#XREFaxis">axis</a>, <a class="ref" href="Plot-Annotations.html#XREFbox">box</a>, <a class="ref" href="Plot-Annotations.html#XREFgrid">grid</a>, <a class="ref" href="Manipulation-of-Plot-Windows.html#XREFhold">hold</a>, <a class="ref" href="Plot-Annotations.html#XREFlegend">legend</a>, <a class="ref" href="Plot-Annotations.html#XREFtitle">title</a>, <a class="ref" href="Plot-Annotations.html#XREFxlabel">xlabel</a>, <a class="ref" href="Plot-Annotations.html#XREFylabel">ylabel</a>, <a class="ref" href="Axis-Configuration.html#XREFxlim">xlim</a>, <a class="ref" href="Axis-Configuration.html#XREFylim">ylim</a>, <a class="ref" href="Two_002ddimensional-Function-Plotting.html#XREFezplot">ezplot</a>, <a class="ref" href="#XREFerrorbar">errorbar</a>, <a class="ref" href="Two_002ddimensional-Function-Plotting.html#XREFfplot">fplot</a>, <a class="ref" href="Creating-Graphics-Objects.html#XREFline">line</a>, <a class="ref" href="Three_002dDimensional-Plots.html#XREFplot3">plot3</a>, <a class="ref" href="#XREFpolar">polar</a>, <a class="ref" href="#XREFloglog">loglog</a>, <a class="ref" href="#XREFsemilogx">semilogx</a>, <a class="ref" href="#XREFsemilogy">semilogy</a>, <a class="ref" href="Multiple-Plots-on-One-Page.html#XREFsubplot">subplot</a>.
</p></dd></dl>
<p>The <code class="code">plotyy</code> function may be used to create a plot with two
independent y axes.
</p>
<a class="anchor" id="XREFplotyy"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-plotyy"><span><strong class="def-name">plotyy</strong> <code class="def-code-arguments">(<var class="var">x1</var>, <var class="var">y1</var>, <var class="var">x2</var>, <var class="var">y2</var>)</code><a class="copiable-link" href="#index-plotyy"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plotyy-1"><span><strong class="def-name">plotyy</strong> <code class="def-code-arguments">(…, <var class="var">fcn</var>)</code><a class="copiable-link" href="#index-plotyy-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plotyy-2"><span><strong class="def-name">plotyy</strong> <code class="def-code-arguments">(…, <var class="var">fun1</var>, <var class="var">fun2</var>)</code><a class="copiable-link" href="#index-plotyy-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plotyy-3"><span><strong class="def-name">plotyy</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-plotyy-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plotyy-4"><span><code class="def-type">[<var class="var">ax</var>, <var class="var">h1</var>, <var class="var">h2</var>] =</code> <strong class="def-name">plotyy</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-plotyy-4"> ¶</a></span></dt>
<dd><p>Plot two sets of data with independent y-axes and a common x-axis.
</p>
<p>The arguments <var class="var">x1</var> and <var class="var">y1</var> define the arguments for the first plot
and <var class="var">x1</var> and <var class="var">y2</var> for the second.
</p>
<p>By default the arguments are evaluated with
<code class="code">feval (@plot, <var class="var">x</var>, <var class="var">y</var>)</code>. However the type of plot can be
modified with the <var class="var">fcn</var> argument, in which case the plots are
generated by <code class="code">feval (<var class="var">fcn</var>, <var class="var">x</var>, <var class="var">y</var>)</code>. <var class="var">fcn</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 class="var">fun1</var> and <var class="var">fun2</var>.
</p>
<p>The first argument <var class="var">hax</var> can be an axes handle to the principal axes in
which to plot the <var class="var">x1</var> and <var class="var">y1</var> data. It can also be a two-element
vector with the axes handles to the primary and secondary axes (see output
<var class="var">ax</var>).
</p>
<p>The return value <var class="var">ax</var> is a vector with the axes handles of the two
y-axes. <var class="var">h1</var> and <var class="var">h2</var> are handles to the objects generated by the
plot commands.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">x = 0:0.1:2*pi;
y1 = sin (x);
y2 = exp (x - 1);
ax = plotyy (x, y1, x - 1, y2, @plot, @semilogy);
xlabel ("X");
ylabel (ax(1), "Axis 1");
ylabel (ax(2), "Axis 2");
</pre></div></div>
<p>When using <code class="code">plotyy</code> in conjunction with <code class="code">subplot</code> make sure to
call <code class="code">subplot</code> first and pass the resulting axes handle to
<code class="code">plotyy</code>. Do not call <code class="code">subplot</code> with any of the axes handles
returned by <code class="code">plotyy</code> or the other axes will be removed.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFplot">plot</a>, <a class="ref" href="Multiple-Plots-on-One-Page.html#XREFsubplot">subplot</a>.
</p></dd></dl>
<p>The functions <code class="code">semilogx</code>, <code class="code">semilogy</code>, and <code class="code">loglog</code> are
similar to the <code class="code">plot</code> function, but produce plots in which one or
both of the axes use log scales.
</p>
<a class="anchor" id="XREFsemilogx"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-semilogx"><span><strong class="def-name">semilogx</strong> <code class="def-code-arguments">(<var class="var">y</var>)</code><a class="copiable-link" href="#index-semilogx"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogx-1"><span><strong class="def-name">semilogx</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-semilogx-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogx-2"><span><strong class="def-name">semilogx</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">property</var>, <var class="var">value</var>, …)</code><a class="copiable-link" href="#index-semilogx-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogx-3"><span><strong class="def-name">semilogx</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-semilogx-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogx-4"><span><strong class="def-name">semilogx</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-semilogx-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogx-5"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">semilogx</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-semilogx-5"> ¶</a></span></dt>
<dd><p>Produce a 2-D plot using a logarithmic scale for the x-axis.
</p>
<p>See the documentation of <code class="code">plot</code> for a description of the
arguments that <code class="code">semilogx</code> will accept.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the created plot.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFplot">plot</a>, <a class="ref" href="#XREFsemilogy">semilogy</a>, <a class="ref" href="#XREFloglog">loglog</a>.
</p></dd></dl>
<a class="anchor" id="XREFsemilogy"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-semilogy"><span><strong class="def-name">semilogy</strong> <code class="def-code-arguments">(<var class="var">y</var>)</code><a class="copiable-link" href="#index-semilogy"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogy-1"><span><strong class="def-name">semilogy</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-semilogy-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogy-2"><span><strong class="def-name">semilogy</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">property</var>, <var class="var">value</var>, …)</code><a class="copiable-link" href="#index-semilogy-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogy-3"><span><strong class="def-name">semilogy</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-semilogy-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogy-4"><span><strong class="def-name">semilogy</strong> <code class="def-code-arguments">(<var class="var">h</var>, …)</code><a class="copiable-link" href="#index-semilogy-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogy-5"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">semilogy</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-semilogy-5"> ¶</a></span></dt>
<dd><p>Produce a 2-D plot using a logarithmic scale for the y-axis.
</p>
<p>See the documentation of <code class="code">plot</code> for a description of the
arguments that <code class="code">semilogy</code> will accept.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the created plot.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFplot">plot</a>, <a class="ref" href="#XREFsemilogx">semilogx</a>, <a class="ref" href="#XREFloglog">loglog</a>.
</p></dd></dl>
<a class="anchor" id="XREFloglog"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-loglog"><span><strong class="def-name">loglog</strong> <code class="def-code-arguments">(<var class="var">y</var>)</code><a class="copiable-link" href="#index-loglog"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglog-1"><span><strong class="def-name">loglog</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-loglog-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglog-2"><span><strong class="def-name">loglog</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">prop</var>, <var class="var">value</var>, …)</code><a class="copiable-link" href="#index-loglog-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglog-3"><span><strong class="def-name">loglog</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-loglog-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglog-4"><span><strong class="def-name">loglog</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-loglog-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglog-5"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">loglog</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-loglog-5"> ¶</a></span></dt>
<dd><p>Produce a 2-D plot using logarithmic scales for both axes.
</p>
<p>See the documentation of <code class="code">plot</code> for a description of the arguments
that <code class="code">loglog</code> will accept.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the created plot.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFplot">plot</a>, <a class="ref" href="#XREFsemilogx">semilogx</a>, <a class="ref" href="#XREFsemilogy">semilogy</a>.
</p></dd></dl>
<p>The functions <code class="code">bar</code>, <code class="code">barh</code>, <code class="code">stairs</code>, and <code class="code">stem</code>
are useful for displaying discrete data. For example,
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">randn ("state", 1);
hist (randn (10000, 1), 30);
xlabel ("Value");
ylabel ("Count");
title ("Histogram of 10,000 normally distributed random numbers");
</pre></div></div>
<p>produces the histogram of 10,000 normally distributed random numbers
shown in <a class="ref" href="#fig_003ahist">Figure 15.2</a>. Note that, <code class="code">randn ("state", 1);</code>, initializes
the random number generator for <code class="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" id="fig_003ahist">
<div class="center"><img class="image" src="hist.png" alt="hist">
</div><div class="caption"><p><strong class="strong">Figure 15.2: </strong>Histogram.</p></div></div>
<a class="anchor" id="XREFbar"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-bar"><span><strong class="def-name">bar</strong> <code class="def-code-arguments">(<var class="var">y</var>)</code><a class="copiable-link" href="#index-bar"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-bar-1"><span><strong class="def-name">bar</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-bar-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-bar-2"><span><strong class="def-name">bar</strong> <code class="def-code-arguments">(…, <var class="var">w</var>)</code><a class="copiable-link" href="#index-bar-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-bar-3"><span><strong class="def-name">bar</strong> <code class="def-code-arguments">(…, <var class="var">style</var>)</code><a class="copiable-link" href="#index-bar-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-bar-4"><span><strong class="def-name">bar</strong> <code class="def-code-arguments">(…, <var class="var">prop</var>, <var class="var">val</var>, …)</code><a class="copiable-link" href="#index-bar-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-bar-5"><span><strong class="def-name">bar</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-bar-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-bar-6"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">bar</strong> <code class="def-code-arguments">(…, <var class="var">prop</var>, <var class="var">val</var>, …)</code><a class="copiable-link" href="#index-bar-6"> ¶</a></span></dt>
<dd><p>Produce a bar graph from two vectors of X-Y data.
</p>
<p>If only one argument is given, <var class="var">y</var>, it is taken as a vector of Y values
and the X coordinates are the range <code class="code">1:numel (<var class="var">y</var>)</code>.
</p>
<p>The optional input <var class="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 class="var">y</var> is a matrix, then each column of <var class="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 class="var">style</var>
argument which can take the following values:
</p>
<dl class="table">
<dt><code class="code">"grouped"</code> (default)</dt>
<dd><p>Side-by-side bars with a gap between bars and centered over the
X-coordinate.
</p>
</dd>
<dt><code class="code">"stacked"</code></dt>
<dd><p>Bars are stacked so that each X value has a single bar composed of
multiple segments.
</p>
</dd>
<dt><code class="code">"hist"</code></dt>
<dd><p>Side-by-side bars with no gap between bars and centered over the
X-coordinate.
</p>
</dd>
<dt><code class="code">"histc"</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 class="ref" href="Patch-Properties.html">Patch Properties</a>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a vector of handles to the created
"bar series" hggroups with one handle per column of the variable <var class="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 "bar series".
For example,
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">h = bar (rand (5, 10));
set (h(1), "basevalue", 0.5);
</pre></div></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-preformatted">bar (randn (1, 100), "facecolor", "r", "edgecolor", "b");
</pre></div>
<p>The default color for bars is taken from the axes’ <code class="code">"ColorOrder"</code>
property. The default color for bars when a histogram option
(<code class="code">"hist"</code>, <code class="code">"histc"</code> is used is the <code class="code">"Colormap"</code> property
of either the axes or figure. The color of bars can also be set manually
using the <code class="code">"facecolor"</code> property as shown below.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">h = bar (rand (10, 3));
set (h(1), "facecolor", "r")
set (h(2), "facecolor", "g")
set (h(3), "facecolor", "b")
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFbarh">barh</a>, <a class="ref" href="#XREFhist">hist</a>, <a class="ref" href="#XREFpie">pie</a>, <a class="ref" href="#XREFplot">plot</a>, <a class="ref" href="Creating-Graphics-Objects.html#XREFpatch">patch</a>.
</p></dd></dl>
<a class="anchor" id="XREFbarh"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-barh"><span><strong class="def-name">barh</strong> <code class="def-code-arguments">(<var class="var">y</var>)</code><a class="copiable-link" href="#index-barh"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-barh-1"><span><strong class="def-name">barh</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-barh-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-barh-2"><span><strong class="def-name">barh</strong> <code class="def-code-arguments">(…, <var class="var">w</var>)</code><a class="copiable-link" href="#index-barh-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-barh-3"><span><strong class="def-name">barh</strong> <code class="def-code-arguments">(…, <var class="var">style</var>)</code><a class="copiable-link" href="#index-barh-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-barh-4"><span><strong class="def-name">barh</strong> <code class="def-code-arguments">(…, <var class="var">prop</var>, <var class="var">val</var>, …)</code><a class="copiable-link" href="#index-barh-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-barh-5"><span><strong class="def-name">barh</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-barh-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-barh-6"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">barh</strong> <code class="def-code-arguments">(…, <var class="var">prop</var>, <var class="var">val</var>, …)</code><a class="copiable-link" href="#index-barh-6"> ¶</a></span></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 class="code">1:numel (<var class="var">y</var>)</code>.
</p>
<p>The optional input <var class="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 class="var">y</var> is a matrix, then each column of <var class="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 class="var">style</var>
argument which can take the following values:
</p>
<dl class="table">
<dt><code class="code">"grouped"</code> (default)</dt>
<dd><p>Side-by-side bars with a gap between bars and centered over the
Y-coordinate.
</p>
</dd>
<dt><code class="code">"stacked"</code></dt>
<dd><p>Bars are stacked so that each Y value has a single bar composed of
multiple segments.
</p>
</dd>
<dt><code class="code">"hist"</code></dt>
<dd><p>Side-by-side bars with no gap between bars and centered over the
Y-coordinate.
</p>
</dd>
<dt><code class="code">"histc"</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 class="ref" href="Patch-Properties.html">Patch Properties</a>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the created
bar series hggroup. For a description of the use of the
bar series, see <a class="pxref" href="#XREFbar"><code class="code">bar</code></a>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFbar">bar</a>, <a class="ref" href="#XREFhist">hist</a>, <a class="ref" href="#XREFpie">pie</a>, <a class="ref" href="#XREFplot">plot</a>, <a class="ref" href="Creating-Graphics-Objects.html#XREFpatch">patch</a>.
</p></dd></dl>
<a class="anchor" id="XREFhist"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-hist"><span><strong class="def-name">hist</strong> <code class="def-code-arguments">(<var class="var">y</var>)</code><a class="copiable-link" href="#index-hist"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-hist-1"><span><strong class="def-name">hist</strong> <code class="def-code-arguments">(<var class="var">y</var>, <var class="var">nbins</var>)</code><a class="copiable-link" href="#index-hist-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-hist-2"><span><strong class="def-name">hist</strong> <code class="def-code-arguments">(<var class="var">y</var>, <var class="var">x</var>)</code><a class="copiable-link" href="#index-hist-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-hist-3"><span><strong class="def-name">hist</strong> <code class="def-code-arguments">(<var class="var">y</var>, <var class="var">x</var>, <var class="var">norm</var>)</code><a class="copiable-link" href="#index-hist-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-hist-4"><span><strong class="def-name">hist</strong> <code class="def-code-arguments">(…, <var class="var">prop</var>, <var class="var">val</var>, …)</code><a class="copiable-link" href="#index-hist-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-hist-5"><span><strong class="def-name">hist</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-hist-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-hist-6"><span><code class="def-type">[<var class="var">nn</var>, <var class="var">xx</var>] =</code> <strong class="def-name">hist</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-hist-6"> ¶</a></span></dt>
<dd><p>Produce histogram counts or plots.
</p>
<p>With one vector input argument, <var class="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 class="var">y</var>).
Extreme values are lumped into the first and last bins. If <var class="var">y</var> is a
matrix then plot a histogram where each bin contains one bar per input
column of <var class="var">y</var>.
</p>
<p>If the optional second argument is a scalar, <var class="var">nbins</var>, it defines the
number of bins.
</p>
<p>If the optional second argument is a vector, <var class="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 class="code">numel (<var class="var">x</var>)</code>.
</p>
<p>If a third argument <var class="var">norm</var> is provided, the histogram is normalized.
In case <var class="var">norm</var> is a positive scalar, the resulting bars are normalized
to <var class="var">norm</var>. If <var class="var">norm</var> is a vector of positive scalars of length
<code class="code">columns (<var class="var">y</var>)</code>, then the resulting bar of <code class="code"><var class="var">y</var>(:,i)</code> is
normalized to <code class="code"><var class="var">norm</var>(i)</code>.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">[nn, xx] = hist (rand (10, 3), 5, [1 2 3]);
sum (nn, 1)
⇒ ans =
1 2 3
</pre></div></div>
<p>The histogram’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">
<div class="group"><pre class="example-preformatted">hist (randn (1, 100), 25, "facecolor", "r", "edgecolor", "b");
</pre></div></div>
<p>The full list of patch properties is documented at <a class="ref" href="Patch-Properties.html">Patch Properties</a>.
property. If not specified, the default colors for the histogram are taken
from the <code class="code">"Colormap"</code> property of the axes or figure.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>If an output is requested then no plot is made. Instead, return the values
<var class="var">nn</var> (numbers of elements) and <var class="var">xx</var> (bin centers) such that
<code class="code">bar (<var class="var">xx</var>, <var class="var">nn</var>)</code> will plot the histogram. If <var class="var">y</var> is a
vector, <var class="var">nn</var> and <var class="var">xx</var> will be row vectors. If <var class="var">y</var> is an array,
<var class="var">nn</var> will be a 2-D array with one column of element counts for each
column in <var class="var">y</var>, and <var class="var">xx</var> will be a column vector of bin centers.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="Basic-Statistical-Functions.html#XREFhistc">histc</a>, <a class="ref" href="#XREFbar">bar</a>, <a class="ref" href="#XREFpie">pie</a>, <a class="ref" href="#XREFrose">rose</a>.
</p></dd></dl>
<a class="anchor" id="XREFstemleaf"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-stemleaf"><span><strong class="def-name">stemleaf</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">caption</var>)</code><a class="copiable-link" href="#index-stemleaf"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stemleaf-1"><span><strong class="def-name">stemleaf</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">caption</var>, <var class="var">stem_sz</var>)</code><a class="copiable-link" href="#index-stemleaf-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stemleaf-2"><span><code class="def-type"><var class="var">plotstr</var> =</code> <strong class="def-name">stemleaf</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-stemleaf-2"> ¶</a></span></dt>
<dd><p>Compute and display a stem and leaf plot of the vector <var class="var">x</var>.
</p>
<p>The input <var class="var">x</var> should be a vector of integers. Any non-integer values
will be converted to integer by <code class="code"><var class="var">x</var> = fix (<var class="var">x</var>)</code>. By default
each element of <var class="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 ‘<samp class="samp">12</samp>’ and the leaf ‘<samp class="samp">3</samp>’. The second
argument, <var class="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 class="var">stem_sz</var> sets the width of each stem.
The stem width is determined by <code class="code">10^(<var class="var">stem_sz</var> + 1)</code>.
The default stem width is 10.
</p>
<p>The output of <code class="code">stemleaf</code> is composed of two parts: a
"Fenced Letter Display", followed by the stem-and-leaf plot itself.
The Fenced Letter Display is described in <cite class="cite">Exploratory Data Analysis</cite>.
Briefly, the entries are as shown:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">
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></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 class="var">stem_sz</var> is not 1 the
successive leaf values are separated by ",".
</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 class="code"><var class="var">xs</var> = sort (<var class="var">x</var>)</code> before calling <code class="code">stemleaf (<var class="var">xs</var>)</code>.
</p>
<p>The stem and leaf plot and associated displays are described in:
Chapter 3, <cite class="cite">Exploratory Data Analysis</cite> by J. W. Tukey,
Addison-Wesley, 1977.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFhist">hist</a>, <a class="ref" href="#XREFprintd">printd</a>.
</p></dd></dl>
<a class="anchor" id="XREFprintd"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-printd"><span><strong class="def-name">printd</strong> <code class="def-code-arguments">(<var class="var">obj</var>, <var class="var">filename</var>)</code><a class="copiable-link" href="#index-printd"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-printd-1"><span><code class="def-type"><var class="var">out_file</var> =</code> <strong class="def-name">printd</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-printd-1"> ¶</a></span></dt>
<dd>
<p>Convert any object acceptable to <code class="code">disp</code> into the format selected by
the suffix of <var class="var">filename</var>.
</p>
<p>If the optional output <var class="var">out_file</var> is requested, 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 class="code">stemleaf</code>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFstemleaf">stemleaf</a>.
</p></dd></dl>
<a class="anchor" id="XREFstairs"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-stairs"><span><strong class="def-name">stairs</strong> <code class="def-code-arguments">(<var class="var">y</var>)</code><a class="copiable-link" href="#index-stairs"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stairs-1"><span><strong class="def-name">stairs</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-stairs-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stairs-2"><span><strong class="def-name">stairs</strong> <code class="def-code-arguments">(…, <var class="var">style</var>)</code><a class="copiable-link" href="#index-stairs-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stairs-3"><span><strong class="def-name">stairs</strong> <code class="def-code-arguments">(…, <var class="var">prop</var>, <var class="var">val</var>, …)</code><a class="copiable-link" href="#index-stairs-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stairs-4"><span><strong class="def-name">stairs</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-stairs-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stairs-5"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">stairs</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-stairs-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stairs-6"><span><code class="def-type">[<var class="var">xstep</var>, <var class="var">ystep</var>] =</code> <strong class="def-name">stairs</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-stairs-6"> ¶</a></span></dt>
<dd><p>Produce a stairstep plot.
</p>
<p>The arguments <var class="var">x</var> and <var class="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 class="code"><var class="var">x</var> = 1:numel (<var class="var">y</var>)</code>).
</p>
<p>The style to use for the plot can be defined with a line style <var class="var">style</var>
of the same format as the <code class="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 class="ref" href="Line-Properties.html">Line Properties</a>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="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-preformatted">stairs (x, y);
</pre></div>
<p>and
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">[xs, ys] = stairs (x, y);
plot (xs, ys);
</pre></div></div>
<p>are equivalent.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFbar">bar</a>, <a class="ref" href="#XREFhist">hist</a>, <a class="ref" href="#XREFplot">plot</a>, <a class="ref" href="#XREFstem">stem</a>.
</p></dd></dl>
<a class="anchor" id="XREFstem"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-stem"><span><strong class="def-name">stem</strong> <code class="def-code-arguments">(<var class="var">y</var>)</code><a class="copiable-link" href="#index-stem"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stem-1"><span><strong class="def-name">stem</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-stem-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stem-2"><span><strong class="def-name">stem</strong> <code class="def-code-arguments">(…, <var class="var">linespec</var>)</code><a class="copiable-link" href="#index-stem-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stem-3"><span><strong class="def-name">stem</strong> <code class="def-code-arguments">(…, "filled")</code><a class="copiable-link" href="#index-stem-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stem-4"><span><strong class="def-name">stem</strong> <code class="def-code-arguments">(…, <var class="var">prop</var>, <var class="var">val</var>, …)</code><a class="copiable-link" href="#index-stem-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stem-5"><span><strong class="def-name">stem</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-stem-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stem-6"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">stem</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-stem-6"> ¶</a></span></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 class="var">y</var> is a matrix, then each column of the matrix is plotted as
a separate stem graph. In this case <var class="var">x</var> can either be a vector,
the same length as the number of rows in <var class="var">y</var>, or it can be a
matrix of the same size as <var class="var">y</var>.
</p>
<p>The default color is <code class="code">"b"</code> (blue), the default line style is
<code class="code">"-"</code>, and the default marker is <code class="code">"o"</code>. The line style can
be altered by the <var class="var">linespec</var> argument in the same manner as the
<code class="code">plot</code> command. If the <code class="code">"filled"</code> argument is present the
markers at the top of the stems will be filled in. For example,
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">x = 1:10;
y = 2*x;
stem (x, y, "r");
</pre></div></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 class="ref" href="Line-Properties.html">Line Properties</a>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a handle to a "stem series"
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 "stem series" hggroup.
</p>
<p>For example,
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">x = [0:10]';
y = [sin(x), cos(x)]
h = stem (x, y);
set (h(2), "color", "g");
set (h(1), "basevalue", -1)
</pre></div></div>
<p>changes the color of the second "stem series" and moves the base
line of the first.
</p>
<p>Stem Series Properties
</p>
<dl class="table">
<dt>linestyle</dt>
<dd><p>The linestyle of the stem. (Default: <code class="code">"-"</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 class="code">"b"</code> [blue])
</p>
</dd>
<dt>marker</dt>
<dd><p>The marker symbol to use at the top of each stem. (Default: <code class="code">"o"</code>)
</p>
</dd>
<dt>markeredgecolor</dt>
<dd><p>The edge color of the marker. (Default: <code class="code">"color"</code> property)
</p>
</dd>
<dt>markerfacecolor</dt>
<dd><p>The color to use for "filling" the marker.
(Default: <code class="code">"none"</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 class="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 class="strong">See also:</strong> <a class="ref" href="#XREFstem3">stem3</a>, <a class="ref" href="#XREFbar">bar</a>, <a class="ref" href="#XREFhist">hist</a>, <a class="ref" href="#XREFplot">plot</a>, <a class="ref" href="#XREFstairs">stairs</a>.
</p></dd></dl>
<a class="anchor" id="XREFstem3"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-stem3"><span><strong class="def-name">stem3</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>)</code><a class="copiable-link" href="#index-stem3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stem3-1"><span><strong class="def-name">stem3</strong> <code class="def-code-arguments">(…, <var class="var">linespec</var>)</code><a class="copiable-link" href="#index-stem3-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stem3-2"><span><strong class="def-name">stem3</strong> <code class="def-code-arguments">(…, "filled")</code><a class="copiable-link" href="#index-stem3-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stem3-3"><span><strong class="def-name">stem3</strong> <code class="def-code-arguments">(…, <var class="var">prop</var>, <var class="var">val</var>, …)</code><a class="copiable-link" href="#index-stem3-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stem3-4"><span><strong class="def-name">stem3</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-stem3-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stem3-5"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">stem3</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-stem3-5"> ¶</a></span></dt>
<dd><p>Plot a 3-D stem graph.
</p>
<p>Stems are drawn from the height <var class="var">z</var> to the location in the x-y plane
determined by <var class="var">x</var> and <var class="var">y</var>. The default color is <code class="code">"b"</code> (blue),
the default line style is <code class="code">"-"</code>, and the default marker is
<code class="code">"o"</code>.
</p>
<p>The line style can be altered by the <var class="var">linespec</var> argument in the same
manner as the <code class="code">plot</code> command. If the <code class="code">"filled"</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 class="ref" href="Line-Properties.html">Line Properties</a>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a handle to the "stem series"
hggroup containing the line and marker objects used for the plot.
See <a class="xref" href="#XREFstem"><code class="code">stem</code></a>, for a description of the
"stem series" object.
</p>
<p>Example:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">theta = 0:0.2:6;
stem3 (cos (theta), sin (theta), theta);
</pre></div></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 class="strong">See also:</strong> <a class="ref" href="#XREFstem">stem</a>, <a class="ref" href="#XREFbar">bar</a>, <a class="ref" href="#XREFhist">hist</a>, <a class="ref" href="#XREFplot">plot</a>.
</p></dd></dl>
<a class="anchor" id="XREFscatter"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-scatter"><span><strong class="def-name">scatter</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-scatter"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-scatter-1"><span><strong class="def-name">scatter</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">s</var>)</code><a class="copiable-link" href="#index-scatter-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-scatter-2"><span><strong class="def-name">scatter</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">s</var>, <var class="var">c</var>)</code><a class="copiable-link" href="#index-scatter-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-scatter-3"><span><strong class="def-name">scatter</strong> <code class="def-code-arguments">(…, <var class="var">style</var>)</code><a class="copiable-link" href="#index-scatter-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-scatter-4"><span><strong class="def-name">scatter</strong> <code class="def-code-arguments">(…, "filled")</code><a class="copiable-link" href="#index-scatter-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-scatter-5"><span><strong class="def-name">scatter</strong> <code class="def-code-arguments">(…, <var class="var">prop</var>, <var class="var">val</var>, …)</code><a class="copiable-link" href="#index-scatter-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-scatter-6"><span><strong class="def-name">scatter</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-scatter-6"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-scatter-7"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">scatter</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-scatter-7"> ¶</a></span></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 class="var">x</var> and <var class="var">y</var>.
</p>
<p>The size of the markers is determined by <var class="var">s</var>, which can be a scalar
or a vector of the same length as <var class="var">x</var> and <var class="var">y</var>. If <var class="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 class="code">sqrt (s)</code>).
</p>
<p>The color of the markers is determined by <var class="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 class="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 class="var">style</var> argument; it is a
string defining a marker in the same manner as the <code class="code">plot</code> command.
If no marker is specified it defaults to <code class="code">"o"</code> or circles.
If the argument <code class="code">"filled"</code> is given then the markers are filled.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the created
scatter object.
</p>
<p>Example:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">x = randn (100, 1);
y = randn (100, 1);
scatter (x, y, [], sqrt (x.^2 + y.^2));
</pre></div></div>
<p>Programming Note: The full list of properties is documented at
<a class="ref" href="Scatter-Properties.html">Scatter Properties</a>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="Three_002dDimensional-Plots.html#XREFscatter3">scatter3</a>, <a class="ref" href="Creating-Graphics-Objects.html#XREFpatch">patch</a>, <a class="ref" href="#XREFplot">plot</a>.
</p></dd></dl>
<a class="anchor" id="XREFplotmatrix"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-plotmatrix"><span><strong class="def-name">plotmatrix</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-plotmatrix"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plotmatrix-1"><span><strong class="def-name">plotmatrix</strong> <code class="def-code-arguments">(<var class="var">x</var>)</code><a class="copiable-link" href="#index-plotmatrix-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plotmatrix-2"><span><strong class="def-name">plotmatrix</strong> <code class="def-code-arguments">(…, <var class="var">style</var>)</code><a class="copiable-link" href="#index-plotmatrix-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plotmatrix-3"><span><strong class="def-name">plotmatrix</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-plotmatrix-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-plotmatrix-4"><span><code class="def-type">[<var class="var">h</var>, <var class="var">ax</var>, <var class="var">bigax</var>, <var class="var">p</var>, <var class="var">pax</var>] =</code> <strong class="def-name">plotmatrix</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-plotmatrix-4"> ¶</a></span></dt>
<dd><p>Scatter plot of the columns of one matrix against another.
</p>
<p>Given the arguments <var class="var">x</var> and <var class="var">y</var> that have a matching number of
rows, <code class="code">plotmatrix</code> plots a set of axes corresponding to
</p>
<div class="example">
<pre class="example-preformatted">plot (<var class="var">x</var>(:, i), <var class="var">y</var>(:, j))
</pre></div>
<p>When called with a single argument <var class="var">x</var> this is equivalent to
</p>
<div class="example">
<pre class="example-preformatted">plotmatrix (<var class="var">x</var>, <var class="var">x</var>)
</pre></div>
<p>except that the diagonal of the set of axes will be replaced with the
histogram <code class="code">hist (<var class="var">x</var>(:, i))</code>.
</p>
<p>The marker to use can be changed with the <var class="var">style</var> argument, that is a
string defining a marker in the same manner as the <code class="code">plot</code> command.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> provides handles to the individual
graphics objects in the scatter plots, whereas <var class="var">ax</var> returns the
handles to the scatter plot axes objects.
</p>
<p><var class="var">bigax</var> is a hidden axes object that surrounds the other axes, such
that the commands <code class="code">xlabel</code>, <code class="code">title</code>, etc., will be associated
with this hidden axes.
</p>
<p>Finally, <var class="var">p</var> returns the graphics objects associated with the histogram
and <var class="var">pax</var> the corresponding axes objects.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example-preformatted">plotmatrix (randn (100, 3), "g+")
</pre></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFscatter">scatter</a>, <a class="ref" href="#XREFplot">plot</a>.
</p></dd></dl>
<a class="anchor" id="XREFpareto"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-pareto"><span><strong class="def-name">pareto</strong> <code class="def-code-arguments">(<var class="var">y</var>)</code><a class="copiable-link" href="#index-pareto"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pareto-1"><span><strong class="def-name">pareto</strong> <code class="def-code-arguments">(<var class="var">y</var>, <var class="var">x</var>)</code><a class="copiable-link" href="#index-pareto-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pareto-2"><span><strong class="def-name">pareto</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-pareto-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pareto-3"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">pareto</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-pareto-3"> ¶</a></span></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 "major causes" for
elimination results in the most cost-effective improvement scheme.
</p>
<p>Typically only the magnitude data <var class="var">y</var> is present in which case
<var class="var">x</var> is taken to be the range <code class="code">1 : length (<var class="var">y</var>)</code>. If <var class="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 class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a 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 class="code">pareto</code> is
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">Cheese = {"Cheddar", "Swiss", "Camembert", ...
"Munster", "Stilton", "Blue"};
Sold = [105, 30, 70, 10, 15, 20];
pareto (Sold, Cheese);
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFbar">bar</a>, <a class="ref" href="#XREFbarh">barh</a>, <a class="ref" href="#XREFhist">hist</a>, <a class="ref" href="#XREFpie">pie</a>, <a class="ref" href="#XREFplot">plot</a>.
</p></dd></dl>
<a class="anchor" id="XREFrose"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-rose"><span><strong class="def-name">rose</strong> <code class="def-code-arguments">(<var class="var">theta</var>)</code><a class="copiable-link" href="#index-rose"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-rose-1"><span><strong class="def-name">rose</strong> <code class="def-code-arguments">(<var class="var">theta</var>, <var class="var">nbins</var>)</code><a class="copiable-link" href="#index-rose-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-rose-2"><span><strong class="def-name">rose</strong> <code class="def-code-arguments">(<var class="var">theta</var>, <var class="var">bins</var>)</code><a class="copiable-link" href="#index-rose-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-rose-3"><span><strong class="def-name">rose</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-rose-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-rose-4"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">rose</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-rose-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-rose-5"><span><code class="def-type">[<var class="var">th</var>, <var class="var">r</var>] =</code> <strong class="def-name">rose</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-rose-5"> ¶</a></span></dt>
<dd><p>Plot an angular histogram.
</p>
<p>With one vector argument, <var class="var">th</var>, plot the histogram with 20 angular bins.
If <var class="var">th</var> is a matrix then each column of <var class="var">th</var> produces a separate
histogram.
</p>
<p>If <var class="var">nbins</var> is given and is a scalar, then the histogram is produced with
<var class="var">nbin</var> bins. If <var class="var">bins</var> is a vector, then the center of each bin is
defined by the values in <var class="var">bins</var> and the number of bins is
given by the number of elements in <var class="var">bins</var>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a vector of graphics handles to the
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">
<div class="group"><pre class="example-preformatted">[th, r] = rose ([2*randn(1e5,1), pi + 2*randn(1e5,1)]);
polar (th, r);
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFhist">hist</a>, <a class="ref" href="#XREFpolar">polar</a>.
</p></dd></dl>
<p>The <code class="code">contour</code>, <code class="code">contourf</code> and <code class="code">contourc</code> functions
produce two-dimensional contour plots from three-dimensional data.
</p>
<a class="anchor" id="XREFcontour"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-contour"><span><strong class="def-name">contour</strong> <code class="def-code-arguments">(<var class="var">z</var>)</code><a class="copiable-link" href="#index-contour"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contour-1"><span><strong class="def-name">contour</strong> <code class="def-code-arguments">(<var class="var">z</var>, <var class="var">vn</var>)</code><a class="copiable-link" href="#index-contour-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contour-2"><span><strong class="def-name">contour</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>)</code><a class="copiable-link" href="#index-contour-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contour-3"><span><strong class="def-name">contour</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">vn</var>)</code><a class="copiable-link" href="#index-contour-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contour-4"><span><strong class="def-name">contour</strong> <code class="def-code-arguments">(…, <var class="var">style</var>)</code><a class="copiable-link" href="#index-contour-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contour-5"><span><strong class="def-name">contour</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-contour-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contour-6"><span><code class="def-type">[<var class="var">c</var>, <var class="var">h</var>] =</code> <strong class="def-name">contour</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-contour-6"> ¶</a></span></dt>
<dd><p>Create a 2-D contour plot.
</p>
<p>Plot level curves (contour lines) of the matrix <var class="var">z</var>, using the
contour matrix <var class="var">c</var> computed by <code class="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 class="var">style</var>
in the same manner as <code class="code">plot</code>. Only line style and color are used;
Any markers defined by <var class="var">style</var> are ignored.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional output <var class="var">c</var> contains the contour levels in <code class="code">contourc</code>
format.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the hggroup
comprising the contour lines.
</p>
<p>Example:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">x = 0:3;
y = 0:2;
z = y' * x;
contour (x, y, z, 2:3)
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="Two_002ddimensional-Function-Plotting.html#XREFezcontour">ezcontour</a>, <a class="ref" href="#XREFcontourc">contourc</a>, <a class="ref" href="#XREFcontourf">contourf</a>, <a class="ref" href="#XREFcontour3">contour3</a>, <a class="ref" href="Plot-Annotations.html#XREFclabel">clabel</a>, <a class="ref" href="Three_002dDimensional-Plots.html#XREFmeshc">meshc</a>, <a class="ref" href="Three_002dDimensional-Plots.html#XREFsurfc">surfc</a>, <a class="ref" href="Axis-Configuration.html#XREFclim">clim</a>, <a class="ref" href="Representing-Images.html#XREFcolormap">colormap</a>, <a class="ref" href="#XREFplot">plot</a>.
</p>
</dd></dl>
<a class="anchor" id="XREFcontourf"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-contourf"><span><strong class="def-name">contourf</strong> <code class="def-code-arguments">(<var class="var">z</var>)</code><a class="copiable-link" href="#index-contourf"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contourf-1"><span><strong class="def-name">contourf</strong> <code class="def-code-arguments">(<var class="var">z</var>, <var class="var">vn</var>)</code><a class="copiable-link" href="#index-contourf-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contourf-2"><span><strong class="def-name">contourf</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>)</code><a class="copiable-link" href="#index-contourf-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contourf-3"><span><strong class="def-name">contourf</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">vn</var>)</code><a class="copiable-link" href="#index-contourf-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contourf-4"><span><strong class="def-name">contourf</strong> <code class="def-code-arguments">(…, <var class="var">style</var>)</code><a class="copiable-link" href="#index-contourf-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contourf-5"><span><strong class="def-name">contourf</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-contourf-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contourf-6"><span><code class="def-type">[<var class="var">c</var>, <var class="var">h</var>] =</code> <strong class="def-name">contourf</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-contourf-6"> ¶</a></span></dt>
<dd><p>Create a 2-D contour plot with filled intervals.
</p>
<p>Plot level curves (contour lines) of the matrix <var class="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 class="var">c</var> computed by
<code class="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 class="var">style</var>
in the same manner as <code class="code">plot</code>. Only line style and color are used;
Any markers defined by <var class="var">style</var> are ignored.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional output <var class="var">c</var> contains the contour levels in <code class="code">contourc</code>
format.
</p>
<p>The optional return value <var class="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 class="code">peaks</code> function.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">[x, y, z] = peaks (50);
contourf (x, y, z, -7:9)
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="Two_002ddimensional-Function-Plotting.html#XREFezcontourf">ezcontourf</a>, <a class="ref" href="#XREFcontour">contour</a>, <a class="ref" href="#XREFcontourc">contourc</a>, <a class="ref" href="#XREFcontour3">contour3</a>, <a class="ref" href="Plot-Annotations.html#XREFclabel">clabel</a>, <a class="ref" href="Three_002dDimensional-Plots.html#XREFmeshc">meshc</a>, <a class="ref" href="Three_002dDimensional-Plots.html#XREFsurfc">surfc</a>, <a class="ref" href="Axis-Configuration.html#XREFclim">clim</a>, <a class="ref" href="Representing-Images.html#XREFcolormap">colormap</a>, <a class="ref" href="#XREFplot">plot</a>.
</p></dd></dl>
<a class="anchor" id="XREFcontourc"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-contourc"><span><code class="def-type"><var class="var">c</var> =</code> <strong class="def-name">contourc</strong> <code class="def-code-arguments">(<var class="var">z</var>)</code><a class="copiable-link" href="#index-contourc"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contourc-1"><span><code class="def-type"><var class="var">c</var> =</code> <strong class="def-name">contourc</strong> <code class="def-code-arguments">(<var class="var">z</var>, <var class="var">vn</var>)</code><a class="copiable-link" href="#index-contourc-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contourc-2"><span><code class="def-type"><var class="var">c</var> =</code> <strong class="def-name">contourc</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>)</code><a class="copiable-link" href="#index-contourc-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contourc-3"><span><code class="def-type"><var class="var">c</var> =</code> <strong class="def-name">contourc</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">vn</var>)</code><a class="copiable-link" href="#index-contourc-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contourc-4"><span><code class="def-type">[<var class="var">c</var>, <var class="var">lev</var>] =</code> <strong class="def-name">contourc</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-contourc-4"> ¶</a></span></dt>
<dd><p>Compute contour lines (isolines of constant Z value).
</p>
<p>The matrix <var class="var">z</var> contains height values above the rectangular grid
determined by <var class="var">x</var> and <var class="var">y</var>. If only a single input <var class="var">z</var> is
provided then <var class="var">x</var> is taken to be <code class="code">1:columns (<var class="var">z</var>)</code> and <var class="var">y</var>
is taken to be <code class="code">1:rows (<var class="var">z</var>)</code>. The minimum data size is 2x2.
</p>
<p>The optional input <var class="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 class="var">vn</var> is a vector the number of contour lines
is <code class="code">numel (<var class="var">vn</var>)</code>. However, to compute a single contour line
at a given value use <code class="code"><var class="var">vn</var> = [val, val]</code>. If <var class="var">vn</var> is omitted
it defaults to 10.
</p>
<p>The return value <var class="var">c</var> is a 2x<var class="var">n</var> matrix containing the contour lines
in the following format
</p>
<div class="example">
<div class="group"><pre class="example-preformatted"><var class="var">c</var> = [lev1, x1, x2, ..., levn, x1, x2, ...
len1, y1, y2, ..., lenn, y1, y2, ...]
</pre></div></div>
<p>in which contour line <var class="var">n</var> has a level (height) of <var class="var">levn</var> and length
of <var class="var">lenn</var>.
</p>
<p>The optional return value <var class="var">lev</var> is a vector with the Z values of the
contour levels.
</p>
<p>Example:
</p>
<div class="example smallexample">
<div class="group"><pre class="example-preformatted">x = 0:2;
y = x;
z = x' * y;
c = contourc (x, y, z, 2:3)
⇒ 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></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFcontour">contour</a>, <a class="ref" href="#XREFcontourf">contourf</a>, <a class="ref" href="#XREFcontour3">contour3</a>, <a class="ref" href="Plot-Annotations.html#XREFclabel">clabel</a>.
</p></dd></dl>
<a class="anchor" id="XREFcontour3"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-contour3"><span><strong class="def-name">contour3</strong> <code class="def-code-arguments">(<var class="var">z</var>)</code><a class="copiable-link" href="#index-contour3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contour3-1"><span><strong class="def-name">contour3</strong> <code class="def-code-arguments">(<var class="var">z</var>, <var class="var">vn</var>)</code><a class="copiable-link" href="#index-contour3-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contour3-2"><span><strong class="def-name">contour3</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>)</code><a class="copiable-link" href="#index-contour3-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contour3-3"><span><strong class="def-name">contour3</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">vn</var>)</code><a class="copiable-link" href="#index-contour3-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contour3-4"><span><strong class="def-name">contour3</strong> <code class="def-code-arguments">(…, <var class="var">style</var>)</code><a class="copiable-link" href="#index-contour3-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contour3-5"><span><strong class="def-name">contour3</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-contour3-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-contour3-6"><span><code class="def-type">[<var class="var">c</var>, <var class="var">h</var>] =</code> <strong class="def-name">contour3</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-contour3-6"> ¶</a></span></dt>
<dd><p>Create a 3-D contour plot.
</p>
<p><code class="code">contour3</code> plots level curves (contour lines) of the matrix <var class="var">z</var>
at a Z level corresponding to each contour. This is in contrast to
<code class="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 class="var">c</var> computed by
<code class="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 class="var">style</var>
in the same manner as <code class="code">plot</code>. Only line style and color are used;
Any markers defined by <var class="var">style</var> are ignored.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional output <var class="var">c</var> are the contour levels in <code class="code">contourc</code>
format.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the hggroup
comprising the contour lines.
</p>
<p>Example:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">contour3 (peaks (19));
colormap cool;
hold on;
surf (peaks (19), "facecolor", "none", "edgecolor", "black");
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFcontour">contour</a>, <a class="ref" href="#XREFcontourc">contourc</a>, <a class="ref" href="#XREFcontourf">contourf</a>, <a class="ref" href="Plot-Annotations.html#XREFclabel">clabel</a>, <a class="ref" href="Three_002dDimensional-Plots.html#XREFmeshc">meshc</a>, <a class="ref" href="Three_002dDimensional-Plots.html#XREFsurfc">surfc</a>, <a class="ref" href="Axis-Configuration.html#XREFclim">clim</a>, <a class="ref" href="Representing-Images.html#XREFcolormap">colormap</a>, <a class="ref" href="#XREFplot">plot</a>.
</p></dd></dl>
<p>The <code class="code">errorbar</code>, <code class="code">semilogxerr</code>, <code class="code">semilogyerr</code>, and
<code class="code">loglogerr</code> functions produce plots with error bar markers. For
example,
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">rand ("state", 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 ("x");
ylabel ("sin (x)");
title ("Errorbar plot of sin (x)");
</pre></div></div>
<p>produces the figure shown in <a class="ref" href="#fig_003aerrorbar">Figure 15.3</a>.
</p>
<div class="float" id="fig_003aerrorbar">
<div class="center"><img class="image" src="errorbar.png" alt="errorbar">
</div><div class="caption"><p><strong class="strong">Figure 15.3: </strong>Errorbar plot.</p></div></div>
<a class="anchor" id="XREFerrorbar"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-errorbar"><span><strong class="def-name">errorbar</strong> <code class="def-code-arguments">(<var class="var">y</var>, <var class="var">ey</var>)</code><a class="copiable-link" href="#index-errorbar"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-errorbar-1"><span><strong class="def-name">errorbar</strong> <code class="def-code-arguments">(<var class="var">y</var>, …, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-errorbar-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-errorbar-2"><span><strong class="def-name">errorbar</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">ey</var>)</code><a class="copiable-link" href="#index-errorbar-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-errorbar-3"><span><strong class="def-name">errorbar</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">err</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-errorbar-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-errorbar-4"><span><strong class="def-name">errorbar</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">lerr</var>, <var class="var">uerr</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-errorbar-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-errorbar-5"><span><strong class="def-name">errorbar</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">ex</var>, <var class="var">ey</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-errorbar-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-errorbar-6"><span><strong class="def-name">errorbar</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">lx</var>, <var class="var">ux</var>, <var class="var">ly</var>, <var class="var">uy</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-errorbar-6"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-errorbar-7"><span><strong class="def-name">errorbar</strong> <code class="def-code-arguments">(<var class="var">x1</var>, <var class="var">y1</var>, …, <var class="var">fmt</var>, <var class="var">xn</var>, <var class="var">yn</var>, …)</code><a class="copiable-link" href="#index-errorbar-7"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-errorbar-8"><span><strong class="def-name">errorbar</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-errorbar-8"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-errorbar-9"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">errorbar</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-errorbar-9"> ¶</a></span></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-preformatted">errorbar (<var class="var">y</var>, <var class="var">ey</var>)
</pre></div>
<p>where the first argument is taken as the set of <var class="var">y</var> coordinates, the
second argument <var class="var">ey</var> are the errors around the <var class="var">y</var> values, and the
<var class="var">x</var> coordinates are taken to be the indices of the elements
(<code class="code">1:numel (<var class="var">y</var>)</code>).
</p>
<p>The general form of the function is
</p>
<div class="example">
<pre class="example-preformatted">errorbar (<var class="var">x</var>, <var class="var">y</var>, <var class="var">err1</var>, ..., <var class="var">fmt</var>, ...)
</pre></div>
<p>After the <var class="var">x</var> and <var class="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 class="var">fmt</var>.
</p>
<dl class="table">
<dt><var class="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 class="var">data</var>-<var class="var">err</var> to
<var class="var">data</var>+<var class="var">err</var>.
The <var class="var">fmt</var> argument determines whether <var class="var">err</var> is in the x-direction,
y-direction (default), or both.
</p>
</dd>
<dt><var class="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 class="var">data</var>(n)-<var class="var">err</var>(n) to
<var class="var">data</var>(n)+<var class="var">err</var>(n).
</p>
</dd>
<dt><var class="var">lerr</var>, <var class="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 class="var">data</var>-<var class="var">lerr</var> to
<var class="var">data</var>+<var class="var">uerr</var>.
</p>
</dd>
<dt><var class="var">lerr</var>, <var class="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 class="var">data</var>(n)-<var class="var">lerr</var>(n) to <var class="var">data</var>(n)+<var class="var">uerr</var>(n).
</p></dd>
</dl>
<p>Any number of data sets (<var class="var">x1</var>,<var class="var">y1</var>, <var class="var">x2</var>,<var class="var">y2</var>, …) may
appear as long as they are separated by a format string <var class="var">fmt</var>.
</p>
<p>If <var class="var">y</var> is a matrix, <var class="var">x</var> and the error parameters must also be
matrices having the same dimensions. The columns of <var class="var">y</var> are plotted
versus the corresponding columns of <var class="var">x</var> and errorbars are taken from
the corresponding columns of the error parameters.
</p>
<p>If <var class="var">fmt</var> is missing, the yerrorbars ("~") plot style is assumed.
</p>
<p>If the <var class="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 class="var">fmt</var> may include an errorbar style which <strong class="strong">must precede</strong> the
ordinary format codes. The following errorbar styles are supported:
</p>
<dl class="table">
<dt>‘<samp class="samp">~</samp>’</dt>
<dd><p>Set yerrorbars plot style (default).
</p>
</dd>
<dt>‘<samp class="samp">></samp>’</dt>
<dd><p>Set xerrorbars plot style.
</p>
</dd>
<dt>‘<samp class="samp">~></samp>’</dt>
<dd><p>Set xyerrorbars plot style.
</p>
</dd>
<dt>‘<samp class="samp">#~</samp>’</dt>
<dd><p>Set yboxes plot style.
</p>
</dd>
<dt>‘<samp class="samp">#</samp>’</dt>
<dd><p>Set xboxes plot style.
</p>
</dd>
<dt>‘<samp class="samp">#~></samp>’</dt>
<dd><p>Set xyboxes plot style.
</p></dd>
</dl>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a handle to the hggroup object
representing the data plot and errorbars.
</p>
<p>Note: For compatibility with <small class="sc">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 class="var">fmt</var> argument such as <code class="code">"."</code>. Alternatively, remove the line
by modifying the returned graphic handle with
<code class="code">set (h, "linestyle", "none")</code>.
</p>
<p>Examples:
</p>
<div class="example">
<pre class="example-preformatted">errorbar (<var class="var">x</var>, <var class="var">y</var>, <var class="var">ex</var>, ">.r")
</pre></div>
<p>produces an xerrorbar plot of <var class="var">y</var> versus <var class="var">x</var> with <var class="var">x</var>
errorbars drawn from <var class="var">x</var>-<var class="var">ex</var> to <var class="var">x</var>+<var class="var">ex</var>. The marker
<code class="code">"."</code> is used so no connecting line is drawn and the errorbars
appear in red.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">errorbar (<var class="var">x</var>, <var class="var">y1</var>, <var class="var">ey</var>, "~",
<var class="var">x</var>, <var class="var">y2</var>, <var class="var">ly</var>, <var class="var">uy</var>)
</pre></div></div>
<p>produces yerrorbar plots with <var class="var">y1</var> and <var class="var">y2</var> versus <var class="var">x</var>.
Errorbars for <var class="var">y1</var> are drawn from <var class="var">y1</var>-<var class="var">ey</var> to
<var class="var">y1</var>+<var class="var">ey</var>, errorbars for <var class="var">y2</var> from <var class="var">y2</var>-<var class="var">ly</var> to
<var class="var">y2</var>+<var class="var">uy</var>.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">errorbar (<var class="var">x</var>, <var class="var">y</var>, <var class="var">lx</var>, <var class="var">ux</var>,
<var class="var">ly</var>, <var class="var">uy</var>, "~>")
</pre></div></div>
<p>produces an xyerrorbar plot of <var class="var">y</var> versus <var class="var">x</var> in which
<var class="var">x</var> errorbars are drawn from <var class="var">x</var>-<var class="var">lx</var> to <var class="var">x</var>+<var class="var">ux</var>
and <var class="var">y</var> errorbars from <var class="var">y</var>-<var class="var">ly</var> to <var class="var">y</var>+<var class="var">uy</var>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFsemilogxerr">semilogxerr</a>, <a class="ref" href="#XREFsemilogyerr">semilogyerr</a>, <a class="ref" href="#XREFloglogerr">loglogerr</a>, <a class="ref" href="#XREFplot">plot</a>.
</p></dd></dl>
<a class="anchor" id="XREFsemilogxerr"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-semilogxerr"><span><strong class="def-name">semilogxerr</strong> <code class="def-code-arguments">(<var class="var">y</var>, <var class="var">ey</var>)</code><a class="copiable-link" href="#index-semilogxerr"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogxerr-1"><span><strong class="def-name">semilogxerr</strong> <code class="def-code-arguments">(<var class="var">y</var>, …, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-semilogxerr-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogxerr-2"><span><strong class="def-name">semilogxerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">ey</var>)</code><a class="copiable-link" href="#index-semilogxerr-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogxerr-3"><span><strong class="def-name">semilogxerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">err</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-semilogxerr-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogxerr-4"><span><strong class="def-name">semilogxerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">lerr</var>, <var class="var">uerr</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-semilogxerr-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogxerr-5"><span><strong class="def-name">semilogxerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">ex</var>, <var class="var">ey</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-semilogxerr-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogxerr-6"><span><strong class="def-name">semilogxerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">lx</var>, <var class="var">ux</var>, <var class="var">ly</var>, <var class="var">uy</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-semilogxerr-6"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogxerr-7"><span><strong class="def-name">semilogxerr</strong> <code class="def-code-arguments">(<var class="var">x1</var>, <var class="var">y1</var>, …, <var class="var">fmt</var>, <var class="var">xn</var>, <var class="var">yn</var>, …)</code><a class="copiable-link" href="#index-semilogxerr-7"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogxerr-8"><span><strong class="def-name">semilogxerr</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-semilogxerr-8"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogxerr-9"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">semilogxerr</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-semilogxerr-9"> ¶</a></span></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-preformatted">semilogxerr (<var class="var">x</var>, <var class="var">y</var>, <var class="var">ey</var>, <var class="var">fmt</var>)
</pre></div>
<p>which produces a semi-logarithmic plot of <var class="var">y</var> versus <var class="var">x</var>
with errors in the <var class="var">y</var>-scale defined by <var class="var">ey</var> and the plot
format defined by <var class="var">fmt</var>. See <a class="xref" href="#XREFerrorbar"><code class="code">errorbar</code></a>, for
available formats and additional information.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFerrorbar">errorbar</a>, <a class="ref" href="#XREFsemilogyerr">semilogyerr</a>, <a class="ref" href="#XREFloglogerr">loglogerr</a>.
</p></dd></dl>
<a class="anchor" id="XREFsemilogyerr"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-semilogyerr"><span><strong class="def-name">semilogyerr</strong> <code class="def-code-arguments">(<var class="var">y</var>, <var class="var">ey</var>)</code><a class="copiable-link" href="#index-semilogyerr"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogyerr-1"><span><strong class="def-name">semilogyerr</strong> <code class="def-code-arguments">(<var class="var">y</var>, …, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-semilogyerr-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogyerr-2"><span><strong class="def-name">semilogyerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">ey</var>)</code><a class="copiable-link" href="#index-semilogyerr-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogyerr-3"><span><strong class="def-name">semilogyerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">err</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-semilogyerr-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogyerr-4"><span><strong class="def-name">semilogyerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">lerr</var>, <var class="var">uerr</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-semilogyerr-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogyerr-5"><span><strong class="def-name">semilogyerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">ex</var>, <var class="var">ey</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-semilogyerr-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogyerr-6"><span><strong class="def-name">semilogyerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">lx</var>, <var class="var">ux</var>, <var class="var">ly</var>, <var class="var">uy</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-semilogyerr-6"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogyerr-7"><span><strong class="def-name">semilogyerr</strong> <code class="def-code-arguments">(<var class="var">x1</var>, <var class="var">y1</var>, …, <var class="var">fmt</var>, <var class="var">xn</var>, <var class="var">yn</var>, …)</code><a class="copiable-link" href="#index-semilogyerr-7"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogyerr-8"><span><strong class="def-name">semilogyerr</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-semilogyerr-8"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-semilogyerr-9"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">semilogyerr</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-semilogyerr-9"> ¶</a></span></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-preformatted">semilogyerr (<var class="var">x</var>, <var class="var">y</var>, <var class="var">ey</var>, <var class="var">fmt</var>)
</pre></div>
<p>which produces a semi-logarithmic plot of <var class="var">y</var> versus <var class="var">x</var>
with errors in the <var class="var">y</var>-scale defined by <var class="var">ey</var> and the plot
format defined by <var class="var">fmt</var>. See <a class="xref" href="#XREFerrorbar"><code class="code">errorbar</code></a>, for
available formats and additional information.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFerrorbar">errorbar</a>, <a class="ref" href="#XREFsemilogxerr">semilogxerr</a>, <a class="ref" href="#XREFloglogerr">loglogerr</a>.
</p></dd></dl>
<a class="anchor" id="XREFloglogerr"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-loglogerr"><span><strong class="def-name">loglogerr</strong> <code class="def-code-arguments">(<var class="var">y</var>, <var class="var">ey</var>)</code><a class="copiable-link" href="#index-loglogerr"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglogerr-1"><span><strong class="def-name">loglogerr</strong> <code class="def-code-arguments">(<var class="var">y</var>, …, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-loglogerr-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglogerr-2"><span><strong class="def-name">loglogerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">ey</var>)</code><a class="copiable-link" href="#index-loglogerr-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglogerr-3"><span><strong class="def-name">loglogerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">err</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-loglogerr-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglogerr-4"><span><strong class="def-name">loglogerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">lerr</var>, <var class="var">uerr</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-loglogerr-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglogerr-5"><span><strong class="def-name">loglogerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">ex</var>, <var class="var">ey</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-loglogerr-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglogerr-6"><span><strong class="def-name">loglogerr</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">lx</var>, <var class="var">ux</var>, <var class="var">ly</var>, <var class="var">uy</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-loglogerr-6"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglogerr-7"><span><strong class="def-name">loglogerr</strong> <code class="def-code-arguments">(<var class="var">x1</var>, <var class="var">y1</var>, …, <var class="var">fmt</var>, <var class="var">xn</var>, <var class="var">yn</var>, …)</code><a class="copiable-link" href="#index-loglogerr-7"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglogerr-8"><span><strong class="def-name">loglogerr</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-loglogerr-8"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-loglogerr-9"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">loglogerr</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-loglogerr-9"> ¶</a></span></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-preformatted">loglogerr (<var class="var">x</var>, <var class="var">y</var>, <var class="var">ey</var>, <var class="var">fmt</var>)
</pre></div>
<p>which produces a double logarithm plot of <var class="var">y</var> versus <var class="var">x</var>
with errors in the <var class="var">y</var>-scale defined by <var class="var">ey</var> and the plot
format defined by <var class="var">fmt</var>. See <a class="xref" href="#XREFerrorbar"><code class="code">errorbar</code></a>, for
available formats and additional information.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFerrorbar">errorbar</a>, <a class="ref" href="#XREFsemilogxerr">semilogxerr</a>, <a class="ref" href="#XREFsemilogyerr">semilogyerr</a>.
</p></dd></dl>
<p>Finally, the <code class="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">
<div class="group"><pre class="example-preformatted">polar (0:0.1:10*pi, 0:0.1:10*pi);
title ("Example polar plot from 0 to 10*pi");
</pre></div></div>
<p>produces the spiral plot shown in <a class="ref" href="#fig_003apolar">Figure 15.4</a>.
</p>
<div class="float" id="fig_003apolar">
<div class="center"><img class="image" src="polar.png" alt="polar">
</div><div class="caption"><p><strong class="strong">Figure 15.4: </strong>Polar plot.</p></div></div>
<a class="anchor" id="XREFpolar"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-polar"><span><strong class="def-name">polar</strong> <code class="def-code-arguments">(<var class="var">theta</var>, <var class="var">rho</var>)</code><a class="copiable-link" href="#index-polar"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-polar-1"><span><strong class="def-name">polar</strong> <code class="def-code-arguments">(<var class="var">theta</var>, <var class="var">rho</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-polar-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-polar-2"><span><strong class="def-name">polar</strong> <code class="def-code-arguments">(<var class="var">cplx</var>)</code><a class="copiable-link" href="#index-polar-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-polar-3"><span><strong class="def-name">polar</strong> <code class="def-code-arguments">(<var class="var">cplx</var>, <var class="var">fmt</var>)</code><a class="copiable-link" href="#index-polar-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-polar-4"><span><strong class="def-name">polar</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-polar-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-polar-5"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">polar</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-polar-5"> ¶</a></span></dt>
<dd><p>Create a 2-D plot from polar coordinates <var class="var">theta</var> and <var class="var">rho</var>.
</p>
<p>The input <var class="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 class="pxref" href="Coordinate-Transformations.html#XREFcart2pol"><code class="code">cart2pol</code></a>) to radians before passing the
data to this function.
</p>
<p>If a single complex input <var class="var">cplx</var> is given then the real part is used
for <var class="var">theta</var> and the imaginary part is used for <var class="var">rho</var>.
</p>
<p>The optional argument <var class="var">fmt</var> specifies the line format in the same way
as <code class="code">plot</code>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the created 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 class="code">fontname</code>, will update the polar axis. Two new properties are
added to the original axes–<code class="code">rtick</code>, <code class="code">ttick</code>–which replace
<code class="code">xtick</code>, <code class="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–359.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFrose">rose</a>, <a class="ref" href="#XREFcompass">compass</a>, <a class="ref" href="#XREFplot">plot</a>, <a class="ref" href="Coordinate-Transformations.html#XREFcart2pol">cart2pol</a>.
</p></dd></dl>
<a class="anchor" id="XREFpie"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-pie"><span><strong class="def-name">pie</strong> <code class="def-code-arguments">(<var class="var">x</var>)</code><a class="copiable-link" href="#index-pie"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pie-1"><span><strong class="def-name">pie</strong> <code class="def-code-arguments">(…, <var class="var">explode</var>)</code><a class="copiable-link" href="#index-pie-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pie-2"><span><strong class="def-name">pie</strong> <code class="def-code-arguments">(…, <var class="var">labels</var>)</code><a class="copiable-link" href="#index-pie-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pie-3"><span><strong class="def-name">pie</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-pie-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pie-4"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">pie</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-pie-4"> ¶</a></span></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 class="var">x</var>. The size of the ith slice is the percentage that the
element <var class="var">x</var>i represents of the total sum of <var class="var">x</var>:
<code class="code">pct = <var class="var">x</var>(i) / sum (<var class="var">x</var>)</code>.
</p>
<p>The optional input <var class="var">explode</var> is a vector of the same length as <var class="var">x</var>
that, if nonzero, "explodes" the slice from the pie chart.
</p>
<p>The optional input <var class="var">labels</var> is a cell array of strings of the same
length as <var class="var">x</var> specifying the label for each slice.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a list of handles to the patch
and text objects generating the plot.
</p>
<p>Note: If <code class="code">sum (<var class="var">x</var>) ≤ 1</code> then the elements of <var class="var">x</var> are
interpreted as percentages directly and are not normalized by <code class="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 class="strong">See also:</strong> <a class="ref" href="#XREFpie3">pie3</a>, <a class="ref" href="#XREFbar">bar</a>, <a class="ref" href="#XREFhist">hist</a>, <a class="ref" href="#XREFrose">rose</a>.
</p></dd></dl>
<a class="anchor" id="XREFpie3"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-pie3"><span><strong class="def-name">pie3</strong> <code class="def-code-arguments">(<var class="var">x</var>)</code><a class="copiable-link" href="#index-pie3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pie3-1"><span><strong class="def-name">pie3</strong> <code class="def-code-arguments">(…, <var class="var">explode</var>)</code><a class="copiable-link" href="#index-pie3-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pie3-2"><span><strong class="def-name">pie3</strong> <code class="def-code-arguments">(…, <var class="var">labels</var>)</code><a class="copiable-link" href="#index-pie3-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pie3-3"><span><strong class="def-name">pie3</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-pie3-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pie3-4"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">pie3</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-pie3-4"> ¶</a></span></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 class="var">x</var>. The size of the ith slice is the percentage that the
element <var class="var">x</var>i represents of the total sum of <var class="var">x</var>:
<code class="code">pct = <var class="var">x</var>(i) / sum (<var class="var">x</var>)</code>.
</p>
<p>The optional input <var class="var">explode</var> is a vector of the same length as <var class="var">x</var>
that, if nonzero, "explodes" the slice from the pie chart.
</p>
<p>The optional input <var class="var">labels</var> is a cell array of strings of the same
length as <var class="var">x</var> specifying the label for each slice.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a list of graphics handles to the
patch, surface, and text objects generating the plot.
</p>
<p>Note: If <code class="code">sum (<var class="var">x</var>) ≤ 1</code> then the elements of <var class="var">x</var> are
interpreted as percentages directly and are not normalized by <code class="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 class="strong">See also:</strong> <a class="ref" href="#XREFpie">pie</a>, <a class="ref" href="#XREFbar">bar</a>, <a class="ref" href="#XREFhist">hist</a>, <a class="ref" href="#XREFrose">rose</a>.
</p></dd></dl>
<a class="anchor" id="XREFquiver"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-quiver"><span><strong class="def-name">quiver</strong> <code class="def-code-arguments">(<var class="var">u</var>, <var class="var">v</var>)</code><a class="copiable-link" href="#index-quiver"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-quiver-1"><span><strong class="def-name">quiver</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">u</var>, <var class="var">v</var>)</code><a class="copiable-link" href="#index-quiver-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-quiver-2"><span><strong class="def-name">quiver</strong> <code class="def-code-arguments">(…, <var class="var">s</var>)</code><a class="copiable-link" href="#index-quiver-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-quiver-3"><span><strong class="def-name">quiver</strong> <code class="def-code-arguments">(…, <var class="var">style</var>)</code><a class="copiable-link" href="#index-quiver-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-quiver-4"><span><strong class="def-name">quiver</strong> <code class="def-code-arguments">(…, "filled")</code><a class="copiable-link" href="#index-quiver-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-quiver-5"><span><strong class="def-name">quiver</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-quiver-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-quiver-6"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">quiver</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-quiver-6"> ¶</a></span></dt>
<dd>
<p>Plot a 2-D vector field with arrows.
</p>
<p>Plot the (<var class="var">u</var>, <var class="var">v</var>) components of a vector field at the grid points
defined by (<var class="var">x</var>, <var class="var">y</var>). If the grid is uniform then <var class="var">x</var> and
<var class="var">y</var> can be specified as grid vectors and <code class="code">meshgrid</code> is used to
create the 2-D grid.
</p>
<p>If <var class="var">x</var> and <var class="var">y</var> are not given they are assumed to be
<code class="code">(1:<var class="var">m</var>, 1:<var class="var">n</var>)</code> where
<code class="code">[<var class="var">m</var>, <var class="var">n</var>] = size (<var class="var">u</var>)</code>.
</p>
<p>The optional input <var class="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
or <code class="code">"off"</code> 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 class="var">style</var>,
of the same format as the <code class="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 class="var">x</var> and <var class="var">y</var>). When a marker is specified, the
arrowhead is not drawn. If the argument <code class="code">"filled"</code> is given then the
markers are filled. If name-value plot style properties are used, they must
appear in pairs and follow any other plot style arguments.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to 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">
<div class="group"><pre class="example-preformatted">[x, y] = meshgrid (1:2:20);
h = quiver (x, y, sin (2*pi*x/10), sin (2*pi*y/10));
set (h, "maxheadsize", 0.33);
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFquiver3">quiver3</a>, <a class="ref" href="#XREFcompass">compass</a>, <a class="ref" href="#XREFfeather">feather</a>, <a class="ref" href="#XREFplot">plot</a>.
</p></dd></dl>
<a class="anchor" id="XREFquiver3"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-quiver3"><span><strong class="def-name">quiver3</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>)</code><a class="copiable-link" href="#index-quiver3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-quiver3-1"><span><strong class="def-name">quiver3</strong> <code class="def-code-arguments">(<var class="var">z</var>, <var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>)</code><a class="copiable-link" href="#index-quiver3-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-quiver3-2"><span><strong class="def-name">quiver3</strong> <code class="def-code-arguments">(…, <var class="var">s</var>)</code><a class="copiable-link" href="#index-quiver3-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-quiver3-3"><span><strong class="def-name">quiver3</strong> <code class="def-code-arguments">(…, <var class="var">style</var>)</code><a class="copiable-link" href="#index-quiver3-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-quiver3-4"><span><strong class="def-name">quiver3</strong> <code class="def-code-arguments">(…, "filled")</code><a class="copiable-link" href="#index-quiver3-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-quiver3-5"><span><strong class="def-name">quiver3</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-quiver3-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-quiver3-6"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">quiver3</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-quiver3-6"> ¶</a></span></dt>
<dd>
<p>Plot a 3-D vector field with arrows.
</p>
<p>Plot the (<var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>) components of a vector field at the
grid points defined by (<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>). If the grid is uniform
then <var class="var">x</var>, <var class="var">y</var>, and <var class="var">z</var> can be specified as grid vectors and
<code class="code">meshgrid</code> is used to create the 3-D grid.
</p>
<p>If <var class="var">x</var> and <var class="var">y</var> are not given they are assumed to be
<code class="code">(1:<var class="var">m</var>, 1:<var class="var">n</var>)</code> where
<code class="code">[<var class="var">m</var>, <var class="var">n</var>] = size (<var class="var">u</var>)</code>.
</p>
<p>The optional input <var class="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
or <code class="code">"off"</code> 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 class="var">style</var>
of the same format as the <code class="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 class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>). When a marker is specified,
the arrowhead is not drawn. If the argument <code class="code">"filled"</code> is given then
the markers are filled. If name-value plot style properties are used, they
must appear in pairs and follow any other plot style arguments.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to 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">
<div class="group"><pre class="example-preformatted">[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, "maxheadsize", 0.33);
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFquiver">quiver</a>, <a class="ref" href="#XREFcompass">compass</a>, <a class="ref" href="#XREFfeather">feather</a>, <a class="ref" href="#XREFplot">plot</a>.
</p></dd></dl>
<a class="anchor" id="XREFstreamribbon"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-streamribbon"><span><strong class="def-name">streamribbon</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>, <var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>)</code><a class="copiable-link" href="#index-streamribbon"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamribbon-1"><span><strong class="def-name">streamribbon</strong> <code class="def-code-arguments">(<var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>, <var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>)</code><a class="copiable-link" href="#index-streamribbon-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamribbon-2"><span><strong class="def-name">streamribbon</strong> <code class="def-code-arguments">(<var class="var">xyz</var>, <var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">anlr_spd</var>, <var class="var">lin_spd</var>)</code><a class="copiable-link" href="#index-streamribbon-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamribbon-3"><span><strong class="def-name">streamribbon</strong> <code class="def-code-arguments">(<var class="var">xyz</var>, <var class="var">anlr_spd</var>, <var class="var">lin_spd</var>)</code><a class="copiable-link" href="#index-streamribbon-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamribbon-4"><span><strong class="def-name">streamribbon</strong> <code class="def-code-arguments">(<var class="var">xyz</var>, <var class="var">anlr_rot</var>)</code><a class="copiable-link" href="#index-streamribbon-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamribbon-5"><span><strong class="def-name">streamribbon</strong> <code class="def-code-arguments">(…, <var class="var">width</var>)</code><a class="copiable-link" href="#index-streamribbon-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamribbon-6"><span><strong class="def-name">streamribbon</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-streamribbon-6"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamribbon-7"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">streamribbon</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-streamribbon-7"> ¶</a></span></dt>
<dd><p>Calculate and display streamribbons.
</p>
<p>The streamribbon is constructed by rotating a normal vector around a
streamline according to the angular rotation of the vector field.
</p>
<p>The vector field is given by <code class="code">[<var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>]</code> and is
defined over a rectangular grid given by <code class="code">[<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>]</code>.
The streamribbons start at the seed points
<code class="code">[<var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>]</code>.
</p>
<p><code class="code">streamribbon</code> can be called with a cell array that contains
pre-computed streamline data. To do this, <var class="var">xyz</var> must be created with
the <code class="code">stream3</code> function. <var class="var">lin_spd</var> is the linear speed of the
vector field and can be calculated from <code class="code">[<var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>]</code>
by the square root of the sum of the squares. The angular speed
<var class="var">anlr_spd</var> is the projection of the angular velocity onto the velocity
of the normalized vector field and can be calculated with the <code class="code">curl</code>
command. This option is useful if you need to alter the integrator step
size or the maximum number of streamline vertices.
</p>
<p>Alternatively, ribbons can be created from an array of vertices <var class="var">xyz</var> of
a path curve. <var class="var">anlr_rot</var> contains the angles of rotation around the
edges between adjacent vertices of the path curve.
</p>
<p>The input parameter <var class="var">width</var> sets the width of the streamribbons.
</p>
<p>Streamribbons are colored according to the total angle of rotation along the
ribbon.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the plot objects
created for each streamribbon.
</p>
<p>Example:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">[x, y, z] = meshgrid (0:0.2:4, -1:0.2:1, -1:0.2:1);
u = - x + 10;
v = 10 * z.*x;
w = - 10 * y.*x;
streamribbon (x, y, z, u, v, w, [0, 0], [0, 0.6], [0, 0]);
view (3);
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFstreamline">streamline</a>, <a class="ref" href="#XREFstream3">stream3</a>, <a class="ref" href="#XREFstreamtube">streamtube</a>, <a class="ref" href="#XREFostreamtube">ostreamtube</a>.
</p>
</dd></dl>
<a class="anchor" id="XREFstreamtube"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-streamtube"><span><strong class="def-name">streamtube</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>, <var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>)</code><a class="copiable-link" href="#index-streamtube"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamtube-1"><span><strong class="def-name">streamtube</strong> <code class="def-code-arguments">(<var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>, <var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>)</code><a class="copiable-link" href="#index-streamtube-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamtube-2"><span><strong class="def-name">streamtube</strong> <code class="def-code-arguments">(<var class="var">xyz</var>, <var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">div</var>)</code><a class="copiable-link" href="#index-streamtube-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamtube-3"><span><strong class="def-name">streamtube</strong> <code class="def-code-arguments">(<var class="var">xyz</var>, <var class="var">div</var>)</code><a class="copiable-link" href="#index-streamtube-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamtube-4"><span><strong class="def-name">streamtube</strong> <code class="def-code-arguments">(<var class="var">xyz</var>, <var class="var">dia</var>)</code><a class="copiable-link" href="#index-streamtube-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamtube-5"><span><strong class="def-name">streamtube</strong> <code class="def-code-arguments">(…, <var class="var">options</var>)</code><a class="copiable-link" href="#index-streamtube-5"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamtube-6"><span><strong class="def-name">streamtube</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-streamtube-6"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamtube-7"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">streamtube</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-streamtube-7"> ¶</a></span></dt>
<dd><p>Plot tubes scaled by the divergence along streamlines.
</p>
<p><code class="code">streamtube</code> draws tubes whose diameter is scaled by the divergence of
a vector field. The vector field is given by
<code class="code">[<var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>]</code> and is defined over a rectangular grid
given by <code class="code">[<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>]</code>. The tubes start at the
seed points <code class="code">[<var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>]</code> and are plot along
streamlines.
</p>
<p><code class="code">streamtube</code> can also be called with a cell array containing
pre-computed streamline data. To do this, <var class="var">xyz</var> must be created with
the <code class="code">stream3</code> command. <var class="var">div</var> is used to scale the tubes.
In order to plot tubes scaled by the vector field divergence, <var class="var">div</var>
must be calculated with the <code class="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 class="var">xyz</var>. The tube diameter can be specified by the vertex array <var class="var">dia</var>
or by a constant.
</p>
<p>The input parameter <var class="var">options</var> is a 2-D vector of the form
<code class="code">[<var class="var">scale</var>, <var class="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 class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the plot objects
created for each tube.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFstream3">stream3</a>, <a class="ref" href="#XREFstreamline">streamline</a>, <a class="ref" href="#XREFstreamribbon">streamribbon</a>, <a class="ref" href="#XREFostreamtube">ostreamtube</a>.
</p></dd></dl>
<a class="anchor" id="XREFostreamtube"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-ostreamtube"><span><strong class="def-name">ostreamtube</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>, <var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>)</code><a class="copiable-link" href="#index-ostreamtube"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-ostreamtube-1"><span><strong class="def-name">ostreamtube</strong> <code class="def-code-arguments">(<var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>, <var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>)</code><a class="copiable-link" href="#index-ostreamtube-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-ostreamtube-2"><span><strong class="def-name">ostreamtube</strong> <code class="def-code-arguments">(<var class="var">xyz</var>, <var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>)</code><a class="copiable-link" href="#index-ostreamtube-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-ostreamtube-3"><span><strong class="def-name">ostreamtube</strong> <code class="def-code-arguments">(…, <var class="var">options</var>)</code><a class="copiable-link" href="#index-ostreamtube-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-ostreamtube-4"><span><strong class="def-name">ostreamtube</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-ostreamtube-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-ostreamtube-5"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">ostreamtube</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-ostreamtube-5"> ¶</a></span></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 class="code">[<var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>]</code> and is
defined over a rectangular grid given by <code class="code">[<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>]</code>.
The streamtubes start at the seed points
<code class="code">[<var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>]</code>.
</p>
<p>The tubes are colored based on the local vector field strength.
</p>
<p>The input parameter <var class="var">options</var> is a 2-D vector of the form
<code class="code">[<var class="var">scale</var>, <var class="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 class="code">ostreamtube</code> can be called with a cell array containing pre-computed
streamline data. To do this, <var class="var">xyz</var> must be created with the
<code class="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 class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the plot
objects created for each streamtube.
</p>
<p>Example:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">[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></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFstream3">stream3</a>, <a class="ref" href="#XREFstreamline">streamline</a>, <a class="ref" href="#XREFstreamribbon">streamribbon</a>, <a class="ref" href="#XREFstreamtube">streamtube</a>.
</p></dd></dl>
<a class="anchor" id="XREFstreamline"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-streamline"><span><strong class="def-name">streamline</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>, <var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>)</code><a class="copiable-link" href="#index-streamline"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamline-1"><span><strong class="def-name">streamline</strong> <code class="def-code-arguments">(<var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>, <var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>)</code><a class="copiable-link" href="#index-streamline-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamline-2"><span><strong class="def-name">streamline</strong> <code class="def-code-arguments">(…, <var class="var">options</var>)</code><a class="copiable-link" href="#index-streamline-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamline-3"><span><strong class="def-name">streamline</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-streamline-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-streamline-4"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">streamline</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-streamline-4"> ¶</a></span></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 class="code">[<var class="var">u</var>, <var class="var">v</var>]</code> or <code class="code">[<var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>]</code>. The vector
field is defined over a rectangular grid given by <code class="code">[<var class="var">x</var>, <var class="var">y</var>]</code>
or <code class="code">[<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>]</code>. The streamlines start at the seed
points <code class="code">[<var class="var">sx</var>, <var class="var">sy</var>]</code> or <code class="code">[<var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>]</code>.
</p>
<p>The input parameter <var class="var">options</var> is a 2-D vector of the form
<code class="code">[<var class="var">stepsize</var>, <var class="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 class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the hggroup
comprising the field lines.
</p>
<p>Example:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">[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></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFstream2">stream2</a>, <a class="ref" href="#XREFstream3">stream3</a>, <a class="ref" href="#XREFstreamribbon">streamribbon</a>, <a class="ref" href="#XREFstreamtube">streamtube</a>, <a class="ref" href="#XREFostreamtube">ostreamtube</a>.
</p></dd></dl>
<a class="anchor" id="XREFstream2"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-stream2"><span><code class="def-type"><var class="var">xy</var> =</code> <strong class="def-name">stream2</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">u</var>, <var class="var">v</var>, <var class="var">sx</var>, <var class="var">sy</var>)</code><a class="copiable-link" href="#index-stream2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stream2-1"><span><code class="def-type"><var class="var">xy</var> =</code> <strong class="def-name">stream2</strong> <code class="def-code-arguments">(<var class="var">u</var>, <var class="var">v</var>, <var class="var">sx</var>, <var class="var">sy</var>)</code><a class="copiable-link" href="#index-stream2-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stream2-2"><span><code class="def-type"><var class="var">xy</var> =</code> <strong class="def-name">stream2</strong> <code class="def-code-arguments">(…, <var class="var">options</var>)</code><a class="copiable-link" href="#index-stream2-2"> ¶</a></span></dt>
<dd><p>Compute 2-D streamline data.
</p>
<p>Calculates streamlines of a vector field given by <code class="code">[<var class="var">u</var>, <var class="var">v</var>]</code>.
The vector field is defined over a rectangular grid given by
<code class="code">[<var class="var">x</var>, <var class="var">y</var>]</code>. The streamlines start at the seed points
<code class="code">[<var class="var">sx</var>, <var class="var">sy</var>]</code>. The returned value <var class="var">xy</var> contains a cell
array of vertex arrays. If the starting point is outside the vector field,
<code class="code">[]</code> is returned.
</p>
<p>The input parameter <var class="var">options</var> is a 2-D vector of the form
<code class="code">[<var class="var">stepsize</var>, <var class="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 class="var">xy</var> is a nverts x 2 matrix containing the
coordinates of the field line segments.
</p>
<p>Example:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">[x, y] = meshgrid (0:3);
u = 2 * x;
v = y;
xy = stream2 (x, y, u, v, 1.0, 0.5);
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFstreamline">streamline</a>, <a class="ref" href="#XREFstream3">stream3</a>.
</p></dd></dl>
<a class="anchor" id="XREFstream3"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-stream3"><span><code class="def-type"><var class="var">xyz</var> =</code> <strong class="def-name">stream3</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>, <var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>)</code><a class="copiable-link" href="#index-stream3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stream3-1"><span><code class="def-type"><var class="var">xyz</var> =</code> <strong class="def-name">stream3</strong> <code class="def-code-arguments">(<var class="var">u</var>, <var class="var">v</var>, <var class="var">w</var>, <var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>)</code><a class="copiable-link" href="#index-stream3-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-stream3-2"><span><code class="def-type"><var class="var">xyz</var> =</code> <strong class="def-name">stream3</strong> <code class="def-code-arguments">(…, <var class="var">options</var>)</code><a class="copiable-link" href="#index-stream3-2"> ¶</a></span></dt>
<dd><p>Compute 3-D streamline data.
</p>
<p>Calculate streamlines of a vector field given by <code class="code">[<var class="var">u</var>, <var class="var">v</var>,
<var class="var">w</var>]</code>. The vector field is defined over a rectangular grid given by
<code class="code">[<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>]</code>. The streamlines start at the seed
points <code class="code">[<var class="var">sx</var>, <var class="var">sy</var>, <var class="var">sz</var>]</code>. The returned value <var class="var">xyz</var>
contains a cell array of vertex arrays. If the starting point is outside
the vector field, <code class="code">[]</code> is returned.
</p>
<p>The input parameter <var class="var">options</var> is a 2-D vector of the form
<code class="code">[<var class="var">stepsize</var>, <var class="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 class="var">xyz</var> is a nverts x 3 matrix containing the
coordinates of the field line segments.
</p>
<p>Example:
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">[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></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFstream2">stream2</a>, <a class="ref" href="#XREFstreamline">streamline</a>, <a class="ref" href="#XREFstreamribbon">streamribbon</a>, <a class="ref" href="#XREFstreamtube">streamtube</a>, <a class="ref" href="#XREFostreamtube">ostreamtube</a>.
</p></dd></dl>
<a class="anchor" id="XREFcompass"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-compass"><span><strong class="def-name">compass</strong> <code class="def-code-arguments">(<var class="var">u</var>, <var class="var">v</var>)</code><a class="copiable-link" href="#index-compass"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-compass-1"><span><strong class="def-name">compass</strong> <code class="def-code-arguments">(<var class="var">z</var>)</code><a class="copiable-link" href="#index-compass-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-compass-2"><span><strong class="def-name">compass</strong> <code class="def-code-arguments">(…, <var class="var">style</var>)</code><a class="copiable-link" href="#index-compass-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-compass-3"><span><strong class="def-name">compass</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-compass-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-compass-4"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">compass</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-compass-4"> ¶</a></span></dt>
<dd>
<p>Plot the <code class="code">(<var class="var">u</var>, <var class="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 class="var">u</var>(i), <var class="var">v</var>(i)]. If a single complex argument <var class="var">z</var> is given,
then <code class="code"><var class="var">u</var> = real (<var class="var">z</var>)</code> and <code class="code"><var class="var">v</var> = imag (<var class="var">z</var>)</code>.
</p>
<p>The style to use for the plot can be defined with a line style <var class="var">style</var>
of the same format as the <code class="code">plot</code> command.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a vector of graphics handles to the
line objects representing the drawn vectors.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">a = toeplitz ([1;randn(9,1)], [1,randn(1,9)]);
compass (eig (a));
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFpolar">polar</a>, <a class="ref" href="#XREFfeather">feather</a>, <a class="ref" href="#XREFquiver">quiver</a>, <a class="ref" href="#XREFrose">rose</a>, <a class="ref" href="#XREFplot">plot</a>.
</p></dd></dl>
<a class="anchor" id="XREFfeather"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-feather"><span><strong class="def-name">feather</strong> <code class="def-code-arguments">(<var class="var">u</var>, <var class="var">v</var>)</code><a class="copiable-link" href="#index-feather"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-feather-1"><span><strong class="def-name">feather</strong> <code class="def-code-arguments">(<var class="var">z</var>)</code><a class="copiable-link" href="#index-feather-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-feather-2"><span><strong class="def-name">feather</strong> <code class="def-code-arguments">(…, <var class="var">style</var>)</code><a class="copiable-link" href="#index-feather-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-feather-3"><span><strong class="def-name">feather</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-feather-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-feather-4"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">feather</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-feather-4"> ¶</a></span></dt>
<dd>
<p>Plot the <code class="code">(<var class="var">u</var>, <var class="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 class="var">z</var> is given, then
<code class="code"><var class="var">u</var> = real (<var class="var">z</var>)</code> and <code class="code"><var class="var">v</var> = imag (<var class="var">z</var>)</code>.
</p>
<p>The style to use for the plot can be defined with a line style <var class="var">style</var>
of the same format as the <code class="code">plot</code> command.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a vector of graphics handles to the
line objects representing the drawn vectors.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">phi = [0 : 15 : 360] * pi/180;
feather (sin (phi), cos (phi));
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFplot">plot</a>, <a class="ref" href="#XREFquiver">quiver</a>, <a class="ref" href="#XREFcompass">compass</a>.
</p></dd></dl>
<a class="anchor" id="XREFpcolor"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-pcolor"><span><strong class="def-name">pcolor</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">c</var>)</code><a class="copiable-link" href="#index-pcolor"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pcolor-1"><span><strong class="def-name">pcolor</strong> <code class="def-code-arguments">(<var class="var">c</var>)</code><a class="copiable-link" href="#index-pcolor-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pcolor-2"><span><strong class="def-name">pcolor</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-pcolor-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-pcolor-3"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">pcolor</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-pcolor-3"> ¶</a></span></dt>
<dd><p>Produce a 2-D density plot.
</p>
<p>A <code class="code">pcolor</code> plot draws rectangles with colors from the matrix <var class="var">c</var>
over the two-dimensional region represented by the matrices <var class="var">x</var> and
<var class="var">y</var>. <var class="var">x</var> and <var class="var">y</var> are the coordinates of the mesh’s vertices
and are typically the output of <code class="code">meshgrid</code>. If <var class="var">x</var> and <var class="var">y</var> are
vectors, then a typical vertex is (<var class="var">x</var>(j), <var class="var">y</var>(i), <var class="var">c</var>(i,j)).
Thus, columns of <var class="var">c</var> correspond to different <var class="var">x</var> values and rows
of <var class="var">c</var> correspond to different <var class="var">y</var> values.
</p>
<p>The values in <var class="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 class="code">clim</code>, or by setting the <code class="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 class="var">c</var> for each of the cell’s vertices; Contrast this with
<code class="code">imagesc</code> which renders one cell for each element of <var class="var">c</var>.
</p>
<p><code class="code">shading</code> modifies an attribute determining the manner by which the
face color of each cell is interpolated from the values of <var class="var">c</var>,
and the visibility of the cells’ edges. By default the attribute is
<code class="code">"faceted"</code>, which renders a single color for each cell’s face with
the edge visible.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the created
surface object.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="Axis-Configuration.html#XREFclim">clim</a>, <a class="ref" href="Three_002dDimensional-Plots.html#XREFshading">shading</a>, <a class="ref" href="Three_002dDimensional-Plots.html#XREFmeshgrid">meshgrid</a>, <a class="ref" href="#XREFcontour">contour</a>, <a class="ref" href="Displaying-Images.html#XREFimagesc">imagesc</a>.
</p></dd></dl>
<a class="anchor" id="XREFarea"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-area"><span><strong class="def-name">area</strong> <code class="def-code-arguments">(<var class="var">y</var>)</code><a class="copiable-link" href="#index-area"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-area-1"><span><strong class="def-name">area</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-area-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-area-2"><span><strong class="def-name">area</strong> <code class="def-code-arguments">(…, <var class="var">lvl</var>)</code><a class="copiable-link" href="#index-area-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-area-3"><span><strong class="def-name">area</strong> <code class="def-code-arguments">(…, <var class="var">prop</var>, <var class="var">val</var>, …)</code><a class="copiable-link" href="#index-area-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-area-4"><span><strong class="def-name">area</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-area-4"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-area-5"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">area</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-area-5"> ¶</a></span></dt>
<dd><p>Area plot of the columns of <var class="var">y</var>.
</p>
<p>This plot shows the contributions of each column value to the row sum.
It is functionally similar to <code class="code">plot (<var class="var">x</var>, cumsum (<var class="var">y</var>, 2))</code>,
except that the area under the curve is shaded.
</p>
<p>If the <var class="var">x</var> argument is omitted it defaults to <code class="code">1:rows (<var class="var">y</var>)</code>.
A value <var class="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 class="ref" href="Patch-Properties.html">Patch Properties</a>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a graphics handle to the hggroup
object comprising the area patch objects. The <code class="code">"BaseValue"</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">
<div class="group"><pre class="example-preformatted">t = linspace (0, 2*pi, 100)';
y = [sin(t).^2, cos(t).^2];
area (t, y);
legend ("sin^2", "cos^2", "location", "NorthEastOutside");
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFplot">plot</a>, <a class="ref" href="Creating-Graphics-Objects.html#XREFpatch">patch</a>.
</p></dd></dl>
<a class="anchor" id="XREFfill"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-fill"><span><strong class="def-name">fill</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">c</var>)</code><a class="copiable-link" href="#index-fill"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-fill-1"><span><strong class="def-name">fill</strong> <code class="def-code-arguments">(<var class="var">x1</var>, <var class="var">y1</var>, <var class="var">c1</var>, <var class="var">x2</var>, <var class="var">y2</var>, <var class="var">c2</var>)</code><a class="copiable-link" href="#index-fill-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-fill-2"><span><strong class="def-name">fill</strong> <code class="def-code-arguments">(…, <var class="var">prop</var>, <var class="var">val</var>)</code><a class="copiable-link" href="#index-fill-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-fill-3"><span><strong class="def-name">fill</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-fill-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-fill-4"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">fill</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-fill-4"> ¶</a></span></dt>
<dd><p>Create one or more filled 2-D polygons.
</p>
<p>The inputs <var class="var">x</var> and <var class="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 class="code">fill</code> will close any open
polygons before plotting.
</p>
<p>The input <var class="var">c</var> determines the color of the polygon. The simplest form
is a single color specification such as a <code class="code">plot</code> format or an
RGB-triple. In this case the polygon(s) will have one unique color. If
<var class="var">c</var> is a vector or matrix then the color data is first scaled using
<code class="code">clim</code> and then indexed into the current colormap. A row vector will
color each polygon (a column from matrices <var class="var">x</var> and <var class="var">y</var>) with a
single computed color. A matrix <var class="var">c</var> of the same size as <var class="var">x</var> and
<var class="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 class="ref" href="Patch-Properties.html">Patch Properties</a>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a vector of graphics handles to
the created patch objects.
</p>
<p>Example: red square
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">vertices = [0 0
1 0
1 1
0 1];
fill (vertices(:,1), vertices(:,2), "r");
axis ([-0.5 1.5, -0.5 1.5])
axis equal
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="Creating-Graphics-Objects.html#XREFpatch">patch</a>, <a class="ref" href="#XREFfill3">fill3</a>, <a class="ref" href="Axis-Configuration.html#XREFclim">clim</a>, <a class="ref" href="Representing-Images.html#XREFcolormap">colormap</a>.
</p></dd></dl>
<a class="anchor" id="XREFfill3"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-fill3"><span><strong class="def-name">fill3</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">c</var>)</code><a class="copiable-link" href="#index-fill3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-fill3-1"><span><strong class="def-name">fill3</strong> <code class="def-code-arguments">(<var class="var">x1</var>, <var class="var">y1</var>, <var class="var">z1</var>, <var class="var">c1</var>, <var class="var">x2</var>, <var class="var">y2</var>, <var class="var">z2</var>, <var class="var">c2</var>)</code><a class="copiable-link" href="#index-fill3-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-fill3-2"><span><strong class="def-name">fill3</strong> <code class="def-code-arguments">(…, <var class="var">prop</var>, <var class="var">val</var>)</code><a class="copiable-link" href="#index-fill3-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-fill3-3"><span><strong class="def-name">fill3</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-fill3-3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-fill3-4"><span><code class="def-type"><var class="var">h</var> =</code> <strong class="def-name">fill3</strong> <code class="def-code-arguments">(…)</code><a class="copiable-link" href="#index-fill3-4"> ¶</a></span></dt>
<dd><p>Create one or more filled 3-D polygons.
</p>
<p>The inputs <var class="var">x</var>, <var class="var">y</var>, and <var class="var">z</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 class="code">fill3</code> will
close any open polygons before plotting.
</p>
<p>The input <var class="var">c</var> determines the color of the polygon. The simplest form
is a single color specification such as a <code class="code">plot</code> format or an
RGB-triple. In this case the polygon(s) will have one unique color. If
<var class="var">c</var> is a vector or matrix then the color data is first scaled using
<code class="code">clim</code> and then indexed into the current colormap. A row vector will
color each polygon (a column from matrices <var class="var">x</var>, <var class="var">y</var>, and <var class="var">z</var>)
with a single computed color. A matrix <var class="var">c</var> of the same size as <var class="var">x</var>,
<var class="var">y</var>, and <var class="var">z</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 class="ref" href="Patch-Properties.html">Patch Properties</a>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p>The optional return value <var class="var">h</var> is a vector of graphics handles to
the created patch objects.
</p>
<p>Example: oblique red rectangle
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">vertices = [0 0 0
1 1 0
1 1 1
0 0 1];
fill3 (vertices(:,1), vertices(:,2), vertices(:,3), "r");
axis ([-0.5 1.5, -0.5 1.5, -0.5 1.5]);
axis ("equal");
grid ("on");
view (-80, 25);
</pre></div></div>
<p><strong class="strong">See also:</strong> <a class="ref" href="Creating-Graphics-Objects.html#XREFpatch">patch</a>, <a class="ref" href="#XREFfill">fill</a>, <a class="ref" href="Axis-Configuration.html#XREFclim">clim</a>, <a class="ref" href="Representing-Images.html#XREFcolormap">colormap</a>.
</p></dd></dl>
<a class="anchor" id="XREFcomet"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-comet"><span><strong class="def-name">comet</strong> <code class="def-code-arguments">(<var class="var">y</var>)</code><a class="copiable-link" href="#index-comet"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-comet-1"><span><strong class="def-name">comet</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>)</code><a class="copiable-link" href="#index-comet-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-comet-2"><span><strong class="def-name">comet</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">p</var>)</code><a class="copiable-link" href="#index-comet-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-comet-3"><span><strong class="def-name">comet</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-comet-3"> ¶</a></span></dt>
<dd><p>Produce a simple comet style animation along the trajectory provided by
the input coordinate vectors (<var class="var">x</var>, <var class="var">y</var>).
</p>
<p>If <var class="var">x</var> is not specified it defaults to the indices of <var class="var">y</var>.
</p>
<p>The speed of the comet may be controlled by <var class="var">p</var>, which represents the
time each point is displayed before moving to the next one. The default for
<var class="var">p</var> is <code class="code">5 / numel (<var class="var">y</var>)</code>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFcomet3">comet3</a>.
</p></dd></dl>
<a class="anchor" id="XREFcomet3"></a><span style="display:block; margin-top:-4.5ex;"> </span>
<dl class="first-deftypefn">
<dt class="deftypefn" id="index-comet3"><span><strong class="def-name">comet3</strong> <code class="def-code-arguments">(<var class="var">z</var>)</code><a class="copiable-link" href="#index-comet3"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-comet3-1"><span><strong class="def-name">comet3</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>)</code><a class="copiable-link" href="#index-comet3-1"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-comet3-2"><span><strong class="def-name">comet3</strong> <code class="def-code-arguments">(<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>, <var class="var">p</var>)</code><a class="copiable-link" href="#index-comet3-2"> ¶</a></span></dt>
<dt class="deftypefnx def-cmd-deftypefn" id="index-comet3-3"><span><strong class="def-name">comet3</strong> <code class="def-code-arguments">(<var class="var">hax</var>, …)</code><a class="copiable-link" href="#index-comet3-3"> ¶</a></span></dt>
<dd><p>Produce a simple comet style animation along the trajectory provided by
the input coordinate vectors (<var class="var">x</var>, <var class="var">y</var>, <var class="var">z</var>).
</p>
<p>If only <var class="var">z</var> is specified then <var class="var">x</var>, <var class="var">y</var> default to the indices
of <var class="var">z</var>.
</p>
<p>The speed of the comet may be controlled by <var class="var">p</var>, which represents the
time each point is displayed before moving to the next one. The default for
<var class="var">p</var> is <code class="code">5 / numel (<var class="var">z</var>)</code>.
</p>
<p>If the first argument <var class="var">hax</var> is an axes handle, then plot into this axes,
rather than the current axes returned by <code class="code">gca</code>.
</p>
<p><strong class="strong">See also:</strong> <a class="ref" href="#XREFcomet">comet</a>.
</p></dd></dl>
<ul class="mini-toc">
<li><a href="Axis-Configuration.html" accesskey="1">Axis Configuration</a></li>
<li><a href="Two_002ddimensional-Function-Plotting.html" accesskey="2">Two-dimensional Function Plotting</a></li>
<li><a href="Two_002ddimensional-Geometric-Shapes.html" accesskey="3">Two-dimensional Geometric Shapes</a></li>
</ul>
</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Three_002dDimensional-Plots.html">Three-Dimensional Plots</a>, Up: <a href="High_002dLevel-Plotting.html">High-Level Plotting</a> [<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>
|