This file is indexed.

/usr/share/doc/mathgl/mgl_en.html is in mathgl-doc-en 2.1.3.1-4ubuntu3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   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
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- This manual is for MathGL (version 2.1.3), a collection of classes and routines for scientific plotting. Please report any errors in this manual to mathgl.abalakin@gmail.org.

Copyright C 2008-2012 Alexey A. Balakin.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts.  A copy of the license is included in the section entitled "GNU
Free Documentation License."


 -->
<!-- Created on December 22, 2013 by texi2html 1.82
texi2html was written by: 
            Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>MGL script language for version 2.1.3</title>

<meta name="description" content="MGL script language for version 2.1.3">
<meta name="keywords" content="MGL script language for version 2.1.3">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<a name="Top"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="MGL-script-language"></a>
<h1 class="settitle">MGL script language</h1>

<p>This file documents the MGL script language. It corresponds to release 2.1.3 of the MathGL library. Please report any errors in this manual to <a href="mailto:mathgl.abalakin@gmail.org">mathgl.abalakin@gmail.org</a>. More information about MGL and MathGL can be found at the project homepage, <a href="http://mathgl.sourceforge.net/">http://mathgl.sourceforge.net/</a>.
</p>
<p>Copyright &copy; 2008-2012 Alexey A. Balakin.
</p>
<blockquote><p>Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts.  A copy of the license is included in the section entitled &ldquo;GNU
Free Documentation License.&rdquo;
</p></blockquote>



<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#MGL-scripts">1. MGL scripts</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#General-concepts">2. General concepts</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#MathGL-core">3. MathGL core</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Data-processing">4. Data processing</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Examples">5. MathGL examples</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Symbols-and-hot_002dkeys">A. Symbols and hot-keys</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Copying-This-Manual">B. GNU Free Documentation License</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Index">Index</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>






<hr size="1">
<a name="MGL-scripts"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Top" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MGL-definition" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>

<a name="MGL-scripts-1"></a>
<h1 class="chapter">1. MGL scripts</h1>

<p>MathGL library supports the simplest scripts for data handling and plotting. These scripts can be used independently (with the help of UDAV, mglconv, mglview programs and others
</p>

<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#MGL-definition">1.1 MGL definition</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>



<hr size="6">
<a name="MGL-definition"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#MGL-scripts" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Program-flow-commands" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MGL-scripts" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MGL-scripts" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="MGL-definition-1"></a>
<h2 class="section">1.1 MGL definition</h2>

<p>MGL script language is rather simple. Each string is a command. First word of string is the name of command. Other words are command arguments. Command may have up to 1000 arguments (at least for now). Words are separated from each other by space or tabulation symbol. The upper or lower case of words is important, i.e. variables <var>a</var> and <var>A</var> are different variables. Symbol &lsquo;<samp>#</samp>&rsquo; starts the comment (all characters after # will be ignored). The exception is situation when &lsquo;<samp>#</samp>&rsquo; is a part of some string. Also options can be specified after symbol &lsquo;<samp>;</samp>&rsquo; (see section <a href="#Command-options">Command options</a>). Symbol &lsquo;<samp>:</samp>&rsquo; starts new command (like new line character) if it is not placed inside a string or inside brackets.
</p>
<p>If string contain references to external parameters (substrings &lsquo;<samp>$0</samp>&rsquo;, &lsquo;<samp>$1</samp>&rsquo; ... &lsquo;<samp>$9</samp>&rsquo;) or definitions (substrings &lsquo;<samp>$a</samp>&rsquo;, &lsquo;<samp>$b</samp>&rsquo; ... &lsquo;<samp>$z</samp>&rsquo;) then before execution the values of parameter/definition will be substituted instead of reference. It allows to use the same MGL script for different parameters (filenames, paths, condition and so on).
</p>
<p>Argument can be a string, a variable (data arrays) or a number (scalars).
</p><ul>
<li>
The string is any symbols between ordinary marks &lsquo;<samp>'</samp>&rsquo;. Long strings can be concatenated from several lines by &lsquo;<samp>\</samp>&rsquo; symbol. I.e. the string &lsquo;<samp>'a +'\&lt;br&gt;' b'</samp>&rsquo; will give string &lsquo;<samp>'a + b'</samp>&rsquo; (here &lsquo;<samp>&lt;br&gt;</samp>&rsquo; is newline). Also you can concatenate strings and numbers using &lsquo;<samp>,</samp>&rsquo; with out spaces (for example, &lsquo;<samp>'max(u)=',u.max,' a.u.'</samp>&rsquo;).

</li><li>
Usually variable have a name which is arbitrary combination of symbols (except spaces and &lsquo;<samp>'</samp>&rsquo;) started from a letter and with length less than 64. A temporary array can be used as variable:
<ul>
<li>
sub-arrays (like in <a href="#subdata">subdata</a> command) as command argument. For example, <code>a(1)</code> or <code>a(1,:)</code> or <code>a(1,:,:)</code> is second row, <code>a(:,2)</code> or <code>a(:,2,:)</code> is third column, <code>a(:,:,0)</code> is first slice and so on. Also you can extract a part of array from m-th to n-th element by code <code>a(m:n,:,:)</code> or just <code>a(m:n)</code>.

</li><li>
any column combinations defined by formulas, like <code>a('n*w^2/exp(t)')</code> if names for data columns was specified (by <a href="#idset">idset</a> command or in the file at string started with <code>##</code>).

</li><li>
any expression (without spaces) of existed variables produce temporary variable. For example, &lsquo;<samp>sqrt(dat(:,5)+1)</samp>&rsquo; will produce temporary variable with data values equal to <code>tmp[i,j] = sqrt(dat[i,5,j]+1)</code>.

</li><li>
temporary variable of higher dimensions by help of []. For example, &lsquo;<samp>[1,2,3]</samp>&rsquo; will produce a temporary vector of 3 elements {1, 2, 3}; &lsquo;<samp>[[11,12],[21,22]]</samp>&rsquo; will produce matrix 2*2 and so on. Here you can join even an arrays of the same dimensions by construction like &lsquo;<samp>[v1,v2,...,vn]</samp>&rsquo;.

</li><li>
result of code for making new data (see section <a href="#Make-another-data">Make another data</a>) inside {}. For example, &lsquo;<samp>{sum dat 'x'}</samp>&rsquo; produce temporary variable which contain result of summation of <var>dat</var> along direction &rsquo;x&rsquo;. This is the same array <var>tmp</var> as produced by command &lsquo;<samp>sum tmp dat 'x'</samp>&rsquo;. You can use nested constructions, like &lsquo;<samp>{sum {max dat 'z'} 'x'}</samp>&rsquo;.
</li></ul>
<p>Temporary variables can not be used as 1st argument for commands which create (return) the data (like &lsquo;<samp>new</samp>&rsquo;, &lsquo;<samp>read</samp>&rsquo;, &lsquo;<samp>hist</samp>&rsquo; and so on).
</p>
</li><li>
Special names <code>nan=#QNAN, pi=3.1415926..., on=1, off=0, :=-1</code> are treated as number if they were not redefined by user. Variables with suffixes are treated as numbers (see section <a href="#Data-information">Data information</a>). Names defined by <a href="#define">define</a> command are treated as number. Also results of formulas with sizes 1x1x1 are treated as number (for example, &lsquo;<samp>pi/dat.nx</samp>&rsquo;).
</li></ul>
<p>Before the first using all variables must be defined with the help of commands, like, <a href="#new">new</a>, <a href="#var">var</a>, <a href="#list">list</a>, <a href="#copy">copy</a>, <a href="#read">read</a>, <a href="#hist">hist</a>, <a href="#sum">sum</a> and so on (see sections <a href="#Data-constructor">Data constructor</a>, <a href="#Data-filling">Data filling</a> and <a href="#Make-another-data">Make another data</a>).
</p>
<p>Command may have several set of possible arguments (for example, <code>plot ydat</code> and <code>plot xdat ydat</code>). All command arguments for a selected set must be specified. However, some arguments can have default values. These argument are printed in [], like <code>text ydat ['stl'='']</code> or <code>text x y 'txt' ['fnt'='' size=-1]</code>. At this, the record <code>[arg1 arg2 arg3 ...]</code> means <code>[arg1 [arg2 [arg3 ...]]]</code>, i.e. you can omit only tailing arguments if you agree with its default values. For example, <code>text x y 'txt' '' 1</code> or <code>text x y 'txt' ''</code> is correct, but <code>text x y 'txt' 1</code> is incorrect (argument <code>'fnt'</code> is missed).
</p>


<hr size="6">
<a name="Program-flow-commands"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#MGL-definition" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MGL-scripts" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MGL-scripts" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Program-flow-commands-1"></a>
<h2 class="section">1.2 Program flow commands</h2>

<p>Below I show commands to control program flow, like, conditions, loops, define script arguments and so on. Other commands can be found in chapters <a href="#MathGL-core">MathGL core</a> and <a href="#Data-processing">Data processing</a>. Note, that some of program flow commands (like <a href="#define">define</a>, <a href="#ask">ask</a>, <a href="#call">call</a>, <a href="#for">for</a>, <a href="#func">func</a>) should be placed alone in the string.
</p>
<a name="index-chdir"></a>
<p><a name="chdir"></a>
</p><dl>
<dt><a name="index-chdir-1"></a><u>MGL command:</u> <b>chdir</b><i> 'path'</i></dt>
<dd><p>Changes the current directory to <var>path</var>.
</p></dd></dl>

<a name="index-ask"></a>
<p><a name="ask"></a>
</p><dl>
<dt><a name="index-ask-1"></a><u>MGL command:</u> <b>ask</b><i> $N 'question'</i></dt>
<dd><p>Sets <var>N</var>-th script argument to answer which give the user on the <var>question</var>. Usually this show dialog with question where user can enter some text as answer. Here <var>N</var> is digit (0...9) or alpha (a...z).
</p></dd></dl>

<a name="index-define"></a>
<p><a name="define"></a>
</p><dl>
<dt><a name="index-define-1"></a><u>MGL command:</u> <b>define</b><i> $N smth</i></dt>
<dd><p>Sets <var>N</var>-th script argument to <var>smth</var>. Note, that <var>smth</var> is used as is (with &lsquo;<samp>'</samp>&rsquo; symbols if present). Here <var>N</var> is digit (0...9) or alpha (a...z).
</p></dd></dl>
<dl>
<dt><a name="index-define-2"></a><u>MGL command:</u> <b>define</b><i> name smth</i></dt>
<dd><p>Create scalar variable <code>name</code> which have the numeric value of <code>smth</code>. Later you can use this variable as usual number. Here <var>N</var> is digit (0...9) or alpha (a...z).
</p></dd></dl>
<a name="index-defchr"></a>
<p><a name="defchr"></a>
</p><dl>
<dt><a name="index-defchr-1"></a><u>MGL command:</u> <b>defchr</b><i> $N smth</i></dt>
<dd><p>Sets <var>N</var>-th script argument to character with value evaluated from <var>smth</var>. Here <var>N</var> is digit (0...9) or alpha (a...z).
</p></dd></dl>
<a name="index-defnum"></a>
<p><a name="defnum"></a>
</p><dl>
<dt><a name="index-defnum-1"></a><u>MGL command:</u> <b>defnum</b><i> $N smth</i></dt>
<dd><p>Sets <var>N</var>-th script argument to number with value evaluated from <var>smth</var>. Here <var>N</var> is digit (0...9) or alpha (a...z).
</p></dd></dl>
<a name="index-defpal"></a>
<p><a name="defpal"></a>
</p><dl>
<dt><a name="index-defpal-1"></a><u>MGL command:</u> <b>defpal</b><i> $N smth</i></dt>
<dd><p>Sets <var>N</var>-th script argument to palette character at position evaluated from <var>smth</var>. Here <var>N</var> is digit (0...9) or alpha (a...z).
</p></dd></dl>

<a name="index-call"></a>
<p><a name="call"></a>
</p><dl>
<dt><a name="index-call-1"></a><u>MGL command:</u> <b>call</b><i> 'fname' [ARG1 ARG2 ... ARG9]</i></dt>
<dd><p>Executes function <var>fname</var> (or script if function is not found). Optional arguments will be passed to functions. See also <a href="#func">func</a>.
</p></dd></dl>
<a name="index-func"></a>
<p><a name="func"></a>
</p><dl>
<dt><a name="index-func-1"></a><u>MGL command:</u> <b>func</b><i> 'fname' [narg=0]</i></dt>
<dd><p>Define the function <var>fname</var> and number of required arguments. The arguments will be placed in script parameters $1, $2, ... $9. Note, you should stop script execution before function definition(s) by command <a href="#stop">stop</a>. See also <a href="#return">return</a>.
</p></dd></dl>
<a name="index-return"></a>
<p><a name="return"></a>
</p><dl>
<dt><a name="index-return-1"></a><u>MGL command:</u> <b>return</b></dt>
<dd><p>Return from the function. See also <a href="#func">func</a>.
</p></dd></dl>


<a name="index-if"></a>
<p><a name="if"></a>
</p><dl>
<dt><a name="index-if-1"></a><u>MGL command:</u> <b>if</b><i> dat 'cond'</i></dt>
<dd><p>Starts block which will be executed if <var>dat</var> satisfy to <var>cond</var>.
</p></dd></dl>
<dl>
<dt><a name="index-if-2"></a><u>MGL command:</u> <b>if</b><i> <code>val</code></i></dt>
<dd><p>Starts block which will be executed if <code>val</code> is nonzero.
</p></dd></dl>
<a name="index-elseif"></a>
<p><a name="elseif"></a>
</p><dl>
<dt><a name="index-elseif-1"></a><u>MGL command:</u> <b>elseif</b><i> dat 'cond'</i></dt>
<dd><p>Starts block which will be executed if previous <code>if</code> or <code>elseif</code> is false and <var>dat</var> satisfy to <var>cond</var>.
</p></dd></dl>
<dl>
<dt><a name="index-elseif-2"></a><u>MGL command:</u> <b>elseif</b><i> <code>val</code></i></dt>
<dd><p>Starts block which will be executed if previous <code>if</code> or <code>elseif</code> is false and <code>val</code> is nonzero.
</p></dd></dl>
<a name="index-else"></a>
<p><a name="else"></a>
</p><dl>
<dt><a name="index-else-1"></a><u>MGL command:</u> <b>else</b></dt>
<dd><p>Starts block which will be executed if previous <code>if</code> or <code>elseif</code> is false.
</p></dd></dl>
<a name="index-endif"></a>
<p><a name="endif"></a>
</p><dl>
<dt><a name="index-endif-1"></a><u>MGL command:</u> <b>endif</b></dt>
<dd><p>Finishes <code>if/elseif/else</code> block.
</p></dd></dl>

<a name="index-for"></a>
<p><a name="for"></a>
</p><dl>
<dt><a name="index-for-1"></a><u>MGL command:</u> <b>for</b><i> $N <code>v1 v2 [dv=1]</code></i></dt>
<dd><p>Starts cycle with $<var>N</var>-th argument changing from <var>v1</var> to <var>v2</var> with the step <var>dv</var>. Here <var>N</var> is digit (0...9) or alpha (a...z).
</p></dd></dl>
<dl>
<dt><a name="index-for-2"></a><u>MGL command:</u> <b>for</b><i> $N dat</i></dt>
<dd><p>Starts cycle with $<var>N</var>-th argument changing for <var>dat</var> values. Here <var>N</var> is digit (0...9) or alpha (a...z).
</p></dd></dl>
<a name="index-next"></a>
<p><a name="next"></a>
</p><dl>
<dt><a name="index-next-1"></a><u>MGL command:</u> <b>next</b></dt>
<dd><p>Finishes <code>for</code> cycle.
</p></dd></dl>

<a name="index-once"></a>
<p><a name="once"></a>
</p><dl>
<dt><a name="index-once-1"></a><u>MGL command:</u> <b>once</b><i> <code>val</code></i></dt>
<dd><p>The code between <code>once on</code> and <code>once off</code> will be executed only once. Useful for large data manipulation in programs like UDAV.
</p></dd></dl>
<a name="index-stop"></a>
<p><a name="stop"></a>
</p><dl>
<dt><a name="index-stop-1"></a><u>MGL command:</u> <b>stop</b></dt>
<dd><p>Terminate execution.
</p></dd></dl>





<hr size="6">
<a name="General-concepts"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Program-flow-commands" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Coordinate-axes" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MGL-scripts" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="General-concepts-1"></a>
<h1 class="chapter">2. General concepts</h1>

<p>The set of MathGL features is rather rich &ndash; just the number of basic graphics types
is larger than 50. Also there are functions for data handling, plot setup and so on. In spite of it I tried to keep a similar style in function names and in the order of arguments. Mostly it is
used for different drawing functions.
</p>
<p>There are six most general (base) concepts:
</p><ol>
<li>
<strong>Any picture is created in memory first.</strong> The internal (memory) representation can be different: bitmap picture (for <code>SetQuality(MGL_DRAW_LMEM)</code>) or the list of vector primitives (default). After that the user may decide what he/she want: save to file, display on the screen, run animation, do additional editing and so on. This approach assures a high portability of the program &ndash; the source code will produce exactly the same picture in <em>any</em> OS. Another big positive consequence is the ability to create the picture in the console program (using command line, without creating a window)!
</li><li>
<strong>Every plot settings (style of lines, font, color scheme) are specified by a string.</strong> It provides convenience for user/programmer &ndash; short string with parameters is more comprehensible than a large set of parameters. Also it provides portability &ndash; the strings are the same in any OS so that it is not necessary to think about argument types.
</li><li>
<strong>All functions have &ldquo;simplified&rdquo; and &ldquo;advanced&rdquo; forms.</strong> It is done for user&rsquo;s convenience. One needs to specify only one data array in the &ldquo;simplified&rdquo; form in order to see the result. But one may set parametric dependence of coordinates and produce rather complex curves and surfaces in the &ldquo;advanced&rdquo; form. In both cases the order of function arguments is the same: first data arrays, second the string with style, and later string with options for additional plot tuning.
</li><li>
<strong>All data arrays for plotting are encapsulated in mglData(A) class.</strong> This reduces the number of errors while working with memory and provides a uniform interface for data of different types (mreal, double and so on) or for formula plotting.
</li><li>
<strong>All plots are vector plots.</strong> The MathGL library is intended for handling scientific data which have vector nature (lines, faces, matrices and so on). As a result, vector representation is used in all cases! In addition, the vector representation allows one to scale the plot easily &ndash; change the canvas size by a factor of 2, and the picture will be proportionally scaled.
</li><li>
<strong>New drawing never clears things drawn already.</strong> This, in some sense, unexpected, idea allows to create a lot of &ldquo;combined&rdquo; graphics. For example, to make a surface with contour lines one needs to call the function for surface plotting and the function for contour lines plotting (in any order). Thus the special functions for making this &ldquo;combined&rdquo; plots (as it is done in Matlab and some other plotting systems) are superfluous.
</li></ol>

<p>In addition to the general concepts I want to comment on some non-trivial or less commonly used general ideas &ndash; plot positioning, axis specification and curvilinear coordinates, styles for lines, text and color scheme.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Coordinate-axes">2.1 Coordinate axes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Color-styles">2.2 Color styles</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Line-styles">2.3 Line styles</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Color-scheme">2.4 Color scheme</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Font-styles">2.5 Font styles</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Textual-formulas">2.6 Textual formulas</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Command-options">2.7 Command options</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Interfaces">2.8 Interfaces</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>


<hr size="6">
<a name="Coordinate-axes"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#General-concepts" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Color-styles" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Coordinate-axes-1"></a>
<h2 class="section">2.1 Coordinate axes</h2>

<p>Two axis representations are used in MathGL. The first one consists of normalizing coordinates of data points in a box <var>Min</var>x<var>Max</var> (see <a href="#Axis-settings">Axis settings</a>). If <code>SetCut()</code> is <code>true</code> then the outlier points are omitted, otherwise they are projected to the bounding box (see <a href="#Cutting">Cutting</a>). Also, the point will be omitted if it lies inside the box defined by <code>SetCutBox()</code> or if the value of formula <code>CutOff()</code> is nonzero for its coordinates. After that, transformation formulas defined by <code>SetFunc()</code> or <code>SetCoor()</code> are applied to the data point (see <a href="#Curved-coordinates">Curved coordinates</a>). Finally, the data point is plotted by one of the functions.
</p>
<p>The range of <em>x, y, z</em>-axis can be specified by <code>SetRange()</code> or <code>SetRanges()</code> functions. Its origin is specified by <code>SetOrigin()</code> function. At this you can you can use <code>NAN</code> values for selecting axis origin automatically.
</p>
<p>There is 4-th axis <em>c</em> (color axis or colorbar) in addition to the usual axes <em>x, y, z</em>. It sets the range of values for the surface coloring. Its borders are automatically set to values of Min.z, Max.z during the call of <code>SetRanges()</code> function. Also, one can directly set it by call <code>SetRange('c', ...)</code>. Use <code>Colorbar()</code> function for drawing the colorbar.
</p>
<p>The form (appearence) of tick labels is controlled by <code>SetTicks()</code> function (see section <a href="#Ticks">Ticks</a>). Function <var>SetTuneTicks</var> switches on/off tick enhancing by factoring out acommon multiplier (for small coordinate values, like 0.001 to 0.002, or large, like from 1000 to 2000) or common component (for narrow range, like from 0.999 to 1.000). Finally, you may use functions <code>SetTickTempl()</code> for setting templates for tick labels (it supports TeX symbols). Also, there is a possibility to print arbitrary text as tick labels the by help of <code>SetTicksVal()</code> function.
</p>

<hr size="6">
<a name="Color-styles"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Coordinate-axes" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Line-styles" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Color-styles-1"></a>
<h2 class="section">2.2 Color styles</h2>

<p>Base colors are defined by one of symbol &lsquo;<samp>wkrgbcymhRGBCYMHWlenupqLENUPQ</samp>&rsquo;.
<p>The color types are: &lsquo;<samp>k</samp>&rsquo; &ndash; black, &lsquo;<samp>r</samp>&rsquo; &ndash; <span style="color: rgb(255, 0, 0);">red</span>, &lsquo;<samp>R</samp>&rsquo; &ndash; <span style="color: rgb(127, 0, 0);">dark red</span>, &lsquo;<samp>g</samp>&rsquo; &ndash; <span style="color: rgb(0, 255, 0);">green</span>, &lsquo;<samp>G</samp>&rsquo; &ndash; <span style="color: rgb(0, 127, 0);">dark green</span>, &lsquo;<samp>b</samp>&rsquo; &ndash; <span style="color: rgb(0, 0, 255);">blue</span>, &lsquo;<samp>B</samp>&rsquo; &ndash; <span style="color: rgb(0, 0, 127);">dark blue</span>, &lsquo;<samp>c</samp>&rsquo; &ndash; <span style="color: rgb(0, 255, 255);">cyan</span>, &lsquo;<samp>C</samp>&rsquo; &ndash; <span style="color: rgb(0, 127, 127);">dark cyan</span>, &lsquo;<samp>m</samp>&rsquo; &ndash; <span style="color: rgb(255, 0, 255);">magenta</span>, &lsquo;<samp>M</samp>&rsquo; &ndash; <span style="color: rgb(127, 0, 127);">dark magenta</span>, &lsquo;<samp>y</samp>&rsquo; &ndash; <span style="color: rgb(255, 255, 0);">yellow</span>, &lsquo;<samp>Y</samp>&rsquo; &ndash; <span style="color: rgb(127, 127, 0);">dark yellow (gold)</span>, &lsquo;<samp>h</samp>&rsquo; &ndash; <span style="color: rgb(127, 127, 127);">gray</span>, &lsquo;<samp>H</samp>&rsquo; &ndash; <span style="color: rgb(76, 76, 76);">dark gray</span>, &lsquo;<samp>w</samp>&rsquo; &ndash; white, &lsquo;<samp>W</samp>&rsquo; &ndash; <span style="color: rgb(178, 178, 178);">bright gray</span>, &lsquo;<samp>l</samp>&rsquo; &ndash; <span style="color: rgb(0, 255, 127);">green-blue</span>, &lsquo;<samp>L</samp>&rsquo; &ndash; <span style="color: rgb(0, 127, 63);">dark green-blue</span>, &lsquo;<samp>e</samp>&rsquo; &ndash; <span style="color: rgb(127, 255, 0);">green-yellow</span>, &lsquo;<samp>E</samp>&rsquo; &ndash; <span style="color: rgb(63, 127, 0);">dark green-yellow</span>, &lsquo;<samp>n</samp>&rsquo; &ndash; <span style="color: rgb(0, 127, 255);">sky-blue</span>, &lsquo;<samp>N</samp>&rsquo; &ndash; <span style="color: rgb(0, 63, 127);">dark sky-blue</span>, &lsquo;<samp>u</samp>&rsquo; &ndash; <span style="color: rgb(127, 0, 255);">blue-violet</span>, &lsquo;<samp>U</samp>&rsquo; &ndash; <span style="color: rgb(63, 0, 127);">dark blue-violet</span>, &lsquo;<samp>p</samp>&rsquo; &ndash; <span style="color: rgb(255, 0, 127);">purple</span>, &lsquo;<samp>P</samp>&rsquo; &ndash; <span style="color: rgb(127, 0, 63);">dark purple</span>, &lsquo;<samp>q</samp>&rsquo; &ndash; <span style="color: rgb(255, 127, 0);">orange</span>, &lsquo;<samp>Q</samp>&rsquo; &ndash; <span style="color: rgb(127, 63, 0);">dark orange (brown)</span>.</p></p>
<p>You can also use &ldquo;bright&rdquo; colors. The &ldquo;bright&rdquo; color contain 2 symbols in brackets &lsquo;<samp>{cN}</samp>&rsquo;: first one is the usual symbol for color id, the second one is a digit for its brightness. The digit can be in range &lsquo;<samp>1</samp>&rsquo;...&lsquo;<samp>9</samp>&rsquo;. Number &lsquo;<samp>5</samp>&rsquo; corresponds to a normal color, &lsquo;<samp>1</samp>&rsquo; is a very dark version of the color (practically black), and &lsquo;<samp>9</samp>&rsquo; is a very bright version of the color (practically white). For example, the colors can be &lsquo;<samp>{b2}</samp>&rsquo; &lsquo;<samp>{b7}</samp>&rsquo; &lsquo;<samp>{r7}</samp>&rsquo; and so on.
</p>
<p>Finally, you can specify RGB or RGBA values of a color using format &lsquo;<samp>{xRRGGBB}</samp>&rsquo; or &lsquo;<samp>{xRRGGBBAA}</samp>&rsquo; correspondingly. For example, &lsquo;<samp>{xFF9966}</samp>&rsquo; give you 
<span style="color: rgb(255, 153, 102);">melone</span> color.</p>

<hr size="6">
<a name="Line-styles"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Color-styles" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Color-scheme" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Line-styles-1"></a>
<h2 class="section">2.3 Line styles</h2>

<a name="index-Line-style"></a>
<a name="index-Mark-style"></a>
<a name="index-Arrows"></a>

<p>The line style is defined by the string which may contain specifications for color (&lsquo;<samp>wkrgbcymhRGBCYMHWlenupqLENUPQ</samp>&rsquo;), dashing style (&lsquo;<samp>-|;:ji=</samp>&rsquo; or space), width (&lsquo;<samp>123456789</samp>&rsquo;) and marks (&lsquo;<samp>*o+xsd.^v&lt;&gt;</samp>&rsquo; and &lsquo;<samp>#</samp>&rsquo; modifier). If one of the type of information is omitted then default values used with next color from palette (see <a href="#Palette-and-colors">Palette and colors</a>). Note, that internal color counter will be nullified by any change of palette. This includes even hidden change (for example, by <code>Box()</code> or <code>Axis()</code> functions).
By default palette contain following colors: <span style="color: rgb(76, 76, 76);">dark gray</span> &lsquo;<samp>H</samp>&rsquo;, <span style="color: rgb(0, 0, 255);">blue</span> &lsquo;<samp>b</samp>&rsquo;, <span style="color: rgb(0, 255, 0);">green</span> &lsquo;<samp>g</samp>&rsquo;, <span style="color: rgb(255, 0, 0);">red</span> &lsquo;<samp>r</samp>&rsquo;, <span style="color: rgb(0, 255, 255);">cyan</span> &lsquo;<samp>c</samp>&rsquo;, <span style="color: rgb(255, 0, 255);">magenta</span> &lsquo;<samp>m</samp>&rsquo;, <span style="color: rgb(255, 255, 0);">yellow</span> &lsquo;<samp>y</samp>&rsquo;, <span style="color: rgb(127, 127, 127);">gray</span> &lsquo;<samp>h</samp>&rsquo;, <span style="color: rgb(0, 255, 127);">green-blue</span> &lsquo;<samp>l</samp>&rsquo;, <span style="color: rgb(0, 127, 255);">sky-blue</span> &lsquo;<samp>n</samp>&rsquo;, <span style="color: rgb(255, 127, 0);">orange</span> &lsquo;<samp>q</samp>&rsquo;, <span style="color: rgb(127, 255, 0);">green-yellow</span> &lsquo;<samp>e</samp>&rsquo;, <span style="color: rgb(127, 0, 255);">blue-violet</span> &lsquo;<samp>u</samp>&rsquo;, <span style="color: rgb(255, 0, 127);">purple</span> &lsquo;<samp>p</samp>&rsquo;.

<p>Dashing style has the following meaning: space &ndash; no line (usable for plotting only marks), &lsquo;<samp>-</samp>&rsquo; &ndash; solid line (&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;), &lsquo;<samp>|</samp>&rsquo; &ndash; long dashed line (&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;&#9633;&#9633;&#9633;&#9633;), &lsquo;<samp>;</samp>&rsquo; &ndash; dashed line (&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;), &lsquo;<samp>=</samp>&rsquo; &ndash; small dashed line (&#9632;&#9632;&#9633;&#9633;&#9632;&#9632;&#9633;&#9633;&#9632;&#9632;&#9633;&#9633;&#9632;&#9632;&#9633;&#9633;), &lsquo;<samp>:</samp>&rsquo; &ndash; dotted line (&#9632;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;), &lsquo;<samp>j</samp>&rsquo; &ndash; dash-dotted line (&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;&#9633;), &lsquo;<samp>i</samp>&rsquo; &ndash; small dash-dotted line (&#9632;&#9632;&#9632;&#9633;&#9633;&#9632;&#9633;&#9633;&#9632;&#9632;&#9632;&#9633;&#9633;&#9632;&#9633;&#9633;).</p></p>
<p>Marker types are: &lsquo;<samp>o</samp>&rsquo; &ndash; circle, &lsquo;<samp>+</samp>&rsquo; &ndash; cross, &lsquo;<samp>x</samp>&rsquo; &ndash; skew cross, &lsquo;<samp>s</samp>&rsquo; - square, &lsquo;<samp>d</samp>&rsquo; - rhomb (or diamond), &lsquo;<samp>.</samp>&rsquo; &ndash; dot (point), &lsquo;<samp>^</samp>&rsquo; &ndash; triangle up, &lsquo;<samp>v</samp>&rsquo; &ndash; triangle down, &lsquo;<samp>&lt;</samp>&rsquo; &ndash; triangle left, &lsquo;<samp>&gt;</samp>&rsquo; &ndash; triangle right, &lsquo;<samp>#*</samp>&rsquo; &ndash; Y sign, &lsquo;<samp>#+</samp>&rsquo; &ndash; squared cross, &lsquo;<samp>#x</samp>&rsquo; &ndash; squared skew cross, &lsquo;<samp>#.</samp>&rsquo; &ndash; circled dot. If string contain symbol &lsquo;<samp>#</samp>&rsquo; then the solid versions of markers are used.
</p>
<p>One may specify to draw a special symbol (an arrow) at the beginning and at the end of line. This is done if the specification string contains one of the following symbols: &lsquo;<samp>A</samp>&rsquo; &ndash; outer arrow, &lsquo;<samp>V</samp>&rsquo; &ndash; inner arrow, &lsquo;<samp>I</samp>&rsquo; &ndash; transverse hatches, &lsquo;<samp>K</samp>&rsquo; &ndash; arrow with hatches, &lsquo;<samp>T</samp>&rsquo; &ndash; triangle, &lsquo;<samp>S</samp>&rsquo; &ndash; square, &lsquo;<samp>D</samp>&rsquo; &ndash; rhombus, &lsquo;<samp>O</samp>&rsquo; &ndash; circle, &lsquo;<samp>_</samp>&rsquo; &ndash; nothing (the default). The following rule applies: the first symbol specifies the arrow at the end of line, the second specifies the arrow at the beginning of the line. For example, &lsquo;<samp>r-A</samp>&rsquo; defines a red solid line with usual arrow at the end, &lsquo;<samp>b|AI</samp>&rsquo; defines a blue dash line with an arrow at the end and with hatches at the beginning, &lsquo;<samp>_O</samp>&rsquo; defines a line with the current style and with a circle at the beginning. These styles are applicable during the graphics plotting as well (for example, <a href="#g_t1D-plotting">1D plotting</a>).
</p>
 <img src="png/style.png" alt="Color and line styles.">


<hr size="6">
<a name="Color-scheme"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Line-styles" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Font-styles" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Color-scheme-1"></a>
<h2 class="section">2.4 Color scheme</h2>

<a name="index-Color-scheme"></a>

<p>The color scheme is used for determining the color of surfaces, isolines, isosurfaces and so on. The color scheme is defined by the string, which may contain several characters that are color id (see section <a href="#Line-styles">Line styles</a>) or characters &lsquo;<samp>#:|</samp>&rsquo;. Symbol &lsquo;<samp>#</samp>&rsquo; switches to mesh drawing or to a wire plot. Symbol &lsquo;<samp>|</samp>&rsquo; disables color interpolation in color scheme, which can be useful, for example, for sharp colors during matrix plotting. Symbol &lsquo;<samp>:</samp>&rsquo; terminate the color scheme parsing. Following it, the user may put styles for the text, rotation axis for curves/isocontours, and so on. Color scheme may contain up to 32 color values.
</p>
<p>The final color is a linear interpolation of color array. The color array is constructed from the string ids (including &ldquo;bright&rdquo; colors, see <a href="#Color-styles">Color styles</a>). The argument is the amplitude normalized between <var>Cmin</var> &ndash; <var>Cmax</var> (see <a href="#Axis-settings">Axis settings</a>). For example, string containing 4 characters &lsquo;<samp>bcyr</samp>&rsquo; corresponds to a colorbar from blue (lowest value) through cyan (next value) through yellow (next value) to the red (highest value). String &lsquo;<samp>kw</samp>&rsquo; corresponds to a colorbar from black (lowest value) to white (highest value). String &lsquo;<samp>m</samp>&rsquo; corresponds to a simple magenta color.
</p>
<p>There are several useful combinations. String &lsquo;<samp>kw</samp>&rsquo; corresponds to the simplest gray color scheme where higher values are brighter. String &lsquo;<samp>wk</samp>&rsquo; presents the inverse gray color scheme where higher value is darker. Strings &lsquo;<samp>kRryw</samp>&rsquo;, &lsquo;<samp>kGgw</samp>&rsquo;, &lsquo;<samp>kBbcw</samp>&rsquo; present the well-known <em>hot</em>, <em>summer</em> and <em>winter</em> color schemes. Strings &lsquo;<samp>BbwrR</samp>&rsquo; and &lsquo;<samp>bBkRr</samp>&rsquo; allow to view bi-color figure on white or black background, where negative values are blue and positive values are red. String &lsquo;<samp>BbcyrR</samp>&rsquo; gives a color scheme similar to the well-known <em>jet</em> color scheme.
</p>
<p>For more precise coloring, you can change default (equidistant) position of colors in color scheme. The format is &lsquo;<samp>{CN,pos}</samp>&rsquo;, &lsquo;<samp>{CN,pos}</samp>&rsquo; or &lsquo;<samp>{xRRGGBB,pos}</samp>&rsquo;. The position value <var>pos</var> should be in range [0, 1]. Note, that alternative method for fine tuning of the color scheme is using the formula for coloring (see <a href="#Curved-coordinates">Curved coordinates</a>).
</p>
 <img src="png/schemes.png" alt="Most popular color schemes.">

<p>When coloring by <em>coordinate</em> (used in <a href="#map">map</a>), the final color is determined by the position of the point in 3d space and is calculated from formula c=x*c[1] + y*c[2]. Here, c[1], c[2] are the first two elements of color array; x, y are normalized to axis range coordinates of the point.
</p>

<hr size="6">
<a name="Font-styles"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Color-scheme" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Textual-formulas" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Font-styles-1"></a>
<h2 class="section">2.5 Font styles</h2>

<a name="index-Font-styles"></a>

<p>Text style is specified by the string which may contain: color id characters &lsquo;<samp>wkrgbcymhRGBCYMHW</samp>&rsquo; (see <a href="#Color-styles">Color styles</a>), and font style (&lsquo;<samp>ribwou</samp>&rsquo;) and/or alignment (&lsquo;<samp>LRC</samp>&rsquo;) specifications. At this, font style and alignment begin after the separator &lsquo;<samp>:</samp>&rsquo;. For example, &lsquo;<samp>r:iCb</samp>&rsquo; sets the bold (&lsquo;<samp>b</samp>&rsquo;) italic (&lsquo;<samp>i</samp>&rsquo;) font text aligned at the center (&lsquo;<samp>C</samp>&rsquo;) and with red color (&lsquo;<samp>r</samp>&rsquo;).
</p>
<p>The font styles are: &lsquo;<samp>r</samp>&rsquo; &ndash; roman (or regular) font, &lsquo;<samp>i</samp>&rsquo; &ndash; italic style, &lsquo;<samp>b</samp>&rsquo; &ndash; bold style. By default roman roman font is used. The align types are: &lsquo;<samp>L</samp>&rsquo; &ndash; align left (default), &lsquo;<samp>C</samp>&rsquo; &ndash; align center, &lsquo;<samp>R</samp>&rsquo; &ndash; align right. Additional font effects are: &lsquo;<samp>w</samp>&rsquo; &ndash; wired, &lsquo;<samp>o</samp>&rsquo; &ndash; over-lined, &lsquo;<samp>u</samp>&rsquo; &ndash; underlined.
</p>
<p>Also a parsing of the LaTeX-like syntax is provided. There are commands for the font style changing inside the string (for example, use \b for bold font): \a or \overline &ndash; over-lined, \b or \textbf &ndash; bold, \i or \textit &ndash; italic, \r or \textrm &ndash; roman (disable bold and italic attributes), \u or \underline &ndash; underlined, \w or \wire &ndash; wired, \big &ndash; bigger size, @ &ndash; smaller size. The lower and upper indexes are specified by &lsquo;<samp>_</samp>&rsquo; and &lsquo;<samp>^</samp>&rsquo; symbols. At this the changed font style is applied only on next symbol or symbols in braces {}. The text in braces {} are treated as single symbol that allow one to print the index of index. For example, compare the strings &lsquo;<samp>sin (x^{2^3})</samp>&rsquo; and &lsquo;<samp>sin (x^2^3)</samp>&rsquo;. You may also change text color inside string by command #? or by \color? where &lsquo;<samp>?</samp>&rsquo; is symbolic id of the color (see section <a href="#Color-styles">Color styles</a>). For example, words &lsquo;<samp>blue</samp>&rsquo; and &lsquo;<samp>red</samp>&rsquo; will be colored in the string &lsquo;<samp>#b{blue} and \colorr{red} text</samp>&rsquo;. The most of functions understand the newline symbol &lsquo;<samp>\n</samp>&rsquo; and allows to print multi-line text. Finally, you can use arbitrary (if it was defined in font-face) UTF codes by command <code>\utf0x????</code>. For example, <code>\utf0x3b1</code> will produce
 &alpha; symbol.</p>
<p>The most of commands for special TeX or AMSTeX symbols, the commands for font style changing (\textrm, \textbf, \textit, \textsc, \overline, \underline), accents (\hat, \tilde, \dot, \ddot, \acute, \check, \grave, \bar, \breve) and roots (\sqrt, \sqrt3, \sqrt4) are recognized. The full list contain approximately 2000 commands. Note that first space symbol after the command is ignored, but second one is printed as normal symbol (space). For example, the following strings produce the same result <em>\tilde a</em>: &lsquo;<samp>\tilde{a}</samp>&rsquo;; &lsquo;<samp>\tilde a</samp>&rsquo;; &lsquo;<samp>\tilde{}a</samp>&rsquo;.
</p>
In particular, the Greek letters are recognizable special symbols: &alpha; &ndash; \alpha, &beta; &ndash; \beta, &gamma; &ndash; \gamma, &delta; &ndash; \delta, &epsilon; &ndash; \epsilon, &eta; &ndash; \eta, &iota; &ndash; \iota, &chi; &ndash; \chi, &kappa; &ndash; \kappa, &lambda; &ndash; \lambda, &mu; &ndash; \mu, &nu; &ndash; \nu, o &ndash; \o, &omega; &ndash; \omega, &#981; &ndash; \phi, &pi; &ndash; \pi, &psi; &ndash; \psi, &rho; &ndash; \rho, &sigma; &ndash; \sigma, &theta; &ndash; \theta, &tau; &ndash; \tau, &upsilon; &ndash; \upsilon, &xi; &ndash; \xi, &zeta; &ndash; \zeta, &sigmaf; &ndash; \varsigma, &#603; &ndash; \varepsilon, &thetasym; &ndash; \vartheta, &phi; &ndash; \varphi, &#1008; &ndash; \varkappa; A &ndash; \Alpha, B &ndash; \Beta, &Gamma; &ndash; \Gamma, &Delta; &ndash; \Delta, E &ndash; \Epsilon, H &ndash; \Eta, I &ndash; \Iota, C &ndash; \Chi, K &ndash; \Kappa, &Lambda; &ndash; \Lambda, M &ndash; \Mu, N &ndash; \Nu, O &ndash; \O, &Omega; &ndash; \Omega, &Phi; &ndash; \Phi, &Pi; &ndash; \Pi, &Psi; &ndash; \Psi, R &ndash; \Rho, &Sigma; &ndash; \Sigma, &Theta; &ndash; \Theta, T &ndash; \Tau, &Upsilon; &ndash; \Upsilon, &Xi; &ndash; \Xi, Z &ndash; \Zeta.

<p>The small part of most common special TeX symbols are: &ang; &ndash; \angle, &sdot; &ndash; \cdot, &clubs; &ndash; \clubsuit, &#10003; &ndash; \checkmark, &cup; &ndash; \cup, &cap; &ndash; \cap, &#9826; &ndash; \diamondsuit, &#9671; &ndash; \diamond, &divide;
 &ndash; \div,
&darr; &ndash; \downarrow, &dagger; &ndash; \dag, &Dagger; &ndash; \ddag, &equiv; &ndash; \equiv, &exist; &ndash; \exists, &#8994; &ndash; \frown, &#9837; &ndash; \flat, &ge; &ndash; \ge, &ge; &ndash; \geq, &#8807; &ndash; \geqq, &larr; &ndash; \gets, &#9825; &ndash; \heartsuit, &infin; &ndash; \infty, &int; &ndash; \int, \Int, &image;  &ndash; \Im, &#9826; &ndash; \lozenge, &#10216; &ndash; \langle, &le; &ndash; \le, &le; &ndash; \leq, &#8806; &ndash; \leqq, &larr; &ndash; \leftarrow, &#8723; &ndash; \mp, &nabla; &ndash; \nabla, &ne; &ndash; \ne, &ne; &ndash; \neq, &#9838; &ndash; \natural, &#8750; &ndash; \oint, &#8857; &ndash; \odot, &oplus; &ndash; \oplus, &part; &ndash; \partial, &#8741; &ndash; \parallel, &perp; &ndash;\perp, &plusmn; &ndash; \pm, &prop; &ndash; \propto, &prod; &ndash; \prod, &real; &ndash; \Re, &rarr; &ndash; \rightarrow, &#10217; &ndash; \rangle, &spades; &ndash; \spadesuit, ~ &ndash; \sim, &#8995; &ndash; \smile, &sub;  &ndash; \subset, &sup; &ndash; \supset, &radic; &ndash; \sqrt or \surd, &sect; &ndash; \S, &#9839; &ndash; \sharp, &sum; &ndash; \sum, &times; &ndash; \times, &rarr; &ndash; \to, &there4; &ndash; \therefore, &uarr; &ndash; \uparrow, &weierp; &ndash; \wp. </p>
<p>The font size can be defined explicitly (if <var>size</var>&gt;0) or relatively to a base font size as |<var>size</var>|*<var>FontSize</var> (if <var>size</var>&lt;0). The value <var>size</var>=0 specifies that the string will not be printed. The base font size is measured in internal &ldquo;MathGL&rdquo; units. Special functions <code>SetFontSizePT(), SetFontSizeCM(), SetFontSizeIN()</code> (see <a href="#Font-settings">Font settings</a>) allow one to set it in more &ldquo;common&rdquo; variables for a given dpi value of the picture.
</p>

<hr size="6">
<a name="Textual-formulas"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Font-styles" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Command-options" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Textual-formulas-1"></a>
<h2 class="section">2.6 Textual formulas</h2>

<a name="index-Textual-formulas"></a>

<p>MathGL have the fast variant of textual formula evaluation
. There are a lot of functions and operators available. The operators are: &lsquo;<samp>+</samp>&rsquo; &ndash; addition, &lsquo;<samp>-</samp>&rsquo; &ndash; subtraction, &lsquo;<samp>*</samp>&rsquo; &ndash; multiplication, &lsquo;<samp>/</samp>&rsquo; &ndash; division, &lsquo;<samp>^</samp>&rsquo; &ndash; integer power. Also there are logical &ldquo;operators&rdquo;: &lsquo;<samp>&lt;</samp>&rsquo; &ndash; true if x&lt;y, &lsquo;<samp>&gt;</samp>&rsquo; &ndash; true if x&gt;y, &lsquo;<samp>=</samp>&rsquo; &ndash; true if x=y, &lsquo;<samp>&amp;</samp>&rsquo; &ndash; true if x and y both nonzero, &lsquo;<samp>|</samp>&rsquo; &ndash; true if x or y nonzero. These logical operators have lowest priority and return 1 if true or 0 if false.
</p>
<p>The basic functions are: &lsquo;<samp>sqrt(x)</samp>&rsquo; &ndash; square root of <var>x</var>, &lsquo;<samp>pow(x,y)</samp>&rsquo; &ndash; power <var>x</var> in <var>y</var>, &lsquo;<samp>ln(x)</samp>&rsquo; &ndash; natural logarithm of <var>x</var>, &lsquo;<samp>lg(x)</samp>&rsquo; &ndash; decimal logarithm of <var>x</var>, &lsquo;<samp>log(a,x)</samp>&rsquo; &ndash; logarithm base <var>a</var> of <var>x</var>, &lsquo;<samp>abs(x)</samp>&rsquo; &ndash; absolute value of <var>x</var>, &lsquo;<samp>sign(x)</samp>&rsquo; &ndash; sign of <var>x</var>, &lsquo;<samp>mod(x,y)</samp>&rsquo; &ndash; x modulo y, &lsquo;<samp>step(x)</samp>&rsquo; &ndash; step function, &lsquo;<samp>int(x)</samp>&rsquo; &ndash; integer part of <var>x</var>, &lsquo;<samp>rnd</samp>&rsquo; &ndash; random number, &lsquo;<samp>pi</samp>&rsquo; &ndash; number
&pi; = 3.1415926&hellip;</p>
<p>Trigonometric functions are: &lsquo;<samp>sin(x)</samp>&rsquo;, &lsquo;<samp>cos(x)</samp>&rsquo;, &lsquo;<samp>tan(x)</samp>&rsquo; (or &lsquo;<samp>tg(x)</samp>&rsquo;). Inverse trigonometric functions are: &lsquo;<samp>asin(x)</samp>&rsquo;, &lsquo;<samp>acos(x)</samp>&rsquo;, &lsquo;<samp>atan(x)</samp>&rsquo;. Hyperbolic functions are: &lsquo;<samp>sinh(x)</samp>&rsquo; (or &lsquo;<samp>sh(x)</samp>&rsquo;), &lsquo;<samp>cosh(x)</samp>&rsquo; (or &lsquo;<samp>ch(x)</samp>&rsquo;), &lsquo;<samp>tanh(x)</samp>&rsquo; (or &lsquo;<samp>th(x)</samp>&rsquo;). Inverse hyperbolic functions are: &lsquo;<samp>asinh(x)</samp>&rsquo;, &lsquo;<samp>acosh(x)</samp>&rsquo;, &lsquo;<samp>atanh(x)</samp>&rsquo;.
</p>
<p>There are a set of special functions: &lsquo;<samp>gamma(x)</samp>&rsquo; &ndash; Gamma function &Gamma;(x) = &int;<sub>0</sub><sup>&infin;</sup> t<sup>x-1</sup> exp(-t) dt, &lsquo;<samp>psi(x)</samp>&rsquo; &ndash; digamma function &psi;(x) = &Gamma;&prime;(x)/&Gamma;(x) for x&ne;0, &lsquo;<samp>ai(x)</samp>&rsquo; &ndash; Airy function Ai(x), &lsquo;<samp>bi(x)</samp>&rsquo; &ndash; Airy function Bi(x), &lsquo;<samp>cl(x)</samp>&rsquo; &ndash; Clausen function, &lsquo;<samp>li2(x)</samp>&rsquo; (or &lsquo;<samp>dilog(x)</samp>&rsquo;) &ndash; dilogarithm Li<sub>2</sub>(x) = -&real;&int;<sub>0</sub><sup>x</sup>ds log(1-s)/s, &lsquo;<samp>sinc(x)</samp>&rsquo; &ndash; compute sinc(x) = sin(&pi;x)/(&pi;x) for any value of x, &lsquo;<samp>zeta(x)</samp>&rsquo; &ndash; Riemann zeta function &zeta;(s) = &sum;<sub>k=1</sub><sup>&infin;</sup>k<sup>-s</sup> for arbitrary s&ne;1, &lsquo;<samp>eta(x)</samp>&rsquo; &ndash; eta function &eta;(s) = (1 - 2<sup>1-s</sup>)&zeta;(s) for arbitrary s, &lsquo;<samp>lp(l,x)</samp>&rsquo; &ndash; Legendre polynomial P<sub>l</sub>(x), (|x|&le;1, l&ge;0), &lsquo;<samp>w0(x)</samp>&rsquo; &ndash; principal branch of the Lambert W function, &lsquo;<samp>w1(x)</samp>&rsquo; &ndash; principal branch of the Lambert W function. Function W(x) is defined to be solution of the equation: W exp(W) = x. </p>

<p>The exponent integrals are: &lsquo;<samp>ci(x)</samp>&rsquo; &ndash; Cosine integral Ci(x) = &int;<sub>0</sub><sup>x</sup>dt cos(t)/t, &lsquo;<samp>si(x)</samp>&rsquo; &ndash; Sine integral Si(x) = &int;<sub>0</sub><sup>x</sup>dt sin(t)/t, &lsquo;<samp>erf(x)</samp>&rsquo; &ndash; error function erf(x) = (2/&radic;&pi;) &int;<sub>0</sub><sup>x</sup>dt exp(-t<sup>2</sup>) , &lsquo;<samp>ei(x)</samp>&rsquo; &ndash; exponential integral Ei(x) = -PV(&int;<sub>-x</sub><sup>&infin;</sup>dt exp(-t)/t) (where PV denotes the principal value of the integral), &lsquo;<samp>e1(x)</samp>&rsquo; &ndash; exponential integral E<sub>1</sub>(x) = &real;&int;<sub>1</sub><sup>&infin;</sup>dt exp(-xt)/t, &lsquo;<samp>e2(x)</samp>&rsquo; &ndash; exponential integral E<sub>2</sub>(x) = &real;&int;<sub>1</sub>&infin;</sup>dt exp(-xt)/t<sup>2</sup>, &lsquo;<samp>ei3(x)</samp>&rsquo; &ndash; exponential integral Ei<sub>3</sub>(x) = &int;<sub>0</sub><sup>x</sup>dt exp(-t<sup>3</sup>) for x&ge;0. </p>

<p>Bessel functions are: &lsquo;<samp>j(nu,x)</samp>&rsquo; &ndash; regular cylindrical Bessel function of fractional order <em>nu</em>, &lsquo;<samp>y(nu,x)</samp>&rsquo; &ndash; irregular cylindrical Bessel function of fractional order <em>nu</em>, &lsquo;<samp>i(nu,x)</samp>&rsquo; &ndash; regular modified Bessel function of fractional order <em>nu</em>, &lsquo;<samp>k(nu,x)</samp>&rsquo; &ndash; irregular modified Bessel function of fractional order <em>nu</em>. </p>

<p>Elliptic integrals are: &lsquo;<samp>ee(k)</samp>&rsquo; &ndash; complete elliptic integral is denoted by E(k) = E(&pi;/2,k), &lsquo;<samp>ek(k)</samp>&rsquo; &ndash; complete elliptic integral is denoted by K(k) = F(&pi;/2,k), &lsquo;<samp>e(phi,k)</samp>&rsquo; &ndash; elliptic integral E(&phi;,k) = &int;<sub>0</sub><sup>&phi;</sup>dt &radic;(1 - k<sup>2</sup>sin<sup>2</sup>(t)), &lsquo;<samp>f(phi,k)</samp>&rsquo; &ndash; elliptic integral F(&phi;,k) = &int;<sub>0</sub><sup>&phi;</sup>dt 1/&radic;(1 - k<sup>2</sup>sin<sup>2</sup>(t))</p>
<p>Jacobi elliptic functions are: &lsquo;<samp>sn(u,m)</samp>&rsquo;, &lsquo;<samp>cn(u,m)</samp>&rsquo;, &lsquo;<samp>dn(u,m)</samp>&rsquo;, &lsquo;<samp>sc(u,m)</samp>&rsquo;, &lsquo;<samp>sd(u,m)</samp>&rsquo;, &lsquo;<samp>ns(u,m)</samp>&rsquo;, &lsquo;<samp>cs(u,m)</samp>&rsquo;, &lsquo;<samp>cd(u,m)</samp>&rsquo;, &lsquo;<samp>nc(u,m)</samp>&rsquo;, &lsquo;<samp>ds(u,m)</samp>&rsquo;, &lsquo;<samp>dc(u,m)</samp>&rsquo;, &lsquo;<samp>nd(u,m)</samp>&rsquo;.
</p>
<p>Note, some of these functions are unavailable if MathGL was compiled without GSL support.
</p>
<p>There is no difference between lower or upper case in formulas. If argument value lie outside the range of function definition then function returns NaN.
</p>

<hr size="6">
<a name="Command-options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Textual-formulas" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Interfaces" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Command-options-1"></a>
<h2 class="section">2.7 Command options</h2>

<p>Command options allow the easy setup of the selected plot by changing global settings only for this plot. Each option start from symbol &lsquo;<samp>;</samp>&rsquo;. Options work so that MathGL remember the current settings, change settings as it being set in the option, execute function and return the original settings back. So, the options are most usable for plotting functions.
</p>
<p>The most useful options are <code>xrange, yrange, zrange</code>. They sets the boundaries for data change. This boundaries are used for automatically filled variables. So, these options allow one to change the position of some plots. For example, in command <code>Plot(y,&quot;&quot;,&quot;xrange 0.1 0.9&quot;);</code> or <code>plot y; xrange 0.1 0.9</code> the x coordinate will be equidistantly distributed in range 0.1 ... 0.9.  See section <a href="#Using-options">Using options</a>, for sample code and picture.
</p>
<p>The full list of options are:
<a name="index-alpha"></a>
<a name="index-alphadef"></a>
</p><dl>
<dt><a name="index-alpha-1"></a><u>MGL option:</u> <b>alpha</b><i> <code>val</code></i></dt>
<dd><p>Sets alpha value (transparency) of the plot. The value should be in range [0, 1]. See also <a href="#alphadef">alphadef</a>.
</p></dd></dl>

<a name="index-xrange"></a>
<dl>
<dt><a name="index-xrange-1"></a><u>MGL option:</u> <b>xrange</b><i> <code>val1 val2</code></i></dt>
<dd><p>Sets boundaries of x coordinate change for the plot. See also <a href="#xrange">xrange</a>.
</p></dd></dl>
<a name="index-yrange"></a>
<dl>
<dt><a name="index-yrange-1"></a><u>MGL option:</u> <b>yrange</b><i> <code>val1 val2</code></i></dt>
<dd><p>Sets boundaries of y coordinate change for the plot. See also <a href="#yrange">yrange</a>.
</p></dd></dl>
<a name="index-zrange"></a>
<dl>
<dt><a name="index-zrange-1"></a><u>MGL option:</u> <b>zrange</b><i> <code>val1 val2</code></i></dt>
<dd><p>Sets boundaries of z coordinate change for the plot. See also <a href="#zrange">zrange</a>.
</p></dd></dl>

<a name="index-cut"></a>
<dl>
<dt><a name="index-cut-1"></a><u>MGL option:</u> <b>cut</b><i> <code>val</code></i></dt>
<dd><p>Sets whether to cut or to project the plot points lying outside the bounding box. See also <a href="#cut">cut</a>.
</p></dd></dl>
<a name="index-fontsize"></a>
<dl>
<dt><a name="index-size"></a><u>MGL option:</u> <b>size</b><i> <code>val</code></i></dt>
<dd><p>Sets the size of text, marks and arrows. See also <a href="#font">font</a>, <a href="#marksize">marksize</a>, <a href="#arrowsize">arrowsize</a>.
</p></dd></dl>
<a name="index-meshnum"></a>
<dl>
<dt><a name="index-meshnum-1"></a><u>MGL option:</u> <b>meshnum</b><i> <code>val</code></i></dt>
<dd><p>Work like <a href="#meshnum">meshnum</a> command.
</p></dd></dl>

<a name="index-legend"></a>
<dl>
<dt><a name="index-legend-1"></a><u>MGL option:</u> <b>legend</b><i> 'txt'</i></dt>
<dd><p>Adds string &rsquo;txt&rsquo; to internal legend accumulator. The style of described line and mark is taken from arguments of the last <a href="#g_t1D-plotting">1D plotting</a> command. See also <a href="#legend">legend</a>.
</p></dd></dl>
<a name="index-value"></a>
<dl>
<dt><a name="index-value-1"></a><u>MGL option:</u> <b>value</b><i> <code>val</code></i></dt>
<dd><p>Set the value to be used as additional numeric parameter in plotting command.
</p></dd></dl>




<hr size="6">
<a name="Interfaces"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Command-options" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Interfaces-1"></a>
<h2 class="section">2.8 Interfaces</h2>

<p>You can use <code>mglParse</code> class for executing MGL scripts from different languages.
</p>




<hr size="6">
<a name="MathGL-core"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Interfaces" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Constructor" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#General-concepts" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="MathGL-core-1"></a>
<h1 class="chapter">3. MathGL core</h1>
<a name="index-mglGraph"></a>

<p>This chapter contains a lot of plotting commands for 1D, 2D and 3D data. It also encapsulates parameters for axes drawing. Moreover an arbitrary coordinate transformation can be used for each axis.  Additional information about colors, fonts, formula parsing can be found in <a href="#General-concepts">General concepts</a>. The full list of symbols used by MathGL for setting up plots can be found in <a href="#Symbols-for-styles">Symbols for styles</a>.
</p>

<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Constructor">3.1 Create and delete objects</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Graphics-setup">3.2 Graphics setup</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Axis-settings">3.3 Axis settings</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Export-picture">3.5 Export picture</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Primitives">3.6 Primitives</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Text-printing">3.7 Text printing</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Axis-and-Colorbar">3.8 Axis and Colorbar</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Legend">3.9 Legend</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#g_t3D-plotting">3.12 3D plotting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Dual-plotting">3.13 Dual plotting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Vector-fields">3.14 Vector fields</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Other-plotting">3.15 Other plotting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Nonlinear-fitting">3.16 Nonlinear fitting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Data-manipulation">3.17 Data manipulation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>


<hr size="6">
<a name="Constructor"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#MathGL-core" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Graphics-setup" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Create-and-delete-objects"></a>
<h2 class="section">3.1 Create and delete objects</h2>


<p>You don&rsquo;t need to create canvas object in MGL.
</p>

<hr size="6">
<a name="Graphics-setup"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Constructor" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Transparency" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Graphics-setup-1"></a>
<h2 class="section">3.2 Graphics setup</h2>
<a name="index-MathGL-setup"></a>

<p>Functions and variables in this group influences on overall graphics appearance. So all of them should be placed <em>before</em> any actual plotting function calls.
</p>

<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Transparency">3.2.1 Transparency</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Lighting">3.2.2 Lighting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Fog">3.2.3 Fog</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Default-sizes">3.2.4 Default sizes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Cutting">3.2.5 Cutting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Font-settings">3.2.6 Font settings</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Palette-and-colors">3.2.7 Palette and colors</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Error-handling">3.2.8 Error handling</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr size="6">
<a name="Transparency"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Graphics-setup" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Lighting" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Graphics-setup" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Transparency-1"></a>
<h3 class="subsection">3.2.1 Transparency</h3>
<a name="index-Alpha"></a>
<a name="index-AlphaDef"></a>
<a name="index-TranspType"></a>

<p>There are several functions and variables for setup transparency. The general function is <a href="#alpha">alpha</a> which switch on/off the transparency for overall plot. It influence only for graphics which created after <a href="#alpha">alpha</a> call (with one exception, OpenGL). Function <a href="#alphadef">alphadef</a> specify the default value of alpha-channel. Finally, function <a href="#transptype">transptype</a> set the kind of transparency. See section <a href="#Transparency-and-lighting">Transparency and lighting</a>, for sample code and picture.
</p>
<p><a name="alpha"></a>
</p><dl>
<dt><a name="index-alpha-2"></a><u>MGL command:</u> <b>alpha</b><i> <code>[val=on]</code></i></dt>
<dd><p>Sets the transparency on/off and returns previous value of transparency. It is recommended to call this function before any plotting command. Default value is transparency off.
</p></dd></dl>

<p><a name="alphadef"></a>
</p><dl>
<dt><a name="index-alphadef-1"></a><u>MGL command:</u> <b>alphadef</b><i> <code>val</code></i></dt>
<dd><p>Sets default value of alpha channel (transparency) for all plotting functions. Initial value is 0.5.
</p></dd></dl>

<p><a name="transptype"></a>
</p><dl>
<dt><a name="index-transptype"></a><u>MGL command:</u> <b>transptype</b><i> <code>val</code></i></dt>
<dd><p>Set the type of transparency. Possible values are:
</p><ul>
<li>
Normal transparency (&lsquo;<samp>0</samp>&rsquo;) &ndash; below things is less visible than upper ones. It does not look well in OpenGL mode (mglGraphGL) for several surfaces.
</li><li>
Glass-like transparency (&lsquo;<samp>1</samp>&rsquo;) &ndash; below and upper things are commutable and just decrease intensity of light by RGB channel.
</li><li>
Lamp-like transparency (&lsquo;<samp>2</samp>&rsquo;) &ndash; below and upper things are commutable and are the source of some additional light. I recommend to set <code>SetAlphaDef(0.3)</code> or less for lamp-like transparency.
</li></ul>
<p>See section <a href="#Types-of-transparency">Types of transparency</a>, for sample code and picture..
</p></dd></dl>

<hr size="6">
<a name="Lighting"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Transparency" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Fog" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Graphics-setup" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Lighting-1"></a>
<h3 class="subsection">3.2.2 Lighting</h3>
<a name="index-Light"></a>
<a name="index-Ambient"></a>

<p>There are several functions for setup lighting. The general function is <a href="#light">light</a> which switch on/off the lighting for overall plot. It influence only for graphics which created after <a href="#light">light</a> call (with one exception, OpenGL). Generally MathGL support up to 10 independent light sources. But in OpenGL mode only 8 of light sources is used due to OpenGL limitations. The position, color, brightness of each light source can be set separately. By default only one light source is active. It is source number <code>0</code> with white color, located at top of the plot.
</p>
<p><a name="light"></a>
</p><dl>
<dt><a name="index-light"></a><u>MGL command:</u> <b>light</b><i> <code>[val=on]</code></i></dt>
<dd><p>Sets the using of light on/off for overall plot. Function returns previous value of lighting. Default value is lightning off.
</p></dd></dl>

<dl>
<dt><a name="index-light-1"></a><u>MGL command:</u> <b>light</b><i> <code>num</code> <code>val</code></i></dt>
<dd><p>Switch on/off <var>n</var>-th light source separately.
</p></dd></dl>

<dl>
<dt><a name="index-light-2"></a><u>MGL command:</u> <b>light</b><i> <code>num xdir ydir zdir</code> ['col'='w' <code>br=0.5</code>]</i></dt>
<dt><a name="index-light-3"></a><u>MGL command:</u> <b>light</b><i> <code>num xdir ydir zdir xpos ypos zpos</code> ['col'='w' <code>br=0.5</code>]</i></dt>
<dd><p>The function adds a light source with identification <var>n</var> in direction <var>d</var> with color <var>c</var> and with brightness <var>bright</var> (which must be in range [0,1]). If position <var>r</var> is specified and isn&rsquo;t NAN then light source is supposed to be local otherwise light source is supposed to be placed at infinity.
</p></dd></dl>

<p><a name="diffuse"></a>
</p>
<p><a name="ambient"></a>
</p><dl>
<dt><a name="index-ambient"></a><u>MGL command:</u> <b>ambient</b><i> <code>val</code></i></dt>
<dd><p>Sets the brightness of ambient light. The value should be in range [0,1].
</p></dd></dl>

<hr size="6">
<a name="Fog"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Lighting" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Default-sizes" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Graphics-setup" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Fog-1"></a>
<h3 class="subsection">3.2.3 Fog</h3>
<a name="index-Fog"></a>

<p><a name="fog"></a>
</p><dl>
<dt><a name="index-fog"></a><u>MGL command:</u> <b>fog</b><i> <code>val [dz=0.25]</code></i></dt>
<dd><p>Function imitate a fog in the plot. Fog start from relative distance <var>dz</var> from view point and its density growths exponentially in depth. So that the fog influence is determined by law ~ 1-exp(-<em>d*z</em>). Here <em>z</em> is normalized to 1 depth of the plot. If value <var>d</var>=<code>0</code> then the fog is absent. Note, that fog was applied at stage of image creation, not at stage of drawing. See section <a href="#Adding-fog">Adding fog</a>, for sample code and picture.
</p></dd></dl>

<hr size="6">
<a name="Default-sizes"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Fog" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Cutting" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Graphics-setup" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Default-sizes-1"></a>
<h3 class="subsection">3.2.4 Default sizes</h3>
<a name="index-BarWidth"></a>
<a name="index-MarkSize"></a>
<a name="index-ArrowSize"></a>
<a name="index-MeshNum"></a>

<p>These variables control the default (initial) values for most graphics parameters including sizes of markers, arrows, line width and so on. As any other settings these ones will influence only on plots created after the settings change.
</p>
<p><a name="barwidth"></a>
</p><dl>
<dt><a name="index-barwidth"></a><u>MGL command:</u> <b>barwidth</b><i> <code>val</code></i></dt>
<dd><p>Sets relative width of rectangles in <a href="#bars">bars</a>, <a href="#barh">barh</a>, <a href="#boxplot">boxplot</a>, <a href="#candle">candle</a>. Default value is <code>0.7</code>.
</p></dd></dl>

<p><a name="marksize"></a>
</p><dl>
<dt><a name="index-marksize"></a><u>MGL command:</u> <b>marksize</b><i> <code>val</code></i></dt>
<dd><p>Sets size of marks for <a href="#g_t1D-plotting">1D plotting</a>. Default value is <code>1</code>.
</p></dd></dl>

<p><a name="arrowsize"></a>
</p><dl>
<dt><a name="index-arrowsize"></a><u>MGL command:</u> <b>arrowsize</b><i> <code>val</code></i></dt>
<dd><p>Sets size of arrows for <a href="#g_t1D-plotting">1D plotting</a>, lines and curves (see <a href="#Primitives">Primitives</a>). Default value is <code>1</code>.
</p></dd></dl>

<p><a name="meshnum"></a>
<a name="MeshNum"></a>
</p><dl>
<dt><a name="index-meshnum-2"></a><u>MGL command:</u> <b>meshnum</b><i> <code>val</code></i></dt>
<dd><p>Sets approximate number of lines in <a href="#mesh">mesh</a>, <a href="#fall">fall</a>, <a href="#grid">grid</a> and also the number of hachures in <a href="#vect">vect</a>, <a href="#dew">dew</a> and the number of cells in <a href="#cloud">cloud</a>. By default (=0) it draws all lines/hachures/cells.
</p></dd></dl>

<p><a name="facenum"></a>
</p><dl>
<dt><a name="index-facenum"></a><u>MGL command:</u> <b>facenum</b><i> <code>val</code></i></dt>
<dd><p>Sets approximate number of visible faces. Can be used for speeding up drawing by cost of lower quality. By default (=0) it draws all of them.
</p></dd></dl>

<p><a name="plotid"></a>
</p><dl>
<dt><a name="index-plotid"></a><u>MGL command:</u> <b>plotid</b><i> 'id'</i></dt>
<dd><p>Sets default name <var>id</var> as filename for saving (in FLTK window for example).
</p></dd></dl>


<hr size="6">
<a name="Cutting"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Default-sizes" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Font-settings" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Graphics-setup" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Cutting-1"></a>
<h3 class="subsection">3.2.5 Cutting</h3>
<a name="index-Cut"></a>

<p>These variables and functions set the condition when the points are excluded (cutted) from the drawing. Note, that a point with NAN value(s) of coordinate or amplitude will be automatically excluded from the drawing. See section <a href="#Cutting-sample">Cutting sample</a>, for sample code and picture.
</p>
<p><a name="cut"></a>
</p><dl>
<dt><a name="index-cut-2"></a><u>MGL command:</u> <b>cut</b><i> <code>val</code></i></dt>
<dd><p>Flag which determines how points outside bounding box are drawn. If it is <code>true</code> then points are excluded from plot (it is default) otherwise the points are projected to edges of bounding box.
</p></dd></dl>

<dl>
<dt><a name="index-cut-3"></a><u>MGL command:</u> <b>cut</b><i> <code>x1 y1 z1 x2 y2 z2</code></i></dt>
<dd><p>Lower and upper edge of the box in which never points are drawn. If both edges are the same (the variables are equal) then the cutting box is empty.
</p></dd></dl>

<dl>
<dt><a name="index-cut-4"></a><u>MGL command:</u> <b>cut</b><i> 'cond'</i></dt>
<dd><p>Sets the cutting off condition by formula <var>cond</var>. This condition determine will point be plotted or not. If value of formula is nonzero then point is omitted, otherwise it plotted. Set argument as <code>&quot;&quot;</code> to disable cutting off condition.
</p></dd></dl>

<hr size="6">
<a name="Font-settings"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Cutting" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Palette-and-colors" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Graphics-setup" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Font-settings-1"></a>
<h3 class="subsection">3.2.6 Font settings</h3>
<a name="index-Font"></a>
<a name="index-RotateText"></a>

<p><a name="font"></a>
</p><dl>
<dt><a name="index-font"></a><u>MGL command:</u> <b>font</b><i> 'fnt' [<code>val=6</code>]</i></dt>
<dd><p>Font style for text and labels (see text). Initial style is &rsquo;fnt&rsquo;=&rsquo;:rC&rsquo; give Roman font with centering. Parameter <code>val</code> sets the size of font for tick and axis labels. Default font size of axis labels is 1.4 times large than for tick labels. For more detail, see <a href="#Font-styles">Font styles</a>.
</p></dd></dl>

<p><a name="rotatetext"></a>
</p><dl>
<dt><a name="index-rotatetext"></a><u>MGL command:</u> <b>rotatetext</b><i> <code>val</code></i></dt>
<dd><p>Sets to use or not text rotation.
</p></dd></dl>

<p><a name="loadfont"></a>
</p><dl>
<dt><a name="index-loadfont"></a><u>MGL command:</u> <b>loadfont</b><i> ['name'='']</i></dt>
<dd><p>Load font typeface from <var>path</var>/<var>name</var>. Empty name will load default font.
</p></dd></dl>


<hr size="6">
<a name="Palette-and-colors"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Font-settings" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Error-handling" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Graphics-setup" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Palette-and-colors-1"></a>
<h3 class="subsection">3.2.7 Palette and colors</h3>
<a name="index-Palette"></a>

<p><a name="palette"></a>
</p><dl>
<dt><a name="index-palette"></a><u>MGL command:</u> <b>palette</b><i> 'colors'</i></dt>
<dd><p>Sets the palette as selected colors. Default value is <code>&quot;Hbgrcmyhlnqeup&quot;</code> that corresponds to colors: dark gray &lsquo;<samp>H</samp>&rsquo;, blue &lsquo;<samp>b</samp>&rsquo;, green &lsquo;<samp>g</samp>&rsquo;, red &lsquo;<samp>r</samp>&rsquo;, cyan &lsquo;<samp>c</samp>&rsquo;, magenta &lsquo;<samp>m</samp>&rsquo;, yellow &lsquo;<samp>y</samp>&rsquo;, gray &lsquo;<samp>h</samp>&rsquo;, blue-green &lsquo;<samp>l</samp>&rsquo;, sky-blue &lsquo;<samp>n</samp>&rsquo;, orange &lsquo;<samp>q</samp>&rsquo;, yellow-green &lsquo;<samp>e</samp>&rsquo;, blue-violet &lsquo;<samp>u</samp>&rsquo;, purple &lsquo;<samp>p</samp>&rsquo;. The palette is used mostly in 1D plots (see <a href="#g_t1D-plotting">1D plotting</a>) for curves which styles are not specified. Internal color counter will be nullified by any change of palette. This includes even hidden change (for example, by <a href="#box">box</a> or <a href="#axis">axis</a> functions).
</p></dd></dl>


<hr size="6">
<a name="Error-handling"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Palette-and-colors" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Axis-settings" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Graphics-setup" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Error-handling-1"></a>
<h3 class="subsection">3.2.8 Error handling</h3>



<hr size="6">
<a name="Axis-settings"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Error-handling" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Ranges-_0028bounding-box_0029" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Axis-settings-1"></a>
<h2 class="section">3.3 Axis settings</h2>

<p>These large set of variables and functions control how the axis and ticks will be drawn. Note that there is 3-step transformation of data coordinates are performed. Firstly, coordinates are projected if <code>Cut=true</code> (see <a href="#Cutting">Cutting</a>), after it transformation formulas are applied, and finally the data was normalized in bounding box.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Ranges-_0028bounding-box_0029">3.3.1 Ranges (bounding box)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Curved-coordinates">3.3.2 Curved coordinates</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Ticks">3.3.3 Ticks</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr size="6">
<a name="Ranges-_0028bounding-box_0029"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Axis-settings" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Curved-coordinates" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Axis-settings" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Ranges-_0028bounding-box_0029-1"></a>
<h3 class="subsection">3.3.1 Ranges (bounding box)</h3>
<a name="index-CRange"></a>
<a name="index-XRange"></a>
<a name="index-YRange"></a>
<a name="index-ZRange"></a>
<a name="index-Ranges"></a>
<a name="index-Origin"></a>

<p><a name="xrange"></a>
<a name="yrange"></a>
<a name="zrange"></a>
<a name="crange"></a>
</p><dl>
<dt><a name="index-xrange-2"></a><u>MGL command:</u> <b>xrange</b><i> <code>v1 v2</code></i></dt>
<dt><a name="index-yrange-2"></a><u>MGL command:</u> <b>yrange</b><i> <code>v1 v2</code></i></dt>
<dt><a name="index-zrange-2"></a><u>MGL command:</u> <b>zrange</b><i> <code>v1 v2</code></i></dt>
<dt><a name="index-crange"></a><u>MGL command:</u> <b>crange</b><i> <code>v1 v2</code></i></dt>
<dd><p>Sets the range for &lsquo;<samp>x</samp>&rsquo;-,&lsquo;<samp>y</samp>&rsquo;-,&lsquo;<samp>z</samp>&rsquo;- coordinate or coloring (&lsquo;<samp>c</samp>&rsquo;). See also <a href="#ranges">ranges</a>.
</p></dd></dl>


<dl>
<dt><a name="index-xrange-3"></a><u>MGL command:</u> <b>xrange</b><i> dat [<code>add=off</code>]</i></dt>
<dt><a name="index-yrange-3"></a><u>MGL command:</u> <b>yrange</b><i> dat [<code>add=off</code>]</i></dt>
<dt><a name="index-zrange-3"></a><u>MGL command:</u> <b>zrange</b><i> dat [<code>add=off</code>]</i></dt>
<dt><a name="index-crange-1"></a><u>MGL command:</u> <b>crange</b><i> dat [<code>add=off</code>]</i></dt>
<dd><p>Sets the range for &lsquo;<samp>x</samp>&rsquo;-,&lsquo;<samp>y</samp>&rsquo;-,&lsquo;<samp>z</samp>&rsquo;- coordinate or coloring (&lsquo;<samp>c</samp>&rsquo;) as minimal and maximal values of data <var>dat</var>. Parameter <code>add=on</code> shows that the new range will be joined to existed one (not replace it).
</p></dd></dl>

<p><a name="ranges"></a>
</p><dl>
<dt><a name="index-ranges"></a><u>MGL command:</u> <b>ranges</b><i> <code>x1 x2 y1 y2 [z1=0 z2=0]</code></i></dt>
<dd><p>Sets the ranges of coordinates. If minimal and maximal values of the coordinate are the same then they are ignored. Also it sets the range for coloring (analogous to <code>crange z1 z2</code>). This is default color range for 2d plots. Initial ranges are [-1, 1].
</p></dd></dl>


<p><a name="origin"></a>
</p><dl>
<dt><a name="index-origin"></a><u>MGL command:</u> <b>origin</b><i> <code>x0 y0 [z0=nan]</code></i></dt>
<dd><p>Sets center of axis cross section. If one of values is NAN then MathGL try to select optimal axis position.
</p></dd></dl>

<p><a name="zoomaxis"></a>
</p><dl>
<dt><a name="index-zoomaxis"></a><u>MGL command:</u> <b>zoomaxis</b><i> <code>x1 x2</code></i></dt>
<dt><a name="index-zoomaxis-1"></a><u>MGL command:</u> <b>zoomaxis</b><i> <code>x1 y1 x2 y2</code></i></dt>
<dt><a name="index-zoomaxis-2"></a><u>MGL command:</u> <b>zoomaxis</b><i> <code>x1 y1 z1 x2 y2 z2</code></i></dt>
<dt><a name="index-zoomaxis-3"></a><u>MGL command:</u> <b>zoomaxis</b><i> <code>x1 y1 z1 c1 x2 y2 z2 c2</code></i></dt>
<dd><p>Additionally extend axis range for any settings made by <code>SetRange</code> or <code>SetRanges</code> functions according the formula <em>min += (max-min)*p1</em> and <em>max += (max-min)*p1</em> (or <em>min *= (max/min)^p1</em> and <em>max *= (max/min)^p1</em> for log-axis range when <em>inf&gt;max/min&gt;100</em> or <em>0&lt;max/min&lt;0.01</em>). Initial ranges are [0, 1]. Attention! this settings can not be overwritten by any other functions, including <code>DefaultPlotParam()</code>.
</p></dd></dl>


<hr size="6">
<a name="Curved-coordinates"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Ranges-_0028bounding-box_0029" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Ticks" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Axis-settings" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Curved-coordinates-1"></a>
<h3 class="subsection">3.3.2 Curved coordinates</h3>
<a name="index-Axis"></a>

<dl>
<dt><a name="index-axis"></a><u>MGL command:</u> <b>axis</b><i> 'fx' 'fy' 'fz' ['fa'='']</i></dt>
<dd><p>Sets transformation formulas for curvilinear coordinate. Each string should contain mathematical expression for real coordinate depending on internal coordinates &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo; and &lsquo;<samp>a</samp>&rsquo; or &lsquo;<samp>c</samp>&rsquo; for colorbar. For example, the cylindrical coordinates are introduced as <code>SetFunc(&quot;x*cos(y)&quot;, &quot;x*sin(y)&quot;, &quot;z&quot;);</code>. For removing of formulas the corresponding parameter should be empty or <code>NULL</code>. Using transformation formulas will slightly slowing the program. Parameter <var>EqA</var> set the similar transformation formula for color scheme. See section <a href="#Textual-formulas">Textual formulas</a>.
</p></dd></dl>

<dl>
<dt><a name="index-axis-1"></a><u>MGL command:</u> <b>axis</b><i> <code>how</code></i></dt>
<dd><p>Sets one of the predefined transformation formulas for curvilinear coordinate. Paramater <var>how</var> define the coordinates: <code>mglCartesian=0</code> &ndash; Cartesian coordinates (no transformation); <code>mglPolar=1</code> &ndash; Polar coordinates <em>x_n=x*cos(y),y_n=x*sin(y), z_n=z</em>; <code>mglSpherical=2</code> &ndash; Sperical coordinates <em>x_n=x*sin(y)*cos(z), y_n=x*sin(y)*sin(z), z_n=x*cos(y)</em>; <code>mglParabolic=3</code> &ndash; Parabolic coordinates <em>x_n=x*y, y_n=(x*x-y*y)/2, z_n=z</em>; <code>mglParaboloidal=4</code> &ndash; Paraboloidal coordinates <em>x_n=(x*x-y*y)*cos(z)/2, y_n=(x*x-y*y)*sin(z)/2, z_n=x*y</em>; <code>mglOblate=5</code> &ndash; Oblate coordinates <em>x_n=cosh(x)*cos(y)*cos(z), y_n=cosh(x)*cos(y)*sin(z), z_n=sinh(x)*sin(y)</em>; <code>mglProlate=6</code> &ndash; Prolate coordinates <em>x_n=sinh(x)*sin(y)*cos(z), y_n=sinh(x)*sin(y)*sin(z), z_n=cosh(x)*cos(y)</em>; <code>mglElliptic=7</code> &ndash; Elliptic coordinates <em>x_n=cosh(x)*cos(y), y_n=sinh(x)*sin(y), z_n=z</em>; <code>mglToroidal=8</code> &ndash; Toroidal coordinates <em>x_n=sinh(x)*cos(z)/(cosh(x)-cos(y)), y_n=sinh(x)*sin(z)/(cosh(x)-cos(y)), z_n=sin(y)/(cosh(x)-cos(y))</em>; <code>mglBispherical=9</code> &ndash; Bispherical coordinates <em>x_n=sin(y)*cos(z)/(cosh(x)-cos(y)), y_n=sin(y)*sin(z)/(cosh(x)-cos(y)), z_n=sinh(x)/(cosh(x)-cos(y))</em>; <code>mglBipolar=10</code> &ndash; Bipolar coordinates <em>x_n=sinh(x)/(cosh(x)-cos(y)), y_n=sin(y)/(cosh(x)-cos(y)), z_n=z</em>; <code>mglLogLog=11</code> &ndash; log-log coordinates <em>x_n=lg(x), y_n=lg(y), z_n=lg(z)</em>; <code>mglLogX=12</code> &ndash; log-x coordinates <em>x_n=lg(x), y_n=y, z_n=z</em>; <code>mglLogY=13</code> &ndash; log-y coordinates <em>x_n=x, y_n=lg(y), z_n=z</em>.
</p></dd></dl>

<p><a name="ternary"></a>
</p><dl>
<dt><a name="index-ternary"></a><u>MGL command:</u> <b>ternary</b><i> <code>val</code></i></dt>
<dd><p>The function sets to draws Ternary (<var>tern</var>=<code>1</code>), Quaternary (<var>tern</var>=<code>2</code>) plot or projections (<var>tern</var>=<code>4,5,6</code>).
</p>
<p>Ternary plot is special plot for 3 dependent coordinates (components) <var>a</var>, <var>b</var>, <var>c</var> so that <var>a</var>+<var>b</var>+<var>c</var>=1. MathGL uses only 2 independent coordinates <var>a</var>=x and <var>b</var>=y since it is enough to plot everything. At this third coordinate z act as another parameter to produce contour lines, surfaces and so on. 
</p>
<p>Correspondingly, Quaternary plot is plot for 4 dependent coordinates <var>a</var>, <var>b</var>, <var>c</var> and <var>d</var> so that <var>a</var>+<var>b</var>+<var>c</var>+<var>d</var>=1. MathGL uses only 3 independent coordinates <var>a</var>=x, <var>b</var>=y and <var>d</var>=z since it is enough to plot everything.
</p>
<p>Projections can be obtained by adding value <code>4</code> to <var>tern</var> argument. So, that <var>tern</var>=<code>4</code> will draw projections in Cartesian coordinates, <var>tern</var>=<code>5</code> will draw projections in Ternary coordinates, <var>tern</var>=<code>6</code> will draw projections in Quaternary coordinates.
</p>
<p>Use <code>Ternary(0)</code> for returning to usual axis. See section <a href="#Ternary-axis">Ternary axis</a>, for sample code and picture. See section <a href="#Axis-projection">Axis projection</a>, for sample code and picture.
</p></dd></dl>

<hr size="6">
<a name="Ticks"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Curved-coordinates" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Subplots-and-rotation" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Axis-settings" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Ticks-1"></a>
<h3 class="subsection">3.3.3 Ticks</h3>
<a name="index-AxisStl"></a>
<a name="index-TickLen"></a>
<a name="index-Adjust"></a>
<a name="index-XTick"></a>
<a name="index-YTick"></a>
<a name="index-ZTick"></a>
<a name="index-CTick"></a>

<p><a name="adjust"></a>
</p><dl>
<dt><a name="index-adjust"></a><u>MGL command:</u> <b>adjust</b><i> ['dir'='xyzc']</i></dt>
<dd><p>Set the ticks step, number of sub-ticks and initial ticks position to be the most human readable for the axis along direction(s) <var>dir</var>. Also set <code>SetTuneTicks(true)</code>. Usually you don&rsquo;t need to call this function except the case of returning to default settings.
</p></dd></dl>

<p><a name="xtick"></a>
<a name="ytick"></a>
<a name="ztick"></a>
<a name="ctick"></a>
</p><dl>
<dt><a name="index-xtick"></a><u>MGL command:</u> <b>xtick</b><i> <code>val [sub=0 org=nan]</code></i></dt>
<dt><a name="index-ytick"></a><u>MGL command:</u> <b>ytick</b><i> <code>val [sub=0 org=nan]</code></i></dt>
<dt><a name="index-ztick"></a><u>MGL command:</u> <b>ztick</b><i> <code>val [sub=0 org=nan]</code></i></dt>
<dt><a name="index-ctick"></a><u>MGL command:</u> <b>ctick</b><i> <code>val [sub=0 org=nan]</code></i></dt>
<dd><p>Set the ticks step <var>d</var>, number of sub-ticks <var>ns</var> (used for positive <var>d</var>) and initial ticks position <var>org</var> for the axis along direction <var>dir</var> (use &rsquo;c&rsquo; for colorbar ticks). Variable <var>d</var> set step for axis ticks (if positive) or it&rsquo;s number on the axis range (if negative). Zero value set automatic ticks. If <var>org</var> value is NAN then axis origin is used.
</p></dd></dl>

<dl>
<dt><a name="index-xtick-1"></a><u>MGL command:</u> <b>xtick</b><i> <code>val1</code> 'lbl1' [<code>val2</code> 'lbl2' ...]</i></dt>
<dt><a name="index-ytick-1"></a><u>MGL command:</u> <b>ytick</b><i> <code>val1</code> 'lbl1' [<code>val2</code> 'lbl2' ...]</i></dt>
<dt><a name="index-ztick-1"></a><u>MGL command:</u> <b>ztick</b><i> <code>val1</code> 'lbl1' [<code>val2</code> 'lbl2' ...]</i></dt>
<dd><p>Set the manual positions <var>val</var> and its labels <var>lbl</var> for ticks along axis <var>dir</var>. If array <var>val</var> is absent then values equidistantly distributed in interval [<var>Min</var>.x, <var>Max</var>.x] are used. Labels are separated by &lsquo;<samp>\n</samp>&rsquo; symbol. Use <code>SetTicks()</code> to restore automatic ticks.
</p></dd></dl>

<dl>
<dt><a name="index-xtick-2"></a><u>MGL command:</u> <b>xtick</b><i> 'templ'</i></dt>
<dt><a name="index-ytick-2"></a><u>MGL command:</u> <b>ytick</b><i> 'templ'</i></dt>
<dt><a name="index-ztick-2"></a><u>MGL command:</u> <b>ztick</b><i> 'templ'</i></dt>
<dt><a name="index-ctick-1"></a><u>MGL command:</u> <b>ctick</b><i> 'templ'</i></dt>
<dd><p>Set template <var>templ</var> for x-,y-,z-axis ticks or colorbar ticks. It may contain TeX symbols also. If <var>templ</var>=<code>&quot;&quot;</code> then default template is used (in simplest case it is &lsquo;<samp>%.2g</samp>&rsquo;). Setting on template switch off automatic ticks tuning.
</p></dd></dl>

<p><a name="ticktime"></a>
</p><dl>
<dt><a name="index-ticktime"></a><u>MGL command:</u> <b>ticktime</b><i> 'dir' [<code>dv</code> 'tmpl']</i></dt>
<dd><p>Sets time labels with step <var>val</var> and template <var>templ</var> for x-,y-,z-axis ticks or colorbar ticks. It may contain TeX symbols also. The format of template <var>templ</var> is the same as described in <a href="http://www.manpagez.com/man/3/strftime/">http://www.manpagez.com/man/3/strftime/</a>. Most common variants are &lsquo;<samp>%X</samp>&rsquo; for national representation of time, &lsquo;<samp>%x</samp>&rsquo; for national representation of date, &lsquo;<samp>%Y</samp>&rsquo; for year with century. If <var>val</var>=0 and/or <var>templ</var>=&quot;&quot; then automatic tick step and/or template will be selected. You can use <code>mgl_get_time</code>() function for obtaining number of second for given date/time string. Note, that MS Visual Studio couldn&rsquo;t handle date before 1970.
</p></dd></dl>


<p><a name="tuneticks"></a>
</p><dl>
<dt><a name="index-tuneticks"></a><u>MGL command:</u> <b>tuneticks</b><i> <code>val</code> [<code>pos=1.15</code>]</i></dt>
<dd><p>Switch on/off ticks enhancing by factoring common multiplier (for small, like from 0.001 to 0.002, or large, like from 1000 to 2000, coordinate values &ndash; enabled if <var>tune</var>&amp;1 is nonzero) or common component (for narrow range, like from 0.999 to 1.000 &ndash; enabled if <var>tune</var>&amp;2 is nonzero). Also set the position <var>pos</var> of common multiplier/component on the axis: =0 at minimal axis value, =1 at maximal axis value. Default value is 1.15.
</p></dd></dl>

<p><a name="tickshift"></a>
</p><dl>
<dt><a name="index-tickshift"></a><u>MGL command:</u> <b>tickshift</b><i> <code>dx [dy=0 dz=0 dc=0]</code></i></dt>
<dd><p>Set value of additional shift for ticks labels.
</p></dd></dl>


<p><a name="origintick"></a>
</p><dl>
<dt><a name="index-origintick"></a><u>MGL command:</u> <b>origintick</b><i> <code>val</code></i></dt>
<dd><p>Enable/disable drawing of ticks labels at axis origin. In C/Fortran you can use <code>mgl_set_flag(gr,val, MGL_NO_ORIGIN);</code>.
</p></dd></dl>

<p><a name="ticklen"></a>
</p><dl>
<dt><a name="index-ticklen"></a><u>MGL command:</u> <b>ticklen</b><i> <code>val</code> [<code>stt=1</code>]</i></dt>
<dd><p>The relative length of axis ticks. Default value is <code>0.1</code>. Parameter <var>stt</var>&gt;0 set relative length of subticks which is in <code>sqrt(1+stt)</code> times smaller.
</p></dd></dl>

<dl>
<dt><a name="index-axisstl"></a><u>MGL command:</u> <b>axisstl</b><i> 'stl' ['tck'='' 'sub'='']</i></dt>
<dd><p>The line style of axis (<var>stl</var>), ticks (<var>tck</var>) and subticks (<var>sub</var>). If <var>stl</var> is empty then default style is used (&lsquo;<samp>k</samp>&rsquo; or &lsquo;<samp>w</samp>&rsquo; depending on transparency type). If <var>tck</var> or <var>sub</var> is empty then axis style is used (i.e. <var>stl</var>).
</p></dd></dl>


<hr size="6">
<a name="Subplots-and-rotation"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Ticks" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Export-picture" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Subplots-and-rotation-1"></a>
<h2 class="section">3.4 Subplots and rotation</h2>
<a name="index-Aspect"></a>
<a name="index-Rotate"></a>
<a name="index-RotateN"></a>
<a name="index-SubPlot"></a>
<a name="index-MultiPlot"></a>
<a name="index-StickPlot"></a>
<a name="index-ColumnPlot"></a>
<a name="index-InPlot"></a>
<a name="index-Title"></a>
<a name="index-Perspective"></a>
<a name="index-View"></a>
<a name="index-Push"></a>
<a name="index-Pop"></a>

<p>These functions control how and where further plotting will be placed. There is a certain calling order of these functions for the better plot appearance. First one should be <a href="#subplot">subplot</a>, <a href="#multiplot">multiplot</a> or <a href="#inplot">inplot</a> for specifying the place. Second one can be <a href="#title">title</a> for adding title for the subplot. After it a <a href="#rotate">rotate</a> and <a href="#aspect">aspect</a>. And finally any other plotting functions may be called. Alternatively you can use <a href="#columnplot">columnplot</a>, <a href="#gridplot">gridplot</a>, <a href="#stickplot">stickplot</a> or relative <a href="#inplot">inplot</a> for positioning plots in the column (or grid, or stick) one by another without gap between plot axis (bounding boxes). See section <a href="#Subplots">Subplots</a>, for sample code and picture.
</p>
<p><a name="subplot"></a>
</p><dl>
<dt><a name="index-subplot"></a><u>MGL command:</u> <b>subplot</b><i> <code>nx ny m ['stl'='&lt;&gt;_^' dx=0 dy=0]</code></i></dt>
<dd><p>Puts further plotting in a <var>m</var>-th cell of <var>nx</var>*<var>ny</var> grid of the whole frame area. This function set off any aspects or rotations. So it should be used first for creating the subplot. Extra space will be reserved for axis/colorbar if <var>stl</var> contain:
</p><ul>
<li>
&lsquo;<samp>L</samp>&rsquo; or &lsquo;<samp>&lt;</samp>&rsquo; &ndash; at left side,
</li><li>
&lsquo;<samp>R</samp>&rsquo; or &lsquo;<samp>&gt;</samp>&rsquo; &ndash; at right side,
</li><li>
&lsquo;<samp>A</samp>&rsquo; or &lsquo;<samp>^</samp>&rsquo; &ndash; at top side,
</li><li>
&lsquo;<samp>U</samp>&rsquo; or &lsquo;<samp>_</samp>&rsquo; &ndash; at bottom side,
</li><li>
&lsquo;<samp>#</samp>&rsquo; &ndash; reserve none space (use whole region for axis range).
</li></ul>
<p>From the aesthetical point of view it is not recommended to use this function with different matrices in the same frame. The position of the cell can be shifted from its default position by relative size <var>dx</var>, <var>dy</var>.
</p></dd></dl>

<p><a name="multiplot"></a>
</p><dl>
<dt><a name="index-multiplot"></a><u>MGL command:</u> <b>multiplot</b><i> <code>nx ny m dx dy</code> ['style'='&lt;&gt;_^']</i></dt>
<dd><p>Puts further plotting in a rectangle of <var>dx</var>*<var>dy</var> cells starting from <var>m</var>-th cell of <var>nx</var>*<var>ny</var> grid of the whole frame area. This function set off any aspects or rotations.  So it should be used first for creating subplot. Extra space will be reserved for axis/colorbar if <var>stl</var> contain:
</p><ul>
<li>
&lsquo;<samp>L</samp>&rsquo; or &lsquo;<samp>&lt;</samp>&rsquo; &ndash; at left side,
</li><li>
&lsquo;<samp>R</samp>&rsquo; or &lsquo;<samp>&gt;</samp>&rsquo; &ndash; at right side,
</li><li>
&lsquo;<samp>A</samp>&rsquo; or &lsquo;<samp>^</samp>&rsquo; &ndash; at top side,
</li><li>
&lsquo;<samp>U</samp>&rsquo; or &lsquo;<samp>_</samp>&rsquo; &ndash; at bottom side.
</li></ul>
</dd></dl>

<p><a name="inplot"></a>
</p><dl>
<dt><a name="index-inplot"></a><u>MGL command:</u> <b>inplot</b><i> <code>x1 x2 y1 y2 [rel=on]</code></i></dt>
<dd><p>Puts further plotting in some region of the whole frame surface. This function allows one to create a plot in arbitrary place of the screen. The position is defined by rectangular coordinates [<var>x1</var>, <var>x2</var>]*[<var>y1</var>, <var>y2</var>]. The coordinates <var>x1</var>, <var>x2</var>, <var>y1</var>, <var>y2</var> are normalized to interval [0, 1]. If parameter <var>rel</var>=<code>true</code> then the relative position to current <a href="#subplot">subplot</a> (or <a href="#inplot">inplot</a> with <var>rel</var>=<code>false</code>) is used. This function set off any aspects or rotations. So it should be used first for creating subplot.
</p></dd></dl>

<p><a name="columnplot"></a>
</p><dl>
<dt><a name="index-columnplot"></a><u>MGL command:</u> <b>columnplot</b><i> <code>num ind [d=0]</code></i></dt>
<dd><p>Puts further plotting in <var>ind</var>-th cell of column with <var>num</var> cells. The position is relative to previous <a href="#subplot">subplot</a> (or <a href="#inplot">inplot</a> with <var>rel</var>=<code>false</code>). Parameter <var>d</var> set extra gap between cells.
</p></dd></dl>

<p><a name="gridplot"></a>
</p><dl>
<dt><a name="index-gridplot"></a><u>MGL command:</u> <b>gridplot</b><i> <code>nx ny ind [d=0]</code></i></dt>
<dd><p>Puts further plotting in <var>ind</var>-th cell of <var>nx</var>*<var>ny</var> grid. The position is relative to previous <a href="#subplot">subplot</a> (or <a href="#inplot">inplot</a> with <var>rel</var>=<code>false</code>). Parameter <var>d</var> set extra gap between cells.
</p></dd></dl>

<p><a name="stickplot"></a>
</p><dl>
<dt><a name="index-stickplot"></a><u>MGL command:</u> <b>stickplot</b><i> <code>num ind tet phi</code></i></dt>
<dd><p>Puts further plotting in <var>ind</var>-th cell of stick with <var>num</var> cells. At this, stick is rotated on angles <var>tet</var>, <var>phi</var>. The position is relative to previous <a href="#subplot">subplot</a> (or <a href="#inplot">inplot</a> with <var>rel</var>=<code>false</code>).
</p></dd></dl>

<p><a name="title"></a>
</p><dl>
<dt><a name="index-title"></a><u>MGL command:</u> <b>title</b><i> 'title' ['stl'='' <code>size=-2</code>]</i></dt>
<dd><p>Add text <var>title</var> for current subplot/inplot. Paramater <var>stl</var> can contain:
</p><ul>
<li>
font style (see, <a href="#Font-styles">Font styles</a>);
</li><li>
&lsquo;<samp>#</samp>&rsquo; for box around the title.
</li></ul>
<p>Parameter <var>size</var> set font size. This function set off any aspects or rotations. So it should be used just after creating subplot.
</p></dd></dl>

<p><a name="rotate"></a>
</p><dl>
<dt><a name="index-rotate"></a><u>MGL command:</u> <b>rotate</b><i> <code>tetz tetx [tety=0]</code></i></dt>
<dd><p>Rotates a further plotting relative to each axis {x, z, y} consecutively on angles <var>TetX</var>, <var>TetZ</var>, <var>TetY</var>.
</p></dd></dl>

<dl>
<dt><a name="index-rotate-1"></a><u>MGL command:</u> <b>rotate</b><i> <code>tet x y z</code></i></dt>
<dd><p>Rotates a further plotting around vector {<var>x</var>, <var>y</var>, <var>z</var>} on angle <var>Tet</var>.
</p></dd></dl>

<p><a name="aspect"></a>
</p><dl>
<dt><a name="index-aspect"></a><u>MGL command:</u> <b>aspect</b><i> <code>ax ay [az=1]</code></i></dt>
<dd><p>Defines aspect ratio for the plot. The viewable axes will be related one to another as the ratio <var>Ax:Ay:Az</var>. For the best effect it should be used after <a href="#rotate">rotate</a> function. If <var>Ax</var> is <code>NAN</code> then function try to select optimal aspect ratio to keep equal ranges for x-y axis. At this, <var>Ay</var> will specify proportionality factor, or set to use automatic one if <var>Ay</var>=<code>NAN</code>.
</p></dd></dl>

<p><a name="perspective"></a>
</p><dl>
<dt><a name="index-perspective"></a><u>MGL command:</u> <b>perspective</b><i> <code>val</code></i></dt>
<dd><p>Add (switch on) the perspective to plot. The parameter <em>a ~ 1/z_eff \in [0,1)</em>. By default (<code>a=0</code>) the perspective is off.
</p></dd></dl>


<p>There are 2 functions <code>View()</code> and <code>Zoom()</code> which transform whole image. I.e. they act as secondary transformation matrix. They were introduced for rotating/zooming the whole plot by mouse. It is not recommended to call them for picture drawning.
</p>
<p><a name="view"></a>
</p><dl>
<dt><a name="index-view"></a><u>MGL command:</u> <b>view</b><i> <code>tetx tetz [tety=0]</code></i></dt>
<dd><p>Rotates a further plotting relative to each axis {x, z, y} consecutively on angles <var>TetX</var>, <var>TetZ</var>, <var>TetY</var>. Rotation is done independently on <a href="#rotate">rotate</a>. Attention! this settings can not be overwritten by <code>DefaultPlotParam()</code>. Use <code>Zoom(0,0,1,1)</code> to return default view.
</p></dd></dl>

<p><a name="zoom"></a>
</p><dl>
<dt><a name="index-zoom"></a><u>MGL command:</u> <b>zoom</b><i> <code>x1 y1 x2 y2</code></i></dt>
<dd><p>The function changes the scale of graphics that correspond to zoom in/out of the picture. After function call the current plot will be cleared and further the picture will contain plotting from its part [x1,x2]*[y1,y2]. Here picture coordinates <var>x1</var>, <var>x2</var>, <var>y1</var>, <var>y2</var> changes from 0 to 1. Attention! this settings can not be overwritten by any other functions, including <code>DefaultPlotParam()</code>. Use <code>Zoom(0,0,1,1)</code> to return default view.
</p></dd></dl>


<hr size="6">
<a name="Export-picture"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Subplots-and-rotation" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Export-to-file" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Export-picture-1"></a>
<h2 class="section">3.5 Export picture</h2>
<a name="index-SetSize"></a>

<p>Functions in this group save or give access to produced picture. So, usually they should be called after plotting is done.
</p>
<p><a name="setsize"></a>
</p><dl>
<dt><a name="index-setsize"></a><u>MGL command:</u> <b>setsize</b><i> <code>w h</code></i></dt>
<dd><p>Sets size of picture in pixels. This function <strong>must be</strong> called before any other plotting because it completely remove picture contents.
</p></dd></dl>

<p><a name="quality"></a>
</p><dl>
<dt><a name="index-quality"></a><u>MGL command:</u> <b>quality</b><i> [<code>val</code>=2]</i></dt>
<dd><p>Sets quality of the plot depending on value <var>val</var>: <code>MGL_DRAW_WIRE=0</code> &ndash; no face drawing (fastest), <code>MGL_DRAW_FAST=1</code> &ndash; no color interpolation (fast), <code>MGL_DRAW_NORM=2</code> &ndash; high quality (normal), <code>MGL_DRAW_HIGH=3</code> &ndash; high quality with 3d primitives (arrows and marks). If <code>MGL_DRAW_LMEM=0x4</code> is set then direct bitmap drawing is used (low memory usage).
</p></dd></dl>


<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Export-to-file">3.5.1 Export to file</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Frames_002fAnimation">3.5.2 Frames/Animation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Bitmap-in-memory">3.5.3 Bitmap in memory</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Parallelization">3.5.4 Parallelization</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr size="6">
<a name="Export-to-file"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Export-picture" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Frames_002fAnimation" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Export-picture" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Export-to-file-1"></a>
<h3 class="subsection">3.5.1 Export to file</h3>
<a name="index-Write"></a>

<p>These functions export current view to a graphic file. The filename <var>fname</var> should have appropriate extension. Parameter <var>descr</var> gives the short description of the picture. Just now the transparency is supported in PNG, SVG, OBJ and PRC files.
</p>
<p><a name="write"></a>
</p><dl>
<dt><a name="index-write"></a><u>MGL command:</u> <b>write</b><i> ['fname'='']</i></dt>
<dd><p>Exports current frame to a file <var>fname</var> which type is determined by the extension. Parameter <var>descr</var> adds description to file (can be <code>&quot;&quot;</code>). If <var>fname</var>=<code>&quot;&quot;</code> then the file &lsquo;<samp>frame####.jpg</samp>&rsquo; is used, where &lsquo;<samp>####</samp>&rsquo; is current frame id and name &lsquo;<samp>frame</samp>&rsquo; is defined by <a href="#plotid">plotid</a> class property.
</p></dd></dl>



<hr size="6">
<a name="Frames_002fAnimation"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Export-to-file" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Bitmap-in-memory" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Export-picture" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Frames_002fAnimation-1"></a>
<h3 class="subsection">3.5.2 Frames/Animation</h3>

<p>There are no commands for making animation in MGL. However you can use features of <code>mglconv</code> and <code>mglview</code> utilities. For example, by busing special comments &lsquo;<samp>##a </samp>&rsquo; or &lsquo;<samp>##c </samp>&rsquo;.
</p>

<hr size="6">
<a name="Bitmap-in-memory"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Frames_002fAnimation" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Parallelization" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Export-picture" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Bitmap-in-memory-1"></a>
<h3 class="subsection">3.5.3 Bitmap in memory</h3>


<hr size="6">
<a name="Parallelization"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Bitmap-in-memory" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Primitives" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Export-picture" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Parallelization-1"></a>
<h3 class="subsection">3.5.4 Parallelization</h3>




<hr size="6">
<a name="Primitives"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Parallelization" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Text-printing" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Primitives-1"></a>
<h2 class="section">3.6 Primitives</h2>
<a name="index-Ball"></a>
<a name="index-Clf"></a>
<a name="index-Line"></a>
<a name="index-Curve"></a>
<a name="index-Glyph"></a>
<a name="index-Face"></a>
<a name="index-FaceX"></a>
<a name="index-FaceY"></a>
<a name="index-FaceZ"></a>
<a name="index-Cone"></a>
<a name="index-Drop"></a>
<a name="index-Sphere"></a>


<p>These functions draw some simple objects like line, point, sphere, drop, cone and so on. See section <a href="#Using-primitives">Using primitives</a>, for sample code and picture.
</p>
<p><a name="clf"></a>
</p><dl>
<dt><a name="index-clf"></a><u>MGL command:</u> <b>clf</b></dt>
<dd><p>Clear the picture and fill it by color specified color.
</p></dd></dl>

<p><a name="ball"></a>
</p><dl>
<dt><a name="index-ball"></a><u>MGL command:</u> <b>ball</b><i> <code>x y</code> ['col'='r.']</i></dt>
<dt><a name="index-ball-1"></a><u>MGL command:</u> <b>ball</b><i> <code>x y z</code> ['col'='r.']</i></dt>
<dd><p>Draws a mark (point &lsquo;<samp>.</samp>&rsquo; by default) at position <var>p</var>={<var>x</var>, <var>y</var>, <var>z</var>} with color <var>col</var>.
</p></dd></dl>

<p><a name="errbox"></a>
</p><dl>
<dt><a name="index-errbox"></a><u>MGL command:</u> <b>errbox</b><i> <code>x y ex ey</code> ['stl'='']</i></dt>
<dt><a name="index-errbox-1"></a><u>MGL command:</u> <b>errbox</b><i> <code>x y z ex ey ez</code> ['stl'='']</i></dt>
<dd><p>Draws a 3d error box at position <var>p</var>={<var>x</var>, <var>y</var>, <var>z</var>} with sizes <var>e</var>={<var>ex</var>, <var>ey</var>, <var>ez</var>} and style <var>stl</var>. Use NAN for component of <var>e</var> to reduce number of drawn elements.
</p></dd></dl>

<p><a name="line"></a>
</p><dl>
<dt><a name="index-line"></a><u>MGL command:</u> <b>line</b><i> <code>x1 y1 x2 y2</code> ['stl'='']</i></dt>
<dt><a name="index-line-1"></a><u>MGL command:</u> <b>line</b><i> <code>x1 y1 z1 x2 y2 z2</code> ['stl'='']</i></dt>
<dd><p>Draws a geodesic line (straight line in Cartesian coordinates) from point <var>p1</var> to <var>p2</var> using line style <var>stl</var>. Parameter <var>num</var> define the &ldquo;quality&rdquo; of the line. If <var>num</var>=<code>2</code> then the stright line will be drawn in all coordinate system (independently on transformation formulas (see <a href="#Curved-coordinates">Curved coordinates</a>). Contrary, for large values (for example, =<code>100</code>) the geodesic line will be drawn in corresponding coordinate system (straight line in Cartesian coordinates, circle in polar coordinates and so on). Line will be drawn even if it lies out of bounding box.
</p></dd></dl>

<p><a name="curve"></a>
</p><dl>
<dt><a name="index-curve"></a><u>MGL command:</u> <b>curve</b><i> <code>x1 y1 dx1 dy1 x2 y2 dx2 dy2</code> ['stl'='']</i></dt>
<dt><a name="index-curve-1"></a><u>MGL command:</u> <b>curve</b><i> <code>x1 y1 z1 dx1 dy1 dz1 x2 y2 z2 dx2 dy2 dz2</code> ['stl'='']</i></dt>
<dd><p>Draws Bezier-like curve from point <var>p1</var> to <var>p2</var> using line style <var>stl</var>. At this tangent is codirected with <var>d1</var>, <var>d2</var> and proportional to its amplitude. Parameter <var>num</var> define the &ldquo;quality&rdquo; of the curve. If <var>num</var>=<code>2</code> then the straight line will be drawn in all coordinate system (independently on transformation formulas, see <a href="#Curved-coordinates">Curved coordinates</a>). Contrary, for large values (for example, =<code>100</code>) the spline like Bezier curve will be drawn in corresponding coordinate system. Curve will be drawn even if it lies out of bounding box.
</p></dd></dl>

<p><a name="face"></a>
</p><dl>
<dt><a name="index-face"></a><u>MGL command:</u> <b>face</b><i> <code>x1 y1 x2 y2 x3 y3 x4 y4</code> ['stl'='']</i></dt>
<dt><a name="index-face-1"></a><u>MGL command:</u> <b>face</b><i> <code>x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4</code> ['stl'='']</i></dt>
<dd><p>Draws the solid quadrangle (face) with vertexes <var>p1</var>, <var>p2</var>, <var>p3</var>, <var>p4</var> and with color(s) <var>stl</var>. At this colors can be the same for all vertexes or different if all 4 colors are specified for each vertex. Face will be drawn even if it lies out of bounding box.
</p></dd></dl>

<p><a name="rect"></a>
</p><dl>
<dt><a name="index-rect"></a><u>MGL command:</u> <b>rect</b><i> <code>x1 y1 x2 y2</code> ['stl'='']</i></dt>
<dt><a name="index-rect-1"></a><u>MGL command:</u> <b>rect</b><i> <code>x1 y1 z1 x2 y2 z2</code> ['stl'='']</i></dt>
<dd><p>Draws the solid rectangle (face) with vertexes {<var>x1</var>, <var>y1</var>, <var>z1</var>} and {<var>x2</var>, <var>y2</var>, <var>z2</var>} with color <var>stl</var>. At this colors can be the same for all vertexes or separately if all 4 colors are specified for each vertex. Face will be drawn even if it lies out of bounding box.
</p></dd></dl>

<p><a name="facex"></a>
<a name="facey"></a>
<a name="facez"></a>
</p><dl>
<dt><a name="index-facex"></a><u>MGL command:</u> <b>facex</b><i> <code>x0 y0 z0 wy wz</code> ['stl'='' <code>d1=0 d2=0</code>]</i></dt>
<dt><a name="index-facey"></a><u>MGL command:</u> <b>facey</b><i> <code>x0 y0 z0 wx wz</code> ['stl'='' <code>d1=0 d2=0</code>]</i></dt>
<dt><a name="index-facez"></a><u>MGL command:</u> <b>facez</b><i> <code>x0 y0 z0 wx wy</code> ['stl'='' <code>d1=0 d2=0</code>]</i></dt>
<dd><p>Draws the solid rectangle (face) perpendicular to [x,y,z]-axis correspondingly at position {<var>x0</var>, <var>y0</var>, <var>z0</var>} with color <var>stl</var> and with widths <var>wx</var>, <var>wy</var>, <var>wz</var> along corresponding directions. At this colors can be the same for all vertexes or separately if all 4 colors are specified for each vertex. Parameters <var>d1</var>!=0, <var>d2</var>!=0 set additional shift of the last vertex (i.e. to draw quadrangle). Face will be drawn even if it lies out of bounding box.
</p></dd></dl>

<p><a name="sphere"></a>
</p><dl>
<dt><a name="index-sphere"></a><u>MGL command:</u> <b>sphere</b><i> <code>x0 y0 r</code> ['col'='r']</i></dt>
<dt><a name="index-sphere-1"></a><u>MGL command:</u> <b>sphere</b><i> <code>x0 y0 z0 r</code> ['col'='r']</i></dt>
<dd><p>Draw the sphere with radius <var>r</var> and center at point <var>p</var>={<var>x0</var>, <var>y0</var>, <var>z0</var>} and color <var>stl</var>.
</p></dd></dl>

<p><a name="drop"></a>
</p><dl>
<dt><a name="index-drop"></a><u>MGL command:</u> <b>drop</b><i> <code>x0 y0 dx dy r</code> ['col'='r' <code>sh=1 asp=1</code>]</i></dt>
<dt><a name="index-drop-1"></a><u>MGL command:</u> <b>drop</b><i> <code>x0 y0 z0 dx dy dz r</code> ['col'='r' <code>sh=1 asp=1</code>]</i></dt>
<dd><p>Draw the drop with radius <var>r</var> at point <var>p</var> elongated in direction <var>d</var> and with color <var>col</var>. Parameter <var>shift</var> set the degree of drop oblongness: &lsquo;<samp>0</samp>&rsquo; is sphere, &lsquo;<samp>1</samp>&rsquo; is maximally oblongness drop. Parameter <var>ap</var> set relative width of the drop (this is analogue of &ldquo;ellipticity&rdquo; for the sphere).
</p></dd></dl>

<p><a name="cone"></a>
</p><dl>
<dt><a name="index-cone"></a><u>MGL command:</u> <b>cone</b><i> <code>x1 y1 z1 x2 y2 z2 r1</code> [<code>r2=-1</code> 'stl'='']</i></dt>
<dd><p>Draw tube (or truncated cone if <var>edge</var>=<code>false</code>) between points <var>p1</var>, <var>p2</var> with radius at the edges <var>r1</var>, <var>r2</var>. If <var>r2</var>&lt;0 then it is supposed that <var>r2</var>=<var>r1</var>. The cone color is defined by string <var>stl</var>. If style contain &lsquo;<samp>@</samp>&rsquo; then edges will be drawn.
</p></dd></dl>

<p><a name="circle"></a>
</p><dl>
<dt><a name="index-circle"></a><u>MGL command:</u> <b>circle</b><i> <code>x0 y0 r</code> ['col'='r']</i></dt>
<dt><a name="index-circle-1"></a><u>MGL command:</u> <b>circle</b><i> <code>x0 y0 z0 r</code> ['col'='r']</i></dt>
<dd><p>Draw the circle with radius <var>r</var> and center at point <var>p</var>={<var>x0</var>, <var>y0</var>, <var>z0</var>}. Parameter <var>col</var> may contain
</p><ul>
<li>
colors for filling and boundary (second one if style &lsquo;<samp>@</samp>&rsquo; is used, black color is used by default);
</li><li>
&lsquo;<samp>#</samp>&rsquo; for wire figure (boundary only);
</li><li>
&lsquo;<samp>@</samp>&rsquo; for filling and boundary.
</li></ul>
</dd></dl>

<p><a name="ellipse"></a>
</p><dl>
<dt><a name="index-ellipse"></a><u>MGL command:</u> <b>ellipse</b><i> <code>x1 y1 x2 y2 r</code> ['col'='r']</i></dt>
<dt><a name="index-ellipse-1"></a><u>MGL command:</u> <b>ellipse</b><i> <code>x1 y1 z1 x2 y2 z2 r</code> ['col'='r']</i></dt>
<dd><p>Draw the ellipse with radius <var>r</var> and focal points <var>p1</var>, <var>p2</var>. Parameter <var>col</var> may contain
</p><ul>
<li>
colors for filling and boundary (second one if style &lsquo;<samp>@</samp>&rsquo; is used, black color is used by default);
</li><li>
&lsquo;<samp>#</samp>&rsquo; for wire figure (boundary only);
</li><li>
&lsquo;<samp>@</samp>&rsquo; for filling and boundary.
</li></ul>
</dd></dl>

<p><a name="rhomb"></a>
</p><dl>
<dt><a name="index-rhomb"></a><u>MGL command:</u> <b>rhomb</b><i> <code>x1 y1 x2 y2 r</code> ['col'='r']</i></dt>
<dt><a name="index-rhomb-1"></a><u>MGL command:</u> <b>rhomb</b><i> <code>x1 y1 z1 x2 y2 z2 r</code> ['col'='r']</i></dt>
<dd><p>Draw the rhombus with width <var>r</var> and edge points <var>p1</var>, <var>p2</var>. Parameter <var>col</var> may contain
</p><ul>
<li>
colors for filling and boundary (second one if style &lsquo;<samp>@</samp>&rsquo; is used, black color is used by default);
</li><li>
&lsquo;<samp>#</samp>&rsquo; for wire figure (boundary only);
</li><li>
&lsquo;<samp>@</samp>&rsquo; for filling and boundary.
</li></ul>
</dd></dl>


<hr size="6">
<a name="Text-printing"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Primitives" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Axis-and-Colorbar" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Text-printing-1"></a>
<h2 class="section">3.7 Text printing</h2>
<a name="index-Text"></a>
<a name="index-Label"></a>
<a name="index-fgets"></a>

<p>These functions draw the text. There are functions for drawing text in arbitrary place, in arbitrary direction and along arbitrary curve. MathGL can use arbitrary font-faces and parse many TeX commands (for more details see <a href="#Font-styles">Font styles</a>). All these functions have 2 variant: for printing 8-bit text (<code>char *</code>) and for printing Unicode text (<code>wchar_t *</code>). In first case the conversion into the current locale is used. So sometimes you need to specify it by <code>setlocale()</code> function. The <var>size</var> argument control the size of text: if positive it give the value, if negative it give the value relative to <code>SetFontSize()</code>. The font type (STIX, arial, courier, times and so on) can be selected by function LoadFont(). See section <a href="#Font-settings">Font settings</a>.
</p>
<p>The font parameters are described by string. This string may set the text color &lsquo;<samp>wkrgbcymhRGBCYMHW</samp>&rsquo; (see <a href="#Color-styles">Color styles</a>). Also,  after delimiter symbol &lsquo;<samp>:</samp>&rsquo;, it can contain characters of font type (&lsquo;<samp>rbiwou</samp>&rsquo;) and/or align (&lsquo;<samp>LRC</samp>&rsquo;) specification. The font types are: &lsquo;<samp>r</samp>&rsquo; &ndash; roman (or regular) font, &lsquo;<samp>i</samp>&rsquo; &ndash; italic style, &lsquo;<samp>b</samp>&rsquo; &ndash; bold style, &lsquo;<samp>w</samp>&rsquo; &ndash; wired style, &lsquo;<samp>o</samp>&rsquo; &ndash; over-lined text, &lsquo;<samp>u</samp>&rsquo; &ndash; underlined text. By default roman font is used. The align types are: &lsquo;<samp>L</samp>&rsquo; &ndash; align left (default), &lsquo;<samp>C</samp>&rsquo; &ndash; align center, &lsquo;<samp>R</samp>&rsquo; &ndash; align right. For example, string &lsquo;<samp>b:iC</samp>&rsquo; correspond to italic font style for centered text which printed by blue color.
</p>
<p>If string contains symbols &lsquo;<samp>aA</samp>&rsquo; then text is printed at absolute position {<var>x</var>, <var>y</var>} (supposed to be in range [0,1]) of picture (for &lsquo;<samp>A</samp>&rsquo;) or subplot/inplot (for &lsquo;<samp>a</samp>&rsquo;). If string contains symbol &lsquo;<samp>@</samp>&rsquo; then box around text is drawn.
</p>
<p>See section <a href="#Text-features">Text features</a>, for sample code and picture.
</p>
<p><a name="text"></a>
</p><dl>
<dt><a name="index-text"></a><u>MGL command:</u> <b>text</b><i> <code>x y</code> 'text' ['fnt'='' <code>size=-1</code>]</i></dt>
<dt><a name="index-text-1"></a><u>MGL command:</u> <b>text</b><i> <code>x y z</code> 'text' ['fnt'='' <code>size=-1</code>]</i></dt>
<dd><p>The function plots the string <var>text</var> at position <var>p</var> with fonts specifying by the criteria <var>fnt</var>. The size of font is set by <var>size</var> parameter (default is <code>-1</code>).
</p></dd></dl>

<dl>
<dt><a name="index-text-2"></a><u>MGL command:</u> <b>text</b><i> <code>x y dx dy</code> 'text' ['fnt'=':L' <code>size=-1</code>]</i></dt>
<dt><a name="index-text-3"></a><u>MGL command:</u> <b>text</b><i> <code>x y z dx dy dz</code> 'text' ['fnt'=':L' <code>size=-1</code>]</i></dt>
<dd><p>The function plots the string <var>text</var> at position <var>p</var> along direction <var>d</var> with specified <var>size</var>. Parameter <var>fnt</var> set text style and text position: above (&lsquo;<samp>T</samp>&rsquo;) or under (&lsquo;<samp>t</samp>&rsquo;) the line.
</p></dd></dl>

<p><a name="fgets"></a>
</p><dl>
<dt><a name="index-fgets-1"></a><u>MGL command:</u> <b>fgets</b><i> <code>x y</code> 'fname' [<code>n=0</code> 'fnt'='' <code>size=-1.4</code>]</i></dt>
<dt><a name="index-fgets-2"></a><u>MGL command:</u> <b>fgets</b><i> <code>x y z</code> 'fname' [<code>n=0</code> 'fnt'='' <code>size=-1.4</code>]</i></dt>
<dd><p>Draws unrotated <var>n</var>-th line of file <var>fname</var> at position {<var>x</var>,<var>y</var>,<var>z</var>} with specified <var>size</var>. By default parameters from <a href="#font">font</a> command are used.
</p></dd></dl>

<dl>
<dt><a name="index-text-4"></a><u>MGL command:</u> <b>text</b><i> ydat 'text' ['fnt'='']</i></dt>
<dt><a name="index-text-5"></a><u>MGL command:</u> <b>text</b><i> xdat ydat 'text' ['fnt'='']</i></dt>
<dt><a name="index-text-6"></a><u>MGL command:</u> <b>text</b><i> xdat ydat zdat 'text' ['fnt'='']</i></dt>
<dd><p>The function draws <var>text</var> along the curve between points {<var>x</var>[i], <var>y</var>[i], <var>z</var>[i]} by font style <var>fnt</var>. The string <var>fnt</var> may contain symbols &lsquo;<samp>t</samp>&rsquo; for printing the text under the curve (default), or &lsquo;<samp>T</samp>&rsquo; for printing the text above the curve. The sizes of 1st dimension must be equal for all arrays <code>x.nx=y.nx=z.nx</code>. If array <var>x</var> is not specified then its an automatic array is used with values equidistantly distributed in interval [<var>Min</var>.x, <var>Max</var>.x] (see <a href="#Ranges-_0028bounding-box_0029">Ranges (bounding box)</a>). If array <var>z</var> is not specified then <var>z</var>[i] = <var>Min</var>.z is used. String <var>opt</var> contain command options (see <a href="#Command-options">Command options</a>). 
</p></dd></dl>


<hr size="6">
<a name="Axis-and-Colorbar"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Text-printing" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Legend" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Axis-and-Colorbar-1"></a>
<h2 class="section">3.8 Axis and Colorbar</h2>
<a name="index-Axis-1"></a>
<a name="index-Box"></a>
<a name="index-Grid"></a>
<a name="index-Colorbar"></a>
<a name="index-Label-1"></a>

<p>These functions draw the &ldquo;things for measuring&rdquo;, like axis with ticks, colorbar with ticks, grid along axis, bounding box and labels for axis. For more information see <a href="#Axis-settings">Axis settings</a>.
</p>
<p><a name="axis"></a>
</p><dl>
<dt><a name="index-axis-2"></a><u>MGL command:</u> <b>axis</b><i> ['dir'='xyz' 'stl'='']</i></dt>
<dd><p>Draws axes with ticks (see <a href="#Axis-settings">Axis settings</a>). Parameter <var>dir</var> may contain:
</p><ul>
<li>
&lsquo;<samp>xyz</samp>&rsquo; for drawing axis in corresponding direction;
</li><li>
&lsquo;<samp>XYZ</samp>&rsquo; for drawing axis in corresponding direction but with inverted positions of labels;
</li><li>
&lsquo;<samp>_</samp>&rsquo; for disabling tick labels;
</li><li>
&lsquo;<samp>U</samp>&rsquo; for disabling rotation of tick labels;
</li><li>
&lsquo;<samp>AKDTVISO</samp>&rsquo; for drawing arrow at the end of axis;
</li><li>
&lsquo;<samp>a</samp>&rsquo; for forced adjusting of axis ticks.
</li></ul>
<p>Styles of ticks and axis can be overrided by using <var>stl</var> string. See section <a href="#Axis-and-ticks">Axis and ticks</a>, for sample code and picture.
</p></dd></dl>

<p><a name="colorbar"></a>
</p><dl>
<dt><a name="index-colorbar"></a><u>MGL command:</u> <b>colorbar</b><i> ['sch'='']</i></dt>
<dd><p>Draws colorbar. Parameter <var>sch</var> may contain:
</p><ul>
<li>
color scheme (see <a href="#Color-scheme">Color scheme</a>);
</li><li>
&lsquo;<samp>&lt;&gt;^_</samp>&rsquo; for positioning at left, at right, at top or at bottom correspondingly;
</li><li>
&lsquo;<samp>I</samp>&rsquo; for positioning near bounding (by default, is positioned at edges of subplot);
</li><li>
&lsquo;<samp>A</samp>&rsquo; for using absolute coordinates.
</li></ul>
<p>See section <a href="#Colorbars">Colorbars</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-colorbar-1"></a><u>MGL command:</u> <b>colorbar</b><i> vdat ['sch'='']</i></dt>
<dd><p>The same as previous but with sharp colors <var>sch</var> (current palette if <code>sch=&quot;&quot;</code>) for values <var>v</var>. See section <a href="#ContD-sample">ContD sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-colorbar-2"></a><u>MGL command:</u> <b>colorbar</b><i> 'sch' <code>x y [w=1 h=1]</code></i></dt>
<dd><p>The same as first one but at arbitrary position of subplot {<var>x</var>, <var>y</var>} (supposed to be in range [0,1]). Parameters <var>w</var>, <var>h</var> set the relative width and height of the colorbar.
</p></dd></dl>

<dl>
<dt><a name="index-colorbar-3"></a><u>MGL command:</u> <b>colorbar</b><i> vdat 'sch' <code>x y [w=1 h=1]</code></i></dt>
<dd><p>The same as previous but with sharp colors <var>sch</var> (current palette if <code>sch=&quot;&quot;</code>) for values <var>v</var>. See section <a href="#ContD-sample">ContD sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="grid"></a>
</p><dl>
<dt><a name="index-grid"></a><u>MGL command:</u> <b>grid</b><i> ['dir'='xyz' 'pen'='B']</i></dt>
<dd><p>Draws grid lines perpendicular to direction determined by string parameter <var>dir</var>. The step of grid lines is the same as tick step for <a href="#axis">axis</a>. The style of lines is determined by <var>pen</var> parameter (default value is dark blue solid line &lsquo;<samp>B-</samp>&rsquo;).
</p></dd></dl>

<p><a name="box"></a>
</p><dl>
<dt><a name="index-box"></a><u>MGL command:</u> <b>box</b><i> ['stl'='k' <code>ticks=on</code>]</i></dt>
<dd><p>Draws bounding box outside the plotting volume with color <var>col</var>. If <var>col</var> contain &lsquo;<samp>@</samp>&rsquo; then filled faces are drawn. At this first color is used for faces (default is light yellow), last one for edges. See section <a href="#Bounding-box">Bounding box</a>, for sample code and picture.
</p></dd></dl>

<p><a name="xlabel"></a>
<a name="ylabel"></a>
<a name="zlabel"></a>
<a name="tlabel"></a>
</p><dl>
<dt><a name="index-xlabel"></a><u>MGL command:</u> <b>xlabel</b><i> 'text' [<code>pos=1</code>]</i></dt>
<dt><a name="index-ylabel"></a><u>MGL command:</u> <b>ylabel</b><i> 'text' [<code>pos=1</code>]</i></dt>
<dt><a name="index-zlabel"></a><u>MGL command:</u> <b>zlabel</b><i> 'text' [<code>pos=1</code>]</i></dt>
<dt><a name="index-tlabel"></a><u>MGL command:</u> <b>tlabel</b><i> 'text' [<code>pos=1</code>]</i></dt>
<dd><p>Prints the label <var>text</var> for axis <var>dir</var>=&lsquo;<samp>x</samp>&rsquo;,&lsquo;<samp>y</samp>&rsquo;,&lsquo;<samp>z</samp>&rsquo;,&lsquo;<samp>t</samp>&rsquo; (here &lsquo;<samp>t</samp>&rsquo; is &ldquo;ternary&rdquo; axis <em>t=1-x-y</em>). The position of label is determined by <var>pos</var> parameter. If <var>pos</var>=0 then label is printed at the center of axis. If <var>pos</var>&gt;0 then label is printed at the maximum of axis. If <var>pos</var>&lt;0 then label is printed at the minimum of axis. Value option set additional shifting of the label. See section <a href="#Text-printing">Text printing</a>.
</p></dd></dl>


<hr size="6">
<a name="Legend"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Axis-and-Colorbar" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-plotting" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Legend-1"></a>
<h2 class="section">3.9 Legend</h2>
<a name="index-Legend"></a>
<a name="index-AddLegend"></a>
<a name="index-ClearLegend"></a>
<a name="index-SetLegendBox"></a>
<a name="index-SetLegendMarks"></a>

<p>These functions draw legend to the graph (useful for <a href="#g_t1D-plotting">1D plotting</a>). Legend entry is a pair of strings: one for style of the line, another one with description text (with included TeX parsing). The arrays of strings may be used directly or by accumulating first to the internal arrays (by function <a href="#addlegend">addlegend</a>) and further plotting it. The position of the legend can be selected automatic or manually (even out of bounding box). Parameters <var>fnt</var> and <var>size</var> specify the font style and size (see <a href="#Font-settings">Font settings</a>). Parameter <var>llen</var> set the relative width of the line sample and the text indent. If line style string for entry is empty then the corresponding text is printed without indent. Parameter <var>fnt</var> may contain:
</p><ul>
<li>
font style for legend text;
</li><li>
&lsquo;<samp>A</samp>&rsquo; for positioning in absolute coordinates;
</li><li>
&lsquo;<samp>#</samp>&rsquo; for drawing box around legend;
</li><li>
colors for background (first one) and border (second one) of legend. Note, that last color is always used as color for legend text.
</li></ul>
<p>See section <a href="#Legend-sample">Legend sample</a>, for sample code and picture.
</p>
<p><a name="legend"></a>
</p><dl>
<dt><a name="index-legend-2"></a><u>MGL command:</u> <b>legend</b><i> [<code>pos=3</code> 'fnt'='#']</i></dt>
<dd><p>Draws legend of accumulated legend entries by font <var>fnt</var> with <var>size</var>. Parameter <var>pos</var> sets the position of the legend: &lsquo;<samp>0</samp>&rsquo; is bottom left corner, &lsquo;<samp>1</samp>&rsquo; is bottom right corner, &lsquo;<samp>2</samp>&rsquo; is top left corner, &lsquo;<samp>3</samp>&rsquo; is top right corner (is default). Parameter <var>fnt</var> can contain colors for face (1st one), for border (2nd one) and for text (last one). If less than 3 colors are specified then the color for border is black (for 2 and less colors), and the color for face is white (for 1 or none colors). If string <var>fnt</var> contain &lsquo;<samp>#</samp>&rsquo; then border around the legend is drawn. If string <var>fnt</var> contain &lsquo;<samp>-</samp>&rsquo; then legend entries will arranged horizontally.
</p></dd></dl>

<dl>
<dt><a name="index-legend-3"></a><u>MGL command:</u> <b>legend</b><i> <code>x y</code> ['fnt'='#']</i></dt>
<dd><p>Draws legend of accumulated legend entries by font <var>fnt</var> with <var>size</var>. Position of legend is determined by parameter <var>x</var>, <var>y</var> which supposed to be normalized to interval [0,1].
</p></dd></dl>

<p><a name="addlegend"></a>
</p><dl>
<dt><a name="index-addlegend"></a><u>MGL command:</u> <b>addlegend</b><i> 'text' 'stl'</i></dt>
<dd><p>Adds string <var>text</var> to internal legend accumulator. The style of described line and mark is specified in string <var>style</var> (see <a href="#Line-styles">Line styles</a>).
</p></dd></dl>

<p><a name="clearlegend"></a>
</p><dl>
<dt><a name="index-clearlegend"></a><u>MGL command:</u> <b>clearlegend</b></dt>
<dd><p>Clears saved legend strings.
</p></dd></dl>

<p><a name="legendmarks"></a>
</p><dl>
<dt><a name="index-legendmarks"></a><u>MGL command:</u> <b>legendmarks</b><i> <code>val</code></i></dt>
<dd><p>Set the number of marks in the legend. By default 1 mark is used.
</p></dd></dl>


<hr size="6">
<a name="g_t1D-plotting"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Legend" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-plotting" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="g_t1D-plotting-1"></a>
<h2 class="section">3.10 1D plotting</h2>
<a name="index-Plot"></a>
<a name="index-Radar"></a>
<a name="index-Tens"></a>
<a name="index-Area"></a>
<a name="index-Region"></a>
<a name="index-Stem"></a>
<a name="index-Bars"></a>
<a name="index-Barh"></a>
<a name="index-Chart"></a>
<a name="index-Step"></a>
<a name="index-Torus"></a>
<a name="index-Tube"></a>
<a name="index-Mark"></a>
<a name="index-TextMark"></a>
<a name="index-Error"></a>
<a name="index-BoxPlot"></a>
<a name="index-Candle"></a>
<a name="index-Tape"></a>
<a name="index-Label-2"></a>
<a name="index-Cones"></a>

<p>These functions perform plotting of 1D data. 1D means that data depended from only 1 parameter like parametric curve {x[i],y[i],z[i]}, i=1...n. By default (if absent) values of <var>x</var>[i] are equidistantly distributed in axis range, and <var>z</var>[i]=<var>Min</var>.z. The plots are drawn for each row if one of the data is the matrix. By any case the sizes of 1st dimension <strong>must be equal</strong> for all arrays <code>x.nx=y.nx=z.nx</code>.
</p>
<p>String <var>pen</var> specifies the color and style of line and marks (see <a href="#Line-styles">Line styles</a>). By default (<code>pen=&quot;&quot;</code>) solid line with color from palette is used (see <a href="#Palette-and-colors">Palette and colors</a>). Symbol &lsquo;<samp>!</samp>&rsquo; set to use new color from palette for each point (not for each curve, as default). String <var>opt</var> contain command options (see <a href="#Command-options">Command options</a>). See section <a href="#g_t1D-samples">1D samples</a>, for sample code and picture.
</p>
<p><a name="plot"></a>
</p><dl>
<dt><a name="index-plot"></a><u>MGL command:</u> <b>plot</b><i> ydat ['stl'='']</i></dt>
<dt><a name="index-plot-1"></a><u>MGL command:</u> <b>plot</b><i> xdat ydat ['stl'='']</i></dt>
<dt><a name="index-plot-2"></a><u>MGL command:</u> <b>plot</b><i> xdat ydat zdat ['stl'='']</i></dt>
<dd><p>These functions draw continuous lines between points {<var>x</var>[i], <var>y</var>[i], <var>z</var>[i]}. See also <a href="#area">area</a>, <a href="#step">step</a>, <a href="#stem">stem</a>, <a href="#tube">tube</a>, <a href="#mark">mark</a>, <a href="#error">error</a>, <a href="#belt">belt</a>, <a href="#tens">tens</a>, <a href="#tape">tape</a>. See section <a href="#Plot-sample">Plot sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="radar"></a>
</p><dl>
<dt><a name="index-radar"></a><u>MGL command:</u> <b>radar</b><i> adat ['stl'='']</i></dt>
<dd><p>This functions draws radar chart which is continuous lines between points located on an radial lines (like plot in Polar coordinates). Parameter <var>value</var> in options <var>opt</var> set the additional shift of data (i.e. the data <var>a</var>+<var>value</var> is used instead of <var>a</var>). If <code>value&lt;0</code> then <code>r=max(0, -min(value)</code>. If <var>pen</var> containt &lsquo;<samp>#</samp>&rsquo; symbol then &quot;grid&quot; (radial lines and circle for <var>r</var>) is drawn. See also <a href="#plot">plot</a>. See section <a href="#Radar-sample">Radar sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="step"></a>
</p><dl>
<dt><a name="index-step"></a><u>MGL command:</u> <b>step</b><i> ydat ['stl'='']</i></dt>
<dt><a name="index-step-1"></a><u>MGL command:</u> <b>step</b><i> xdat ydat ['stl'='']</i></dt>
<dt><a name="index-step-2"></a><u>MGL command:</u> <b>step</b><i> xdat ydat zdat ['stl'='']</i></dt>
<dd><p>These functions draw continuous stairs for points to axis plane. See also <a href="#plot">plot</a>, <a href="#stem">stem</a>, <a href="#tile">tile</a>, <a href="#boxs">boxs</a>. See section <a href="#Step-sample">Step sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="tens"></a>
</p><dl>
<dt><a name="index-tens"></a><u>MGL command:</u> <b>tens</b><i> ydat cdat ['stl'='']</i></dt>
<dt><a name="index-tens-1"></a><u>MGL command:</u> <b>tens</b><i> xdat ydat cdat ['stl'='']</i></dt>
<dt><a name="index-tens-2"></a><u>MGL command:</u> <b>tens</b><i> xdat ydat zdat cdat ['stl'='']</i></dt>
<dd><p>These functions draw continuous lines between points {<var>x</var>[i], <var>y</var>[i], <var>z</var>[i]} with color defined by the special array <var>c</var>[i] (look like tension plot). String <var>pen</var> specifies the color scheme (see <a href="#Color-scheme">Color scheme</a>) and style and/or width of line (see <a href="#Line-styles">Line styles</a>). See also <a href="#plot">plot</a>, <a href="#mesh">mesh</a>, <a href="#fall">fall</a>. See section <a href="#Tens-sample">Tens sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="tape"></a>
</p><dl>
<dt><a name="index-tape"></a><u>MGL command:</u> <b>tape</b><i> ydat ['stl'='']</i></dt>
<dt><a name="index-tape-1"></a><u>MGL command:</u> <b>tape</b><i> xdat ydat ['stl'='']</i></dt>
<dt><a name="index-tape-2"></a><u>MGL command:</u> <b>tape</b><i> xdat ydat zdat ['stl'='']</i></dt>
<dd><p>These functions draw tapes of normals for curve between points {<var>x</var>[i], <var>y</var>[i], <var>z</var>[i]}. Initial tape(s) was selected in x-y plane (for &lsquo;<samp>x</samp>&rsquo; in <var>pen</var>) and/or y-z plane (for &lsquo;<samp>x</samp>&rsquo; in <var>pen</var>). The width of tape is proportional to <a href="#barwidth">barwidth</a>. See also <a href="#plot">plot</a>, <a href="#flow">flow</a>, <a href="#barwidth">barwidth</a>. See section <a href="#Tape-sample">Tape sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="area"></a>
</p><dl>
<dt><a name="index-area"></a><u>MGL command:</u> <b>area</b><i> ydat ['stl'='']</i></dt>
<dt><a name="index-area-1"></a><u>MGL command:</u> <b>area</b><i> xdat ydat ['stl'='']</i></dt>
<dt><a name="index-area-2"></a><u>MGL command:</u> <b>area</b><i> xdat ydat zdat ['stl'='']</i></dt>
<dd><p>These functions draw continuous lines between points and fills it to axis plane. Also you can use gradient filling if number of specified colors is equal to 2*number of curves. See also <a href="#plot">plot</a>, <a href="#bars">bars</a>, <a href="#stem">stem</a>, <a href="#region">region</a>. See section <a href="#Area-sample">Area sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="region"></a>
</p><dl>
<dt><a name="index-region"></a><u>MGL command:</u> <b>region</b><i> ydat1 ydat2 ['stl'='']</i></dt>
<dt><a name="index-region-1"></a><u>MGL command:</u> <b>region</b><i> xdat ydat1 ydat2 ['stl'='']</i></dt>
<dd><p>These functions fill area between 2 curves. Dimensions of arrays <var>y1</var> and <var>y2</var> must be equal. Also you can use gradient filling if number of specified colors is equal to 2*number of curves. If <var>pen</var> contain symbol &lsquo;<samp>i</samp>&rsquo; then only area with y1&lt;y&lt;y2 will be filled else the area with y2&lt;y&lt;y1 will be filled too. See also <a href="#area">area</a>, <a href="#bars">bars</a>, <a href="#stem">stem</a>. See section <a href="#Region-sample">Region sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="stem"></a>
</p><dl>
<dt><a name="index-stem"></a><u>MGL command:</u> <b>stem</b><i> ydat ['stl'='']</i></dt>
<dt><a name="index-stem-1"></a><u>MGL command:</u> <b>stem</b><i> xdat ydat ['stl'='']</i></dt>
<dt><a name="index-stem-2"></a><u>MGL command:</u> <b>stem</b><i> xdat ydat zdat ['stl'='']</i></dt>
<dd><p>These functions draw vertical lines from points to axis plane. See also <a href="#area">area</a>, <a href="#bars">bars</a>, <a href="#plot">plot</a>, <a href="#mark">mark</a>. See section <a href="#Stem-sample">Stem sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="bars"></a>
</p><dl>
<dt><a name="index-bars"></a><u>MGL command:</u> <b>bars</b><i> ydat ['stl'='']</i></dt>
<dt><a name="index-bars-1"></a><u>MGL command:</u> <b>bars</b><i> xdat ydat ['stl'='']</i></dt>
<dt><a name="index-bars-2"></a><u>MGL command:</u> <b>bars</b><i> xdat ydat zdat ['stl'='']</i></dt>
<dd><p>These functions draw vertical bars from points to axis plane. If string <var>pen</var> contain symbol &lsquo;<samp>a</samp>&rsquo; then lines are drawn one above another (like summation). If string contain symbol &lsquo;<samp>f</samp>&rsquo; then waterfall chart is drawn for determining the cumulative effect of sequentially introduced positive or negative values. You can give different colors for positive and negative values if number of specified colors is equal to 2*number of curves. See also <a href="#barh">barh</a>, <a href="#cones">cones</a>, <a href="#area">area</a>, <a href="#stem">stem</a>, <a href="#chart">chart</a>, <a href="#barwidth">barwidth</a>. See section <a href="#Bars-sample">Bars sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="barh"></a>
</p><dl>
<dt><a name="index-barh"></a><u>MGL command:</u> <b>barh</b><i> vdat ['stl'='']</i></dt>
<dt><a name="index-barh-1"></a><u>MGL command:</u> <b>barh</b><i> ydat vdat ['stl'='']</i></dt>
<dd><p>These functions draw horizontal bars from points to axis plane. If string contain symbol &lsquo;<samp>a</samp>&rsquo; then lines are drawn one above another (like summation). If string contain symbol &lsquo;<samp>f</samp>&rsquo; then waterfall chart is drawn for determining the cumulative effect of sequentially introduced positive or negative values. You can give different colors for positive and negative values if number of specified colors is equal to 2*number of curves. See also <a href="#bars">bars</a>, <a href="#barwidth">barwidth</a>. See section <a href="#Barh-sample">Barh sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="cones"></a>
</p><dl>
<dt><a name="index-cones"></a><u>MGL command:</u> <b>cones</b><i> ydat ['stl'='']</i></dt>
<dt><a name="index-cones-1"></a><u>MGL command:</u> <b>cones</b><i> xdat ydat ['stl'='']</i></dt>
<dt><a name="index-cones-2"></a><u>MGL command:</u> <b>cones</b><i> xdat ydat zdat ['stl'='']</i></dt>
<dd><p>These functions draw cones from points to axis plane. If string contain symbol &lsquo;<samp>a</samp>&rsquo; then cones are drawn one above another (like summation). You can give different colors for positive and negative values if number of specified colors is equal to 2*number of curves. See also <a href="#bars">bars</a>, <a href="#barwidth">barwidth</a>. See section <a href="#Cones-sample">Cones sample</a>, for sample code and picture.
</p></dd></dl>



<p><a name="chart"></a>
</p><dl>
<dt><a name="index-chart"></a><u>MGL command:</u> <b>chart</b><i> adat ['col'='']</i></dt>
<dd><p>The function draws colored stripes (boxes) for data in array <var>a</var>. The number of stripes is equal to the number of rows in <var>a</var> (equal to <var>a.ny</var>). The color of each next stripe is cyclically changed from colors specified in string <var>col</var> or in palette Pal (see <a href="#Palette-and-colors">Palette and colors</a>). Spaces in colors denote transparent &ldquo;color&rdquo; (i.e. corresponding stripe(s) are not drawn). The stripe width is proportional to value of element in <var>a</var>. Chart is plotted only for data with non-negative elements. If string <var>col</var> have symbol &lsquo;<samp>#</samp>&rsquo; then black border lines are drawn. The most nice form the chart have in 3d (after rotation of coordinates) or in cylindrical coordinates (becomes so called Pie chart). See section <a href="#Chart-sample">Chart sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="boxplot"></a>
</p><dl>
<dt><a name="index-boxplot"></a><u>MGL command:</u> <b>boxplot</b><i> adat ['stl'='']</i></dt>
<dt><a name="index-boxplot-1"></a><u>MGL command:</u> <b>boxplot</b><i> xdat adat ['stl'='']</i></dt>
<dd><p>These functions draw boxplot (also known as a box-and-whisker diagram) at points <var>x</var>[i]. This is five-number summaries of data <var>a</var>[i,j] (minimum, lower quartile (Q1), median (Q2), upper quartile (Q3) and maximum) along second (j-th) direction. See also <a href="#plot">plot</a>, <a href="#error">error</a>, <a href="#bars">bars</a>, <a href="#barwidth">barwidth</a>. See section <a href="#BoxPlot-sample">BoxPlot sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="candle"></a>
</p><dl>
<dt><a name="index-candle"></a><u>MGL command:</u> <b>candle</b><i> vdat1 ['stl'='']</i></dt>
<dt><a name="index-candle-1"></a><u>MGL command:</u> <b>candle</b><i> vdat1 vdat2 ['stl'='']</i></dt>
<dt><a name="index-candle-2"></a><u>MGL command:</u> <b>candle</b><i> vdat1 ydat1 ydat2 ['stl'='']</i></dt>
<dt><a name="index-candle-3"></a><u>MGL command:</u> <b>candle</b><i> vdat1 vdat2 ydat1 ydat2 ['stl'='']</i></dt>
<dt><a name="index-candle-4"></a><u>MGL command:</u> <b>candle</b><i> xdat vdat1 vdat2 ydat1 ydat2 ['stl'='']</i></dt>
<dd><p>These functions draw candlestick chart at points <var>x</var>[i]. This is a combination of a line-chart and a bar-chart, in that each bar represents the range of price movement over a given time interval. Wire (or white) candle correspond to price growth <var>v1</var>[i]&lt;<var>v2</var>[i], opposite case &ndash; solid (or dark) candle. &quot;Shadows&quot; show the minimal <var>y1</var> and maximal <var>y2</var> prices. If <var>v2</var> is absent then it is determined as <var>v2</var>[i]=<var>v1</var>[i+1]. See also <a href="#plot">plot</a>, <a href="#bars">bars</a>, <a href="#barwidth">barwidth</a>. See section <a href="#Candle-sample">Candle sample</a>, for sample code and picture.
</p></dd></dl>


<p><a name="error"></a>
</p><dl>
<dt><a name="index-error"></a><u>MGL command:</u> <b>error</b><i> ydat yerr ['stl'='']</i></dt>
<dt><a name="index-error-1"></a><u>MGL command:</u> <b>error</b><i> xdat ydat yerr ['stl'='']</i></dt>
<dt><a name="index-error-2"></a><u>MGL command:</u> <b>error</b><i> xdat ydat xerr yerr ['stl'='']</i></dt>
<dd><p>These functions draw error boxes {<var>ex</var>[i], <var>ey</var>[i]} at points {<var>x</var>[i], <var>y</var>[i]}. This can be useful, for example, in experimental points, or to show numeric error or some estimations and so on. If string <var>pen</var> contain symbol &lsquo;<samp>@</samp>&rsquo; than large semitransparent mark is used instead of error box. See also <a href="#plot">plot</a>, <a href="#mark">mark</a>. See section <a href="#Error-sample">Error sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="mark"></a>
</p><dl>
<dt><a name="index-mark"></a><u>MGL command:</u> <b>mark</b><i> ydat rdat ['stl'='']</i></dt>
<dt><a name="index-mark-1"></a><u>MGL command:</u> <b>mark</b><i> xdat ydat rdat ['stl'='']</i></dt>
<dt><a name="index-mark-2"></a><u>MGL command:</u> <b>mark</b><i> xdat ydat zdat rdat ['stl'='']</i></dt>
<dd><p>These functions draw marks with size <var>r</var>[i]*<a href="#marksize">marksize</a> at points {<var>x</var>[i], <var>y</var>[i], <var>z</var>[i]}. If you need to draw markers of the same size then you can use <a href="#plot">plot</a> function with empty line style &lsquo;<samp> </samp>&rsquo;. For markers with size in axis range use <a href="#error">error</a> with style &lsquo;<samp>@</samp>&rsquo;. See also <a href="#plot">plot</a>, <a href="#textmark">textmark</a>, <a href="#error">error</a>, <a href="#stem">stem</a>. See section <a href="#Mark-sample">Mark sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="textmark"></a>
</p><dl>
<dt><a name="index-textmark"></a><u>MGL command:</u> <b>textmark</b><i> ydat 'txt' ['stl'='']</i></dt>
<dt><a name="index-textmark-1"></a><u>MGL command:</u> <b>textmark</b><i> ydat rdat 'txt' ['stl'='']</i></dt>
<dt><a name="index-textmark-2"></a><u>MGL command:</u> <b>textmark</b><i> xdat ydat rdat 'txt' ['stl'='']</i></dt>
<dt><a name="index-textmark-3"></a><u>MGL command:</u> <b>textmark</b><i> xdat ydat zdat rdat 'txt' ['stl'='']</i></dt>
<dd><p>These functions draw string <var>txt</var> as marks with size proportional to <var>r</var>[i]*<var>marksize</var> at points {<var>x</var>[i], <var>y</var>[i], <var>z</var>[i]}. By default (if omitted) <var>r</var>[i]=1. See also <a href="#plot">plot</a>, <a href="#mark">mark</a>, <a href="#stem">stem</a>. See section <a href="#TextMark-sample">TextMark sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="label"></a>
</p><dl>
<dt><a name="index-label"></a><u>MGL command:</u> <b>label</b><i> ydat 'txt' ['stl'='']</i></dt>
<dt><a name="index-label-1"></a><u>MGL command:</u> <b>label</b><i> xdat ydat 'txt' ['stl'='']</i></dt>
<dt><a name="index-label-2"></a><u>MGL command:</u> <b>label</b><i> xdat ydat zdat 'txt' ['stl'='']</i></dt>
<dd><p>These functions draw string <var>txt</var> at points {<var>x</var>[i], <var>y</var>[i], <var>z</var>[i]}. If string <var>txt</var> contain &lsquo;<samp>%x</samp>&rsquo;, &lsquo;<samp>%y</samp>&rsquo;, &lsquo;<samp>%z</samp>&rsquo; or &lsquo;<samp>%n</samp>&rsquo; then it will be replaced by the value of x-,y-,z-coordinate of the point or its index. See also <a href="#plot">plot</a>, <a href="#mark">mark</a>, <a href="#textmark">textmark</a>, <a href="#table">table</a>. See section <a href="#Label-sample">Label sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="table"></a>
</p><dl>
<dt><a name="index-table"></a><u>MGL command:</u> <b>table</b><i> vdat 'txt' ['stl'='#']</i></dt>
<dt><a name="index-table-1"></a><u>MGL command:</u> <b>table</b><i> x y vdat 'txt' ['stl'='#']</i></dt>
<dd><p>These functions draw table with values of <var>val</var> and captions from string <var>txt</var> (separated by newline symbol &lsquo;<samp>\n</samp>&rsquo;) at points {<var>x</var>, <var>y</var>} (default at {0,0}) related to current subplot. If string <var>fnt</var> contain &lsquo;<samp>#</samp>&rsquo; then cell border will be drawn. If string <var>fnt</var> contain &lsquo;<samp>|</samp>&rsquo; then table width is limited by subplot width (equivalent option &lsquo;<samp>value 1</samp>&rsquo;). If string <var>fnt</var> contain &lsquo;<samp>=</samp>&rsquo; then widths of all cells are the same. Option <code>value</code> set the width of the table (default is 1). See also <a href="#plot">plot</a>, <a href="#label">label</a>. See section <a href="#Table-sample">Table sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="tube"></a>
</p><dl>
<dt><a name="index-tube"></a><u>MGL command:</u> <b>tube</b><i> ydat rdat ['stl'='']</i></dt>
<dt><a name="index-tube-1"></a><u>MGL command:</u> <b>tube</b><i> ydat <code>rval</code> ['stl'='']</i></dt>
<dt><a name="index-tube-2"></a><u>MGL command:</u> <b>tube</b><i> xdat ydat rdat ['stl'='']</i></dt>
<dt><a name="index-tube-3"></a><u>MGL command:</u> <b>tube</b><i> xdat ydat <code>rval</code> ['stl'='']</i></dt>
<dt><a name="index-tube-4"></a><u>MGL command:</u> <b>tube</b><i> xdat ydat zdat rdat ['stl'='']</i></dt>
<dt><a name="index-tube-5"></a><u>MGL command:</u> <b>tube</b><i> xdat ydat zdat <code>rval</code> ['stl'='']</i></dt>
<dd><p>These functions draw the tube with variable radius <var>r</var>[i] along the curve between points {<var>x</var>[i], <var>y</var>[i], <var>z</var>[i]}. See also <a href="#plot">plot</a>. See section <a href="#Tube-sample">Tube sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="torus"></a>
</p><dl>
<dt><a name="index-torus"></a><u>MGL command:</u> <b>torus</b><i> rdat zdat ['stl'='']</i></dt>
<dd><p>These functions draw surface which is result of curve {<var>r</var>, <var>z</var>} rotation around axis. If string <var>pen</var> contain symbols &lsquo;<samp>x</samp>&rsquo; or &lsquo;<samp>z</samp>&rsquo; then rotation axis will be set to specified direction (default is &lsquo;<samp>y</samp>&rsquo;). If string <var>pen</var> have symbol &lsquo;<samp>#</samp>&rsquo; then wire plot is produced. If string <var>pen</var> have symbol &lsquo;<samp>.</samp>&rsquo; then plot by dots is produced. See also <a href="#plot">plot</a>, <a href="#axial">axial</a>. See section <a href="#Torus-sample">Torus sample</a>, for sample code and picture.
</p></dd></dl>


<hr size="6">
<a name="g_t2D-plotting"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#g_t1D-plotting" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-plotting" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="g_t2D-plotting-1"></a>
<h2 class="section">3.11 2D plotting</h2>
<a name="index-Mesh"></a>
<a name="index-Fall"></a>
<a name="index-Belt"></a>
<a name="index-Surf"></a>
<a name="index-Boxs"></a>
<a name="index-Tile"></a>
<a name="index-Dens"></a>
<a name="index-Cont"></a>
<a name="index-ContF"></a>
<a name="index-ContD"></a>
<a name="index-Axial"></a>
<a name="index-Grad"></a>
<a name="index-Grid-1"></a>

<p>These functions perform plotting of 2D data. 2D means that data depend from 2 independent parameters like matrix <em>f(x_i,y_j), i=1...n, j=1...m</em>.  By default (if absent) values of <var>x</var>, <var>y</var> are equidistantly distributed in axis range. The plots are drawn for each z slice of the data. The minor dimensions of arrays <var>x</var>, <var>y</var>, <var>z</var> should be equal <code>x.nx=z.nx &amp;&amp; y.nx=z.ny</code> or <code>x.nx=y.nx=z.nx &amp;&amp; x.ny=y.ny=z.ny</code>. Arrays <var>x</var> and <var>y</var> can be vectors (not matrices as <var>z</var>). String <var>sch</var> sets the color scheme (see <a href="#Color-scheme">Color scheme</a>) for plot. String <var>opt</var> contain command options (see <a href="#Command-options">Command options</a>). See section <a href="#g_t2D-samples">2D samples</a>, for sample code and picture.
</p>
<p><a name="surf"></a>
</p><dl>
<dt><a name="index-surf"></a><u>MGL command:</u> <b>surf</b><i> zdat ['sch'='']</i></dt>
<dt><a name="index-surf-1"></a><u>MGL command:</u> <b>surf</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]}. If string <var>sch</var> have symbol &lsquo;<samp>#</samp>&rsquo; then grid lines are drawn. If string <var>sch</var> have symbol &lsquo;<samp>.</samp>&rsquo; then plot by dots is produced. See also <a href="#mesh">mesh</a>, <a href="#dens">dens</a>, <a href="#belt">belt</a>, <a href="#tile">tile</a>, <a href="#boxs">boxs</a>, <a href="#surfc">surfc</a>, <a href="#surfa">surfa</a>. See section <a href="#Surf-sample">Surf sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="mesh"></a>
</p><dl>
<dt><a name="index-mesh"></a><u>MGL command:</u> <b>mesh</b><i> zdat ['sch'='']</i></dt>
<dt><a name="index-mesh-1"></a><u>MGL command:</u> <b>mesh</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws mesh lines for surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]}. See also <a href="#surf">surf</a>, <a href="#fall">fall</a>, <a href="#meshnum">meshnum</a>, <a href="#cont">cont</a>, <a href="#tens">tens</a>. See section <a href="#Mesh-sample">Mesh sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="fall"></a>
</p><dl>
<dt><a name="index-fall"></a><u>MGL command:</u> <b>fall</b><i> zdat ['sch'='']</i></dt>
<dt><a name="index-fall-1"></a><u>MGL command:</u> <b>fall</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws fall lines for surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]}. This plot can be used for plotting several curves shifted in depth one from another. If <var>sch</var> contain &lsquo;<samp>x</samp>&rsquo; then lines are drawn along x-direction else (by default) lines are drawn along y-direction. See also <a href="#belt">belt</a>, <a href="#mesh">mesh</a>, <a href="#tens">tens</a>, <a href="#meshnum">meshnum</a>. See section <a href="#Fall-sample">Fall sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="belt"></a>
</p><dl>
<dt><a name="index-belt"></a><u>MGL command:</u> <b>belt</b><i> zdat ['sch'='']</i></dt>
<dt><a name="index-belt-1"></a><u>MGL command:</u> <b>belt</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws belts for surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]}. This plot can be used as 3d generalization of <a href="#plot">plot</a>). If <var>sch</var> contain &lsquo;<samp>x</samp>&rsquo; then belts are drawn along x-direction else (by default) belts are drawn along y-direction. See also <a href="#fall">fall</a>, <a href="#surf">surf</a>, <a href="#plot">plot</a>, <a href="#meshnum">meshnum</a>. See section <a href="#Belt-sample">Belt sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="boxs"></a>
</p><dl>
<dt><a name="index-boxs"></a><u>MGL command:</u> <b>boxs</b><i> zdat ['sch'='']</i></dt>
<dt><a name="index-boxs-1"></a><u>MGL command:</u> <b>boxs</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws vertical boxes for surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]}. Symbol &lsquo;<samp>@</samp>&rsquo; in <var>sch</var> set to draw filled boxes. See also <a href="#surf">surf</a>, <a href="#dens">dens</a>, <a href="#tile">tile</a>, <a href="#step">step</a>. See section <a href="#Boxs-sample">Boxs sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="tile"></a>
</p><dl>
<dt><a name="index-tile"></a><u>MGL command:</u> <b>tile</b><i> zdat ['sch'='']</i></dt>
<dt><a name="index-tile-1"></a><u>MGL command:</u> <b>tile</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws horizontal tiles for surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]}. Such plot can be used as 3d generalization of <a href="#step">step</a>. See also <a href="#surf">surf</a>, <a href="#boxs">boxs</a>, <a href="#step">step</a>, <a href="#tiles">tiles</a>. See section <a href="#Tile-sample">Tile sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="dens"></a>
</p><dl>
<dt><a name="index-dens"></a><u>MGL command:</u> <b>dens</b><i> zdat ['sch'='']</i></dt>
<dt><a name="index-dens-1"></a><u>MGL command:</u> <b>dens</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws density plot for surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]} at <var>z</var> = <var>Min</var>.z. If string <var>sch</var> have symbol &lsquo;<samp>#</samp>&rsquo; then grid lines are drawn. If string <var>sch</var> have symbol &lsquo;<samp>.</samp>&rsquo; then plot by dots is produced. See also <a href="#surf">surf</a>, <a href="#cont">cont</a>, <a href="#contf">contf</a>, <a href="#boxs">boxs</a>, <a href="#tile">tile</a>, <code>dens[xyz]</code>. See section <a href="#Dens-sample">Dens sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="cont"></a>
</p><dl>
<dt><a name="index-cont"></a><u>MGL command:</u> <b>cont</b><i> vdat zdat ['sch'='']</i></dt>
<dt><a name="index-cont-1"></a><u>MGL command:</u> <b>cont</b><i> vdat xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws contour lines for surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]} at <var>z</var>=<var>v</var>[k] or at <var>z</var> = <var>Min</var>.z if <var>sch</var> contain symbol &lsquo;<samp>_</samp>&rsquo;. Contours are plotted for <var>z</var>[i,j]=<var>v</var>[k] where <var>v</var>[k] are values of data array <var>v</var>. If string <var>sch</var> have symbol &lsquo;<samp>t</samp>&rsquo; or &lsquo;<samp>T</samp>&rsquo; then contour labels <var>v</var>[k] will be drawn below (or above) the contours. See also <a href="#dens">dens</a>, <a href="#contf">contf</a>, <a href="#contd">contd</a>, <a href="#axial">axial</a>, <code>cont[xyz]</code>. See section <a href="#Cont-sample">Cont sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-cont-2"></a><u>MGL command:</u> <b>cont</b><i> zdat ['sch'='']</i></dt>
<dt><a name="index-cont-3"></a><u>MGL command:</u> <b>cont</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The same as previous with vector <var>v</var> of <var>num</var>-th elements equidistantly distributed in color range. Here <var>num</var> is equal to parameter <var>value</var> in options <var>opt</var> (default is 7).
</p></dd></dl>

<p><a name="contf"></a>
</p><dl>
<dt><a name="index-contf"></a><u>MGL command:</u> <b>contf</b><i> vdat zdat ['sch'='']</i></dt>
<dt><a name="index-contf-1"></a><u>MGL command:</u> <b>contf</b><i> vdat xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws solid (or filled) contour lines for surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]} at <var>z</var>=<var>v</var>[k] or at <var>z</var> = <var>Min</var>.z if <var>sch</var> contain symbol &lsquo;<samp>_</samp>&rsquo;. Contours are plotted for <var>z</var>[i,j]=<var>v</var>[k] where <var>v</var>[k] are values of data array <var>v</var> (must be <code>v.nx&gt;2</code>). See also <a href="#dens">dens</a>, <a href="#cont">cont</a>, <a href="#contd">contd</a>, <code>contf[xyz]</code>. See section <a href="#ContF-sample">ContF sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-contf-2"></a><u>MGL command:</u> <b>contf</b><i> zdat ['sch'='']</i></dt>
<dt><a name="index-contf-3"></a><u>MGL command:</u> <b>contf</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The same as previous with vector <var>v</var> of <var>num</var>-th elements equidistantly distributed in color range. Here <var>num</var> is equal to parameter <var>value</var> in options <var>opt</var> (default is 7).
</p></dd></dl>

<p><a name="contd"></a>
</p><dl>
<dt><a name="index-contd"></a><u>MGL command:</u> <b>contd</b><i> vdat zdat ['sch'='']</i></dt>
<dt><a name="index-contd-1"></a><u>MGL command:</u> <b>contd</b><i> vdat xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws solid (or filled) contour lines for surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]} at <var>z</var>=<var>v</var>[k] (or at <var>z</var> = <var>Min</var>.z if <var>sch</var> contain symbol &lsquo;<samp>_</samp>&rsquo;) with manual colors. Contours are plotted for <var>z</var>[i,j]=<var>v</var>[k] where <var>v</var>[k] are values of data array <var>v</var> (must be <code>v.nx&gt;2</code>). String <var>sch</var> sets the contour colors: the color of k-th contour is determined by character <code>sch[k%strlen(sch)]</code>. See also <a href="#dens">dens</a>, <a href="#cont">cont</a>, <a href="#contf">contf</a>. See section <a href="#ContD-sample">ContD sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-contd-2"></a><u>MGL command:</u> <b>contd</b><i> zdat ['sch'='']</i></dt>
<dt><a name="index-contd-3"></a><u>MGL command:</u> <b>contd</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The same as previous with vector <var>v</var> of <var>num</var>-th elements equidistantly distributed in color range. Here <var>num</var> is equal to parameter <var>value</var> in options <var>opt</var> (default is 7).
</p></dd></dl>

<p><a name="contv"></a>
</p><dl>
<dt><a name="index-contv"></a><u>MGL command:</u> <b>contv</b><i> vdat zdat ['sch'='']</i></dt>
<dt><a name="index-contv-1"></a><u>MGL command:</u> <b>contv</b><i> vdat xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws vertical cylinder (tube) at contour lines for surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]} at <var>z</var>=<var>v</var>[k] or at <var>z</var> = <var>Min</var>.z if <var>sch</var> contain symbol &lsquo;<samp>_</samp>&rsquo;. Contours are plotted for <var>z</var>[i,j]=<var>v</var>[k] where <var>v</var>[k] are values of data array <var>v</var>. See also <a href="#cont">cont</a>, <a href="#contf">contf</a>. See section <a href="#ContV-sample">ContV sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-contv-2"></a><u>MGL command:</u> <b>contv</b><i> zdat ['sch'='']</i></dt>
<dt><a name="index-contv-3"></a><u>MGL command:</u> <b>contv</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The same as previous with vector <var>v</var> of <var>num</var>-th elements equidistantly distributed in color range. Here <var>num</var> is equal to parameter <var>value</var> in options <var>opt</var> (default is 7).
</p></dd></dl>

<p><a name="axial"></a>
</p><dl>
<dt><a name="index-axial"></a><u>MGL command:</u> <b>axial</b><i> vdat zdat ['sch'='']</i></dt>
<dt><a name="index-axial-1"></a><u>MGL command:</u> <b>axial</b><i> vdat xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws surface which is result of contour plot rotation for surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]}. Contours are plotted for <var>z</var>[i,j]=<var>v</var>[k] where <var>v</var>[k] are values of data array <var>v</var>. If string <var>sch</var> have symbol &lsquo;<samp>#</samp>&rsquo; then wire plot is produced. If string <var>sch</var> have symbol &lsquo;<samp>.</samp>&rsquo; then plot by dots is produced. If string contain symbols &lsquo;<samp>x</samp>&rsquo; or &lsquo;<samp>z</samp>&rsquo; then rotation axis will be set to specified direction (default is &lsquo;<samp>y</samp>&rsquo;). See also <a href="#cont">cont</a>, <a href="#contf">contf</a>, <a href="#torus">torus</a>, <a href="#surf3">surf3</a>. See section <a href="#Axial-sample">Axial sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-axial-2"></a><u>MGL command:</u> <b>axial</b><i> zdat ['sch'='']</i></dt>
<dt><a name="index-axial-3"></a><u>MGL command:</u> <b>axial</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The same as previous with vector <var>v</var> of <var>num</var>-th elements equidistantly distributed in color range. Here <var>num</var> is equal to parameter <var>value</var> in options <var>opt</var> (default is 3).
</p></dd></dl>

<p><a name="grid2"></a>
</p><dl>
<dt><a name="index-grid2"></a><u>MGL command:</u> <b>grid2</b><i> zdat ['sch'='']</i></dt>
<dt><a name="index-grid2-1"></a><u>MGL command:</u> <b>grid2</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws grid lines for density plot of surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]} at <var>z</var> = <var>Min</var>.z. See also <a href="#dens">dens</a>, <a href="#cont">cont</a>, <a href="#contf">contf</a>, <a href="#meshnum">meshnum</a>.
</p></dd></dl>



<hr size="6">
<a name="g_t3D-plotting"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#g_t2D-plotting" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Dual-plotting" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="g_t3D-plotting-1"></a>
<h2 class="section">3.12 3D plotting</h2>
<a name="index-Surf3"></a>
<a name="index-Dens3"></a>
<a name="index-Cont3"></a>
<a name="index-ContF3"></a>
<a name="index-Grid3"></a>
<a name="index-Cloud"></a>
<a name="index-Beam"></a>

<p>These functions perform plotting of 3D data. 3D means that data depend from 3 independent parameters like matrix <em>f(x_i,y_j,z_k), i=1...n, j=1...m, k=1...l</em>. By default (if absent) values of <var>x</var>, <var>y</var>, <var>z</var> are equidistantly distributed in axis range. The minor dimensions of arrays <var>x</var>, <var>y</var>, <var>z</var>, <var>a</var> should be equal <code>x.nx=a.nx &amp;&amp; y.nx=a.ny &amp;&amp; z.nz=a.nz</code> or <code>x.nx=y.nx=z.nx=a.nx &amp;&amp; x.ny=y.ny=z.ny=a.ny &amp;&amp; x.nz=y.nz=z.nz=a.nz</code>. Arrays <var>x</var>, <var>y</var> and <var>z</var> can be vectors (not matrices as <var>a</var>). String <var>sch</var> sets the color scheme (see <a href="#Color-scheme">Color scheme</a>) for plot. String <var>opt</var> contain command options (see <a href="#Command-options">Command options</a>). See section <a href="#g_t3D-samples">3D samples</a>, for sample code and picture.
</p>
<p><a name="surf3"></a>
</p><dl>
<dt><a name="index-surf3"></a><u>MGL command:</u> <b>surf3</b><i> adat <code>val</code> ['sch'='']</i></dt>
<dt><a name="index-surf3-1"></a><u>MGL command:</u> <b>surf3</b><i> xdat ydat zdat adat <code>val</code> ['sch'='']</i></dt>
<dd><p>The function draws isosurface plot for 3d array specified parametrically <var>a</var>[i,j,k](<var>x</var>[i,j,k], <var>y</var>[i,j,k], <var>z</var>[i,j,k]) at <var>a</var>(x,y,z)=<var>val</var>. If string contain &lsquo;<samp>#</samp>&rsquo; then wire plot is produced. If string <var>sch</var> have symbol &lsquo;<samp>.</samp>&rsquo; then plot by dots is produced. Note, that there is possibility of incorrect plotting due to uncertainty of cross-section defining if there are two or more isosurface intersections inside one cell. See also <a href="#cloud">cloud</a>, <a href="#dens3">dens3</a>, <a href="#surf3c">surf3c</a>, <a href="#surf3a">surf3a</a>, <a href="#axial">axial</a>. See section <a href="#Surf3-sample">Surf3 sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-surf3-2"></a><u>MGL command:</u> <b>surf3</b><i> adat ['sch'='']</i></dt>
<dt><a name="index-surf3-3"></a><u>MGL command:</u> <b>surf3</b><i> xdat ydat zdat adat ['sch'='']</i></dt>
<dd><p>Draws <var>num</var>-th uniformly distributed in color range isosurfaces for 3d data. Here <var>num</var> is equal to parameter <var>value</var> in options <var>opt</var> (default is 3).
</p></dd></dl>

<p><a name="cloud"></a>
</p><dl>
<dt><a name="index-cloud"></a><u>MGL command:</u> <b>cloud</b><i> adat ['sch'='']</i></dt>
<dt><a name="index-cloud-1"></a><u>MGL command:</u> <b>cloud</b><i> xdat ydat zdat adat ['sch'='']</i></dt>
<dd><p>The function draws cloud plot for 3d data specified parametrically <var>a</var>[i,j,k](<var>x</var>[i,j,k], <var>y</var>[i,j,k], <var>z</var>[i,j,k]). This plot is a set of cubes with color and transparency proportional to value of <var>a</var>. The resulting plot is like cloud &ndash; low value is transparent but higher ones are not. The number of plotting cells depend on <a href="#meshnum">meshnum</a>. If string <var>sch</var> contain symbol &lsquo;<samp>.</samp>&rsquo; then lower quality plot will produced with much low memory usage. If string <var>sch</var> contain symbol &lsquo;<samp>i</samp>&rsquo; then transparency will be inversed, i.e. higher become transparent and lower become not transparent. See also <a href="#surf3">surf3</a>, <a href="#meshnum">meshnum</a>. See section <a href="#Cloud-sample">Cloud sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="dens3"></a>
</p><dl>
<dt><a name="index-dens3"></a><u>MGL command:</u> <b>dens3</b><i> adat ['sch'='' <code>sval=-1</code>]</i></dt>
<dt><a name="index-dens3-1"></a><u>MGL command:</u> <b>dens3</b><i> xdat ydat zdat adat ['sch'='' <code>sval=-1</code>]</i></dt>
<dd><p>The function draws density plot for 3d data specified parametrically <var>a</var>[i,j,k](<var>x</var>[i,j,k], <var>y</var>[i,j,k], <var>z</var>[i,j,k]). Density is plotted at slice <var>sVal</var> in direction {&lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo;} if <var>sch</var> contain corresponding symbol (by default, &lsquo;<samp>y</samp>&rsquo; direction is used). If string <var>stl</var> have symbol &lsquo;<samp>#</samp>&rsquo; then grid lines are drawn. See also <a href="#cont3">cont3</a>, <a href="#contf3">contf3</a>, <a href="#dens">dens</a>, <a href="#grid3">grid3</a>. See section <a href="#Dens3-sample">Dens3 sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="cont3"></a>
</p><dl>
<dt><a name="index-cont3"></a><u>MGL command:</u> <b>cont3</b><i> vdat adat ['sch'='' <code>sval=-1</code>]</i></dt>
<dt><a name="index-cont3-1"></a><u>MGL command:</u> <b>cont3</b><i> vdat xdat ydat zdat adat ['sch'='' <code>sval=-1</code>]</i></dt>
<dd><p>The function draws contour plot for 3d data specified parametrically <var>a</var>[i,j,k](<var>x</var>[i,j,k], <var>y</var>[i,j,k], <var>z</var>[i,j,k]). Contours are plotted for values specified in array <var>v</var> at slice <var>sVal</var> in direction {&lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo;} if <var>sch</var> contain corresponding symbol (by default, &lsquo;<samp>y</samp>&rsquo; direction is used). If string <var>sch</var> have symbol &lsquo;<samp>#</samp>&rsquo; then grid lines are drawn. If string <var>sch</var> have symbol &lsquo;<samp>t</samp>&rsquo; or &lsquo;<samp>T</samp>&rsquo; then contour labels will be drawn below (or above) the contours. See also <a href="#dens3">dens3</a>, <a href="#contf3">contf3</a>, <a href="#cont">cont</a>, <a href="#grid3">grid3</a>. See section <a href="#Cont3-sample">Cont3 sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-cont3-2"></a><u>MGL command:</u> <b>cont3</b><i> adat ['sch'='' <code>sval=-1</code>]</i></dt>
<dt><a name="index-cont3-3"></a><u>MGL command:</u> <b>cont3</b><i> xdat ydat zdat adat ['sch'='' <code>sval=-1</code>]</i></dt>
<dd><p>The same as previous with vector <var>v</var> of <var>num</var>-th elements equidistantly distributed in color range. Here <var>num</var> is equal to parameter <var>value</var> in options <var>opt</var> (default is 7).
</p></dd></dl>

<p><a name="contf3"></a>
</p><dl>
<dt><a name="index-contf3"></a><u>MGL command:</u> <b>contf3</b><i> vdat adat ['sch'='' <code>sval=-1</code>]</i></dt>
<dt><a name="index-contf3-1"></a><u>MGL command:</u> <b>contf3</b><i> vdat xdat ydat zdat adat ['sch'='' <code>sval=-1</code>]</i></dt>
<dd><p>The function draws solid (or filled) contour plot for 3d data specified parametrically <var>a</var>[i,j,k](<var>x</var>[i,j,k], <var>y</var>[i,j,k], <var>z</var>[i,j,k]). Contours are plotted for values specified in array <var>v</var> at slice <var>sVal</var> in direction {&lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo;} if <var>sch</var> contain corresponding symbol (by default, &lsquo;<samp>y</samp>&rsquo; direction is used). If string <var>sch</var> have symbol &lsquo;<samp>#</samp>&rsquo; then grid lines are drawn. See also <a href="#dens3">dens3</a>, <a href="#cont3">cont3</a>, <a href="#contf">contf</a>, <a href="#grid3">grid3</a>. See section <a href="#ContF3-sample">ContF3 sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-contf3-2"></a><u>MGL command:</u> <b>contf3</b><i> adat ['sch'='' <code>sval=-1</code>]</i></dt>
<dt><a name="index-contf3-3"></a><u>MGL command:</u> <b>contf3</b><i> xdat ydat zdat adat ['sch'='' <code>sval=-1</code>]</i></dt>
<dd><p>The same as previous with vector <var>v</var> of <var>num</var>-th elements equidistantly distributed in color range. Here <var>num</var> is equal to parameter <var>value</var> in options <var>opt</var> (default is 7).
</p></dd></dl>

<p><a name="grid3"></a>
</p><dl>
<dt><a name="index-grid3"></a><u>MGL command:</u> <b>grid3</b><i> adat ['sch'='' <code>sval=-1</code>]</i></dt>
<dt><a name="index-grid3-1"></a><u>MGL command:</u> <b>grid3</b><i> xdat ydat zdat adat ['sch'='' <code>sval=-1</code>]</i></dt>
<dd><p>The function draws grid for 3d data specified parametrically <var>a</var>[i,j,k](<var>x</var>[i,j,k], <var>y</var>[i,j,k], <var>z</var>[i,j,k]). Grid is plotted at slice <var>sVal</var> in direction {&lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo;} if <var>sch</var> contain corresponding symbol (by default, &lsquo;<samp>y</samp>&rsquo; direction is used). See also <a href="#cont3">cont3</a>, <a href="#contf3">contf3</a>, <a href="#dens3">dens3</a>, <a href="#grid2">grid2</a>, <a href="#meshnum">meshnum</a>.
</p></dd></dl>

<p><a name="beam"></a>
</p><dl>
<dt><a name="index-beam"></a><u>MGL command:</u> <b>beam</b><i> tr g1 g2 adat <code>rval</code> ['sch'='' <code>flag=0 num=3</code>]</i></dt>
<dd><p>Draws the isosurface for 3d array <var>a</var> at constant values of <var>a</var>=<var>val</var>. This is special kind of plot for <var>a</var> specified in accompanied coordinates along curve <var>tr</var> with orts <var>g1</var>, <var>g2</var> and with transverse scale <var>r</var>. Variable <var>flag</var> is bitwise: &lsquo;<samp>0x1</samp>&rsquo; - draw in accompanied (not laboratory) coordinates; &lsquo;<samp>0x2</samp>&rsquo; - draw projection to <em>\rho-z</em> plane; &lsquo;<samp>0x4</samp>&rsquo; - draw normalized in each slice field. The x-size of data arrays <var>tr</var>, <var>g1</var>, <var>g2</var> must be nx&gt;2. The y-size of data arrays <var>tr</var>, <var>g1</var>, <var>g2</var> and z-size of the data array <var>a</var> must be equal. See also <a href="#surf3">surf3</a>.
</p></dd></dl>



<hr size="6">
<a name="Dual-plotting"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#g_t3D-plotting" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Vector-fields" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Dual-plotting-1"></a>
<h2 class="section">3.13 Dual plotting</h2>
<a name="index-SurfC"></a>
<a name="index-SurfA"></a>
<a name="index-Surf3C"></a>
<a name="index-Surf3A"></a>
<a name="index-TileS"></a>
<a name="index-Map"></a>
<a name="index-STFA"></a>

<p>These plotting functions draw <em>two matrix</em> simultaneously. There are 5 generally different types of data representations: surface or isosurface colored by other data (SurfC, Surf3C), surface or isosurface transpared by other data (SurfA, Surf3A), tiles with variable size (TileS), mapping diagram (Map), STFA diagram (STFA). By default (if absent) values of <var>x</var>, <var>y</var>, <var>z</var> are equidistantly distributed in axis range. The minor dimensions of arrays <var>x</var>, <var>y</var>, <var>z</var>, <var>c</var> should be equal. Arrays <var>x</var>, <var>y</var> (and <var>z</var> for <code>Surf3C, Surf3A</code>) can be vectors (not matrices as <var>c</var>). String <var>sch</var> sets the color scheme (see <a href="#Color-scheme">Color scheme</a>) for plot. String <var>opt</var> contain command options (see <a href="#Command-options">Command options</a>).
</p>
<p><a name="surfc"></a>
</p><dl>
<dt><a name="index-surfc"></a><u>MGL command:</u> <b>surfc</b><i> zdat cdat ['sch'='']</i></dt>
<dt><a name="index-surfc-1"></a><u>MGL command:</u> <b>surfc</b><i> xdat ydat zdat cdat ['sch'='']</i></dt>
<dd><p>The function draws surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]} and color it by matrix <var>c</var>[i,j]. If string <var>sch</var> have symbol &lsquo;<samp>#</samp>&rsquo; then grid lines are drawn. If string <var>sch</var> have symbol &lsquo;<samp>.</samp>&rsquo; then plot by dots is produced. All dimensions of arrays <var>z</var> and <var>c</var> must be equal. Surface is plotted for each z slice of the data. See also <a href="#surf">surf</a>, <a href="#surfa">surfa</a>, <a href="#surf3c">surf3c</a>. See section <a href="#SurfC-sample">SurfC sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="surf3c"></a>
</p><dl>
<dt><a name="index-surf3c"></a><u>MGL command:</u> <b>surf3c</b><i> adat cdat <code>val</code> ['sch'='']</i></dt>
<dt><a name="index-surf3c-1"></a><u>MGL command:</u> <b>surf3c</b><i> xdat ydat zdat adat cdat <code>val</code> ['sch'='']</i></dt>
<dd><p>The function draws isosurface plot for 3d array specified parametrically <var>a</var>[i,j,k](<var>x</var>[i,j,k], <var>y</var>[i,j,k], <var>z</var>[i,j,k]) at <var>a</var>(x,y,z)=<var>val</var>. It is mostly the same as <a href="#surf3">surf3</a> function but the color of isosurface depends on values of array <var>c</var>. If string <var>sch</var> contain &lsquo;<samp>#</samp>&rsquo; then wire plot is produced. If string <var>sch</var> have symbol &lsquo;<samp>.</samp>&rsquo; then plot by dots is produced. See also <a href="#surf3">surf3</a>, <a href="#surfc">surfc</a>, <a href="#surf3a">surf3a</a>. See section <a href="#Surf3C-sample">Surf3C sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-surf3c-2"></a><u>MGL command:</u> <b>surf3c</b><i> adat cdat ['sch'='']</i></dt>
<dt><a name="index-surf3c-3"></a><u>MGL command:</u> <b>surf3c</b><i> xdat ydat zdat adat cdat ['sch'='']</i></dt>
<dd><p>Draws <var>num</var>-th uniformly distributed in color range isosurfaces for 3d data. Here <var>num</var> is equal to parameter <var>value</var> in options <var>opt</var> (default is 3).
</p></dd></dl>


<p><a name="surfa"></a>
</p><dl>
<dt><a name="index-surfa"></a><u>MGL command:</u> <b>surfa</b><i> zdat cdat ['sch'='']</i></dt>
<dt><a name="index-surfa-1"></a><u>MGL command:</u> <b>surfa</b><i> xdat ydat zdat cdat ['sch'='']</i></dt>
<dd><p>The function draws surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]} and transparent it by matrix <var>c</var>[i,j]. If string <var>sch</var> have symbol &lsquo;<samp>#</samp>&rsquo; then grid lines are drawn. If string <var>sch</var> have symbol &lsquo;<samp>.</samp>&rsquo; then plot by dots is produced. All dimensions of arrays <var>z</var> and <var>c</var> must be equal. Surface is plotted for each z slice of the data. See also <a href="#surf">surf</a>, <a href="#surfc">surfc</a>, <a href="#surf3a">surf3a</a>. See section <a href="#SurfA-sample">SurfA sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="surf3a"></a>
</p><dl>
<dt><a name="index-surf3a"></a><u>MGL command:</u> <b>surf3a</b><i> adat cdat <code>val</code> ['sch'='']</i></dt>
<dt><a name="index-surf3a-1"></a><u>MGL command:</u> <b>surf3a</b><i> xdat ydat zdat adat cdat <code>val</code> ['sch'='']</i></dt>
<dd><p>The function draws isosurface plot for 3d array specified parametrically <var>a</var>[i,j,k](<var>x</var>[i,j,k], <var>y</var>[i,j,k], <var>z</var>[i,j,k]) at <var>a</var>(x,y,z)=<var>val</var>. It is mostly the same as <a href="#surf3">surf3</a> function but the color of isosurface depends on values of array <var>c</var>. If string <var>sch</var> contain &lsquo;<samp>#</samp>&rsquo; then wire plot is produced. If string <var>sch</var> have symbol &lsquo;<samp>.</samp>&rsquo; then plot by dots is produced. See also <a href="#surf3">surf3</a>, <a href="#surfc">surfc</a>, <a href="#surf3a">surf3a</a>. See section <a href="#Surf3A-sample">Surf3A sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-surf3a-2"></a><u>MGL command:</u> <b>surf3a</b><i> adat cdat ['sch'='']</i></dt>
<dt><a name="index-surf3a-3"></a><u>MGL command:</u> <b>surf3a</b><i> xdat ydat zdat adat cdat ['sch'='']</i></dt>
<dd><p>Draws <var>num</var>-th uniformly distributed in color range isosurfaces for 3d data. At this array <var>c</var> can be vector with values of transparency and <var>num</var>=<var>c</var>.nx. In opposite case <var>num</var> is equal to parameter <var>value</var> in options <var>opt</var> (default is 3).
</p></dd></dl>

<p><a name="tiles"></a>
</p><dl>
<dt><a name="index-tiles"></a><u>MGL command:</u> <b>tiles</b><i> zdat rdat ['sch'='']</i></dt>
<dt><a name="index-tiles-1"></a><u>MGL command:</u> <b>tiles</b><i> xdat ydat zdat rdat ['sch'='']</i></dt>
<dd><p>The function draws horizontal tiles for surface specified parametrically {<var>x</var>[i,j], <var>y</var>[i,j], <var>z</var>[i,j]}. It is mostly the same as <a href="#tile">tile</a> but the size of tiles is determined by <var>r</var> array. This is some kind of &ldquo;transparency&rdquo; useful for exporting to EPS files. Tiles is plotted for each z slice of the data. See also <a href="#surfa">surfa</a>, <a href="#tile">tile</a>. See section <a href="#TileS-sample">TileS sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="map"></a>
</p><dl>
<dt><a name="index-map"></a><u>MGL command:</u> <b>map</b><i> udat vdat ['sch'='']</i></dt>
<dt><a name="index-map-1"></a><u>MGL command:</u> <b>map</b><i> xdat ydat udat vdat ['sch'='']</i></dt>
<dd><p>The function draws mapping plot for matrices {<var>ax</var>, <var>ay</var> } which parametrically depend on coordinates <var>x</var>, <var>y</var>. The initial position of the cell (point) is marked by color. Height is proportional to Jacobian(ax,ay). This plot is like Arnold diagram ??? If string <var>sch</var> contain symbol &lsquo;<samp>.</samp>&rsquo; then the color ball at matrix knots are drawn otherwise face is drawn. See section <a href="#Mapping-visualization">Mapping visualization</a>, for sample code and picture.
</p></dd></dl>

<p><a name="stfa"></a>
</p><dl>
<dt><a name="index-stfa"></a><u>MGL command:</u> <b>stfa</b><i> re im <code>dn</code> ['sch'='']</i></dt>
<dt><a name="index-stfa-1"></a><u>MGL command:</u> <b>stfa</b><i> xdat ydat re im <code>dn</code> ['sch'='']</i></dt>
<dd><p>Draws spectrogram of complex array <var>re</var>+i*<var>im</var> for Fourier size of <var>dn</var> points at plane <var>z</var>=<var>Min</var>.z. For example in 1D case, result is density plot of data <em>res[i,j]=|\sum_d^dn exp(I*j*d)*(re[i*dn+d]+I*im[i*dn+d])|/dn</em> with size {int(nx/dn), dn, ny}. At this array <var>re</var>, <var>im</var> parametrically depend on coordinates <var>x</var>, <var>y</var>. The size of <var>re</var> and <var>im</var> must be the same. The minor dimensions of arrays <var>x</var>, <var>y</var>, <var>re</var> should be equal. Arrays <var>x</var>, <var>y</var> can be vectors (not matrix as <var>re</var>).  See section <a href="#STFA-sample">STFA sample</a>, for sample code and picture.
</p></dd></dl>



<hr size="6">
<a name="Vector-fields"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Dual-plotting" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Other-plotting" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Vector-fields-1"></a>
<h2 class="section">3.14 Vector fields</h2>
<a name="index-Traj"></a>
<a name="index-Vect"></a>
<a name="index-Dew"></a>
<a name="index-Flow"></a>
<a name="index-FlowP"></a>
<a name="index-Pipe"></a>

<p>These functions perform plotting of 2D and 3D vector fields. There are 5 generally different types of vector fields representations: simple vector field (Vect), vectors along the curve (Traj), vector field by dew-drops (Dew), flow threads (Flow, FlowP), flow pipes (Pipe). By default (if absent) values of <var>x</var>, <var>y</var>, <var>z</var> are equidistantly distributed in axis range. The minor dimensions of arrays <var>x</var>, <var>y</var>, <var>z</var>, <var>ax</var> should be equal. The size of <var>ax</var>, <var>ay</var> and <var>az</var> must be equal. Arrays <var>x</var>, <var>y</var>, <var>z</var> can be vectors (not matrices as <var>ax</var>). String <var>sch</var> sets the color scheme (see <a href="#Color-scheme">Color scheme</a>) for plot. String <var>opt</var> contain command options (see <a href="#Command-options">Command options</a>).
</p>
<p><a name="traj"></a>
</p><dl>
<dt><a name="index-traj"></a><u>MGL command:</u> <b>traj</b><i> xdat ydat udat vdat ['sch'='']</i></dt>
<dt><a name="index-traj-1"></a><u>MGL command:</u> <b>traj</b><i> xdat ydat zdat udat vdat wdat ['sch'='']</i></dt>
<dd><p>The function draws vectors {<var>ax</var>, <var>ay</var>, <var>az</var>} along a curve {<var>x</var>, <var>y</var>, <var>z</var>}. The length of arrows are proportional to <em>\sqrtax^2+ay^2+az^2</em>. String <var>pen</var> specifies the color (see <a href="#Line-styles">Line styles</a>). By default (<code>pen=&quot;&quot;</code>) color from palette is used (see <a href="#Palette-and-colors">Palette and colors</a>). Option <var>value</var> set the vector length factor (if non-zero) or vector length to be proportional the distance between curve points (if <var>value</var>=0). The minor sizes of all arrays must be equal and large 2. The plots are drawn for each row if one of the data is the matrix. See also <a href="#vect">vect</a>. See section <a href="#Traj-sample">Traj sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="vect"></a>
</p><dl>
<dt><a name="index-vect"></a><u>MGL command:</u> <b>vect</b><i> udat vdat ['sch'='']</i></dt>
<dt><a name="index-vect-1"></a><u>MGL command:</u> <b>vect</b><i> xdat ydat udat vdat ['sch'='']</i></dt>
<dd><p>The function draws plane vector field plot for the field {<var>ax</var>, <var>ay</var>} depending parametrically on coordinates <var>x</var>, <var>y</var> at level <var>z</var>=<var>Min</var>.z. The length and color of arrows are proportional to <em>\sqrtax^2+ay^2</em>. The number of arrows depend on <a href="#meshnum">meshnum</a>. The appearance of the hachures (arrows) can be changed by symbols:
</p><ul>
<li>
&lsquo;<samp>f</samp>&rsquo; for drawing arrows with fixed lengths,
</li><li>
&lsquo;<samp>&gt;</samp>&rsquo;, &lsquo;<samp>&lt;</samp>&rsquo; for drawing arrows to or from the cell point (default is centering),
</li><li>
&lsquo;<samp>.</samp>&rsquo; for drawing hachures with dots instead of arrows,
</li><li>
&lsquo;<samp>=</samp>&rsquo; for enabling color gradient along arrows.
</li></ul>
<p>See also <a href="#flow">flow</a>, <a href="#dew">dew</a>. See section <a href="#Vect-sample">Vect sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-vect-2"></a><u>MGL command:</u> <b>vect</b><i> udat vdat wdat ['sch'='']</i></dt>
<dt><a name="index-vect-3"></a><u>MGL command:</u> <b>vect</b><i> xdat ydat zdat udat vdat wdat ['sch'='']</i></dt>
<dd><p>This is 3D version of the first functions. Here arrays <var>ax</var>, <var>ay</var>, <var>az</var> must be 3-ranged tensors with equal sizes and the length and color of arrows is proportional to <em>\sqrtax^2+ay^2+az^2</em>.
</p></dd></dl>

<p><a name="vect3"></a>
</p><dl>
<dt><a name="index-vect3"></a><u>MGL command:</u> <b>vect3</b><i> udat vdat wdat ['sch'='' sval]</i></dt>
<dt><a name="index-vect3-1"></a><u>MGL command:</u> <b>vect3</b><i> xdat ydat zdat udat vdat wdat ['sch'='' sval]</i></dt>
<dd><p>The function draws 3D vector field plot for the field {<var>ax</var>, <var>ay</var>, <var>az</var>} depending parametrically on coordinates <var>x</var>, <var>y</var>, <var>z</var>. Vector field is drawn at slice <var>sVal</var> in direction {&lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo;} if <var>sch</var> contain corresponding symbol (by default, &lsquo;<samp>y</samp>&rsquo; direction is used). The length and color of arrows are proportional to <em>\sqrtax^2+ay^2+az^2</em>. The number of arrows depend on <a href="#meshnum">meshnum</a>. The appearance of the hachures (arrows) can be changed by symbols:
</p><ul>
<li>
&lsquo;<samp>f</samp>&rsquo; for drawing arrows with fixed lengths,
</li><li>
&lsquo;<samp>&gt;</samp>&rsquo;, &lsquo;<samp>&lt;</samp>&rsquo; for drawing arrows to or from the cell point (default is centering),
</li><li>
&lsquo;<samp>.</samp>&rsquo; for drawing hachures with dots instead of arrows,
</li><li>
&lsquo;<samp>=</samp>&rsquo; for enabling color gradient along arrows.
</li></ul>
<p>See also <a href="#vect">vect</a>, <a href="#flow">flow</a>, <a href="#dew">dew</a>. See section <a href="#Vect3-sample">Vect3 sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="dew"></a>
</p><dl>
<dt><a name="index-dew"></a><u>MGL command:</u> <b>dew</b><i> udat vdat ['sch'='']</i></dt>
<dt><a name="index-dew-1"></a><u>MGL command:</u> <b>dew</b><i> xdat ydat udat vdat ['sch'='']</i></dt>
<dd><p>The function draws dew-drops for plane vector field {<var>ax</var>, <var>ay</var>} depending parametrically on coordinates <var>x</var>, <var>y</var> at level <var>z</var>=<var>Min</var>.z. Note that this is very expensive plot in memory usage and creation time! The color of drops is proportional to <em>\sqrtax^2+ay^2</em>. The number of drops depend on <a href="#meshnum">meshnum</a>. See also <a href="#vect">vect</a>. See section <a href="#Dew-sample">Dew sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="flow"></a>
</p><dl>
<dt><a name="index-flow"></a><u>MGL command:</u> <b>flow</b><i> udat vdat ['sch'='']</i></dt>
<dt><a name="index-flow-1"></a><u>MGL command:</u> <b>flow</b><i> xdat ydat udat vdat ['sch'='']</i></dt>
<dd><p>The function draws flow threads for the plane vector field {<var>ax</var>, <var>ay</var>} parametrically depending on coordinates <var>x</var>, <var>y</var> at level <var>z</var> = <var>Min</var>.z. Number of threads is proportional to <var>value</var> option (default is 5). String <var>sch</var> may contain:
</p><ul>
<li>
color scheme &ndash; up-half (warm) corresponds to normal flow (like attractor), bottom-half (cold) corresponds to inverse flow (like source);
</li><li>
&lsquo;<samp>#</samp>&rsquo; for starting threads from edges only;
</li><li>
&lsquo;<samp>v</samp>&rsquo; for drawing arrows on the threads;
</li><li>
&lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo; for drawing tapes of normals in x-y and y-z planes correspondingly.
</li></ul>
<p>See also <a href="#pipe">pipe</a>, <a href="#vect">vect</a>, <a href="#tape">tape</a>, <a href="#barwidth">barwidth</a>. See section <a href="#Flow-sample">Flow sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-flow-2"></a><u>MGL command:</u> <b>flow</b><i> udat vdat wdat ['sch'='']</i></dt>
<dt><a name="index-flow-3"></a><u>MGL command:</u> <b>flow</b><i> xdat ydat zdat udat vdat wdat ['sch'='']</i></dt>
<dd><p>This is 3D version of the first functions. Here arrays <var>ax</var>, <var>ay</var>, <var>az</var> must be 3-ranged tensors with equal sizes and the color of line is proportional to <em>\sqrtax^2+ay^2+az^2</em>.
</p></dd></dl>

<dl>
<dt><a name="index-flow-4"></a><u>MGL command:</u> <b>flow</b><i> <code>x0 y0</code> udat vdat ['sch'='']</i></dt>
<dt><a name="index-flow-5"></a><u>MGL command:</u> <b>flow</b><i> <code>x0 y0</code> xdat ydat udat vdat ['sch'='']</i></dt>
<dd><p>The same as first one (<a href="#flow">flow</a>) but draws single flow thread starting from point <var>p0</var>={<var>x0</var>,<var>y0</var>,<var>z0</var>}.
</p></dd></dl>

<dl>
<dt><a name="index-flow-6"></a><u>MGL command:</u> <b>flow</b><i> <code>x0 y0 z0</code> udat vdat wdat ['sch'='']</i></dt>
<dt><a name="index-flow-7"></a><u>MGL command:</u> <b>flow</b><i> <code>x0 y0 z0</code> xdat ydat zdat udat vdat wdat ['sch'='']</i></dt>
<dd><p>This is 3D version of the previous functions.
</p></dd></dl>

<p><a name="grad"></a>
</p><dl>
<dt><a name="index-grad"></a><u>MGL command:</u> <b>grad</b><i> pdat ['sch'='']</i></dt>
<dt><a name="index-grad-1"></a><u>MGL command:</u> <b>grad</b><i> xdat ydat pdat ['sch'='']</i></dt>
<dt><a name="index-grad-2"></a><u>MGL command:</u> <b>grad</b><i> xdat ydat zdat pdat ['sch'='']</i></dt>
<dd><p>The function draws gradient lines for scalar field <var>phi</var>[i,j] (or <var>phi</var>[i,j,k] in 3d case) specified parametrically {<var>x</var>[i,j,k], <var>y</var>[i,j,k], <var>z</var>[i,j,k]}. Number of lines is proportional to <var>value</var> option (default is 5). See also <a href="#dens">dens</a>, <a href="#cont">cont</a>, <a href="#flow">flow</a>.
</p></dd></dl>

<p><a name="pipe"></a>
</p><dl>
<dt><a name="index-pipe"></a><u>MGL command:</u> <b>pipe</b><i> udat vdat ['sch'='' <code>r0=0.05</code>]</i></dt>
<dt><a name="index-pipe-1"></a><u>MGL command:</u> <b>pipe</b><i> xdat ydat udat vdat ['sch'='' <code>r0=0.05</code>]</i></dt>
<dd><p>The function draws flow pipes for the plane vector field {<var>ax</var>, <var>ay</var>} parametrically depending on coordinates <var>x</var>, <var>y</var> at level <var>z</var> = <var>Min</var>.z. Number of pipes is proportional to <var>value</var> option (default is 5). If &lsquo;<samp>#</samp>&rsquo; symbol is specified then pipes start only from edges of axis range. The color of lines is proportional to <em>\sqrtax^2+ay^2</em>. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). Parameter <var>r0</var> set the base pipe radius. If <var>r0</var>&lt;0 or symbol &lsquo;<samp>i</samp>&rsquo; is specified then pipe radius is inverse proportional to amplitude. The vector field is plotted for each z slice of <var>ax</var>, <var>ay</var>. See also <a href="#flow">flow</a>, <a href="#vect">vect</a>. See section <a href="#Pipe-sample">Pipe sample</a>, for sample code and picture.
</p></dd></dl>

<dl>
<dt><a name="index-pipe-2"></a><u>MGL command:</u> <b>pipe</b><i> udat vdat wdat ['sch'='' <code>r0=0.05</code>]</i></dt>
<dt><a name="index-pipe-3"></a><u>MGL command:</u> <b>pipe</b><i> xdat ydat zdat udat vdat wdat ['sch'='' <code>r0=0.05</code>]</i></dt>
<dd><p>This is 3D version of the first functions. Here arrays <var>ax</var>, <var>ay</var>, <var>az</var> must be 3-ranged tensors with equal sizes and the color of line is proportional to <em>\sqrtax^2+ay^2+az^2</em>.
</p></dd></dl>



<hr size="6">
<a name="Other-plotting"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Vector-fields" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Nonlinear-fitting" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Other-plotting-1"></a>
<h2 class="section">3.15 Other plotting</h2>
<a name="index-DensXYZ"></a>
<a name="index-ContXYZ"></a>
<a name="index-ContFXYZ"></a>
<a name="index-Dots"></a>
<a name="index-Crust"></a>
<a name="index-TriPlot"></a>
<a name="index-TriCont"></a>
<a name="index-QuadPlot"></a>
<a name="index-FPlot"></a>
<a name="index-FSurf"></a>

<p>These functions perform miscellaneous plotting. There is unstructured data points plots (Dots), surface reconstruction (Crust), surfaces on the triangular or quadrangular mesh (TriPlot, TriCont, QuadPlot), textual formula plotting (Plots by formula), data plots at edges (Dens[XYZ], Cont[XYZ], ContF[XYZ]). Each type of plotting has similar interface. There are 2 kind of versions which handle the arrays of data and coordinates or only single data array. Parameters of color scheme are specified by the string argument. See section <a href="#Color-scheme">Color scheme</a>.
</p>
<p><a name="densz"></a> <a name="densy"></a> <a name="densx"></a> <a name="DensXYZ"></a>
</p><dl>
<dt><a name="index-densx"></a><u>MGL command:</u> <b>densx</b><i> dat ['sch'='' <code>sval=nan</code>]</i></dt>
<dt><a name="index-densy"></a><u>MGL command:</u> <b>densy</b><i> dat ['sch'='' <code>sval=nan</code>]</i></dt>
<dt><a name="index-densz"></a><u>MGL command:</u> <b>densz</b><i> dat ['sch'='' <code>sval=nan</code>]</i></dt>
<dd><p>These plotting functions draw density plot in x, y, or z plain. If <var>a</var> is a tensor (3-dimensional data) then interpolation to a given <var>sVal</var> is performed. These functions are useful for creating projections of the 3D data array to the bounding box. See also <a href="#ContXYZ">ContXYZ</a>, <a href="#ContFXYZ">ContFXYZ</a>, <a href="#dens">dens</a>, <a href="#Data-manipulation">Data manipulation</a>. See section <a href="#Dens-projection-sample">Dens projection sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="contz"></a> <a name="conty"></a> <a name="contx"></a> <a name="ContXYZ"></a>
</p><dl>
<dt><a name="index-contx"></a><u>MGL command:</u> <b>contx</b><i> dat ['sch'='' <code>sval=nan</code>]</i></dt>
<dt><a name="index-conty"></a><u>MGL command:</u> <b>conty</b><i> dat ['sch'='' <code>sval=nan</code>]</i></dt>
<dt><a name="index-contz"></a><u>MGL command:</u> <b>contz</b><i> dat ['sch'='' <code>sval=nan</code>]</i></dt>
<dd><p>These plotting functions draw contour lines in x, y, or z plain. If <var>a</var> is a tensor (3-dimensional data) then interpolation to a given <var>sVal</var> is performed. These functions are useful for creating projections of the 3D data array to the bounding box. See also <a href="#ContFXYZ">ContFXYZ</a>, <a href="#DensXYZ">DensXYZ</a>, <a href="#cont">cont</a>, <a href="#Data-manipulation">Data manipulation</a>. See section <a href="#Cont-projection-sample">Cont projection sample</a>, for sample code and picture.
</p></dd></dl>


<p><a name="contfz"></a> <a name="contfy"></a> <a name="contfx"></a> <a name="ContFXYZ"></a>
</p><dl>
<dt><a name="index-contfx"></a><u>MGL command:</u> <b>contfx</b><i> dat ['sch'='' <code>sval=nan</code>]</i></dt>
<dt><a name="index-contfy"></a><u>MGL command:</u> <b>contfy</b><i> dat ['sch'='' <code>sval=nan</code>]</i></dt>
<dt><a name="index-contfz"></a><u>MGL command:</u> <b>contfz</b><i> dat ['sch'='' <code>sval=nan</code>]</i></dt>
<dd><p>These plotting functions draw solid contours in x, y, or z plain. If <var>a</var> is a tensor (3-dimensional data) then interpolation to a given <var>sVal</var> is performed. These functions are useful for creating projections of the 3D data array to the bounding box. See also <a href="#ContFXYZ">ContFXYZ</a>, <a href="#DensXYZ">DensXYZ</a>, <a href="#cont">cont</a>, <a href="#Data-manipulation">Data manipulation</a>. See section <a href="#ContF-projection-sample">ContF projection sample</a>, for sample code and picture.
</p></dd></dl>


<p><a name="fplot"></a>
</p><dl>
<dt><a name="index-fplot"></a><u>MGL command:</u> <b>fplot</b><i> 'y(x)' ['pen'='']</i></dt>
<dd><p>Draws command function &lsquo;<samp>y(x)</samp>&rsquo; at plane <var>z</var>=<var>Min</var>.z where &lsquo;<samp>x</samp>&rsquo; variable is changed in <code>xrange</code>. You do not need to create the data arrays to plot it.  See also <a href="#plot">plot</a>.
</p></dd></dl>

<dl>
<dt><a name="index-fplot-1"></a><u>MGL command:</u> <b>fplot</b><i> 'x(t)' 'y(t)' 'z(t)' ['pen'='']</i></dt>
<dd><p>Draws command parametrical curve {&lsquo;<samp>x(t)</samp>&rsquo;, &lsquo;<samp>y(t)</samp>&rsquo;, &lsquo;<samp>z(t)</samp>&rsquo;} where &lsquo;<samp>t</samp>&rsquo; variable is changed in range [0, 1]. You do not need to create the data arrays to plot it. See also <a href="#plot">plot</a>.
</p></dd></dl>

<p><a name="fsurf"></a>
</p><dl>
<dt><a name="index-fsurf"></a><u>MGL command:</u> <b>fsurf</b><i> 'z(x,y)' ['sch'='']</i></dt>
<dd><p>Draws command surface for function &lsquo;<samp>z(x,y)</samp>&rsquo; where &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo; variable are changed in <code>xrange, yrange</code>. You do not need to create the data arrays to plot it. See also <a href="#surf">surf</a>.
</p></dd></dl>

<dl>
<dt><a name="index-fsurf-1"></a><u>MGL command:</u> <b>fsurf</b><i> 'x(u,v)' 'y(u,v)' 'z(u,v)' ['sch'='']</i></dt>
<dd><p>Draws command parametrical surface {&lsquo;<samp>x(u,v)</samp>&rsquo;, &lsquo;<samp>y(u,v)</samp>&rsquo;, &lsquo;<samp>z(u,v)</samp>&rsquo;} where &lsquo;<samp>u</samp>&rsquo;, &lsquo;<samp>v</samp>&rsquo; variable are changed in range [0, 1]. You do not need to create the data arrays to plot it. See also <a href="#surf">surf</a>.
</p></dd></dl>

<p><a name="triplot"></a>
</p><dl>
<dt><a name="index-triplot"></a><u>MGL command:</u> <b>triplot</b><i> idat xdat ydat ['sch'='']</i></dt>
<dt><a name="index-triplot-1"></a><u>MGL command:</u> <b>triplot</b><i> idat xdat ydat zdat ['sch'='']</i></dt>
<dt><a name="index-triplot-2"></a><u>MGL command:</u> <b>triplot</b><i> idat xdat ydat zdat cdat ['sch'='']</i></dt>
<dd><p>The function draws the surface of triangles. Triangle vertexes are set by indexes <var>id</var> of data points {<var>x</var>[i], <var>y</var>[i], <var>z</var>[i]}. String <var>sch</var> sets the color scheme. If string contain &lsquo;<samp>#</samp>&rsquo; then wire plot is produced. First dimensions of <var>id</var> must be 3 or greater. Arrays <var>x</var>, <var>y</var>, <var>z</var> must have equal sizes. Parameter <var>c</var> set the colors of triangles (if <var>id</var>.ny=<var>c</var>.nx) or colors of vertexes (if <var>x</var>.nx=<var>c</var>.nx). See also <a href="#dots">dots</a>, <a href="#crust">crust</a>, <a href="#quadplot">quadplot</a>, <a href="#triangulation">triangulation</a>. See section <a href="#TriPlot-and-QuadPlot">TriPlot and QuadPlot</a>, for sample code and picture.
</p></dd></dl>

<p><a name="tricont"></a>
</p><dl>
<dt><a name="index-tricont"></a><u>MGL command:</u> <b>tricont</b><i> vdat idat xdat ydat zdat cdat ['sch'='']</i></dt>
<dt><a name="index-tricont-1"></a><u>MGL command:</u> <b>tricont</b><i> vdat idat xdat ydat zdat ['sch'='']</i></dt>
<dt><a name="index-tricont-2"></a><u>MGL command:</u> <b>tricont</b><i> idat xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function draws contour lines for surface of triangles at <var>z</var>=<var>v</var>[k] (or at  <var>z</var> = <var>Min</var>.z if <var>sch</var> contain symbol &lsquo;<samp>_</samp>&rsquo;). Triangle vertexes are set by indexes <var>id</var> of data points {<var>x</var>[i], <var>y</var>[i], <var>z</var>[i]}. Contours are plotted for <var>z</var>[i,j]=<var>v</var>[k] where <var>v</var>[k] are values of data array <var>v</var>. String <var>sch</var> sets the color scheme. Array <var>c</var> (if specified) is used for contour coloring. First dimensions of <var>id</var> must be 3 or greater. Arrays <var>x</var>, <var>y</var>, <var>z</var> must have equal sizes. Parameter <var>c</var> set the colors of triangles (if <var>id</var>.ny=<var>c</var>.nx) or colors of vertexes (if <var>x</var>.nx=<var>c</var>.nx). See also <a href="#triplot">triplot</a>, <a href="#cont">cont</a>, <a href="#triangulation">triangulation</a>.
</p></dd></dl>

<p><a name="quadplot"></a>
</p><dl>
<dt><a name="index-quadplot"></a><u>MGL command:</u> <b>quadplot</b><i> idat xdat ydat ['sch'='']</i></dt>
<dt><a name="index-quadplot-1"></a><u>MGL command:</u> <b>quadplot</b><i> idat xdat ydat zdat ['sch'='']</i></dt>
<dt><a name="index-quadplot-2"></a><u>MGL command:</u> <b>quadplot</b><i> idat xdat ydat zdat cdat ['sch'='']</i></dt>
<dd><p>The function draws the surface of quadrangles. Quadrangles vertexes are set by indexes <var>id</var> of data points {<var>x</var>[i], <var>y</var>[i], <var>z</var>[i]}. String <var>sch</var> sets the color scheme. If string contain &lsquo;<samp>#</samp>&rsquo; then wire plot is produced. First dimensions of <var>id</var> must be 4 or greater. Arrays <var>x</var>, <var>y</var>, <var>z</var> must have equal sizes. Parameter <var>c</var> set the colors of quadrangles (if <var>id</var>.ny=<var>c</var>.nx) or colors of vertexes (if <var>x</var>.nx=<var>c</var>.nx). See also <a href="#triplot">triplot</a>. See section <a href="#TriPlot-and-QuadPlot">TriPlot and QuadPlot</a>, for sample code and picture.
</p></dd></dl>

<p><a name="dots"></a>
</p><dl>
<dt><a name="index-dots"></a><u>MGL command:</u> <b>dots</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dt><a name="index-dots-1"></a><u>MGL command:</u> <b>dots</b><i> xdat ydat zdat adat ['sch'='']</i></dt>
<dd><p>The function draws the arbitrary placed points {<var>x</var>[i], <var>y</var>[i], <var>z</var>[i]}. String <var>sch</var> sets the color scheme. If array <var>a</var> is specified then it define colors of dots. Arrays <var>x</var>, <var>y</var>, <var>z</var>, <var>a</var> must have equal sizes. See also <a href="#crust">crust</a>, <a href="#mark">mark</a>, <a href="#plot">plot</a>. See section <a href="#Dots-sample">Dots sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="crust"></a>
</p><dl>
<dt><a name="index-crust"></a><u>MGL command:</u> <b>crust</b><i> xdat ydat zdat ['sch'='']</i></dt>
<dd><p>The function reconstruct and draws the surface for arbitrary placed points {<var>x</var>[i], <var>y</var>[i], <var>z</var>[i]}. String <var>sch</var> sets the color scheme. If string contain &lsquo;<samp>#</samp>&rsquo; then wire plot is produced. Arrays <var>x</var>, <var>y</var>, <var>z</var> must have equal sizes. See also <a href="#dots">dots</a>, <a href="#triplot">triplot</a>. </p></dd></dl>


<hr size="6">
<a name="Nonlinear-fitting"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Other-plotting" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-manipulation" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Nonlinear-fitting-1"></a>
<h2 class="section">3.16 Nonlinear fitting</h2>
<a name="index-Fit"></a>
<a name="index-FitS"></a>
<a name="index-PutsFit"></a>
<a name="index-mglFitPnts"></a>
<a name="index-Fit2"></a>
<a name="index-Fit3"></a>

<p>These functions fit data to formula. Fitting goal is to find formula parameters for the best fit the data points, i.e. to minimize the sum <em>\sum_i (f(x_i, y_i, z_i) - a_i)^2/s_i^2</em>. At this, approximation function &lsquo;<samp>f</samp>&rsquo; can depend only on one argument &lsquo;<samp>x</samp>&rsquo; (1D case), on two arguments &lsquo;<samp>x,y</samp>&rsquo; (2D case) and on three arguments &lsquo;<samp>x,y,z</samp>&rsquo; (3D case). The function &lsquo;<samp>f</samp>&rsquo; also may depend on parameters. Normally the list of fitted parameters is specified by <var>var</var> string (like, &lsquo;<samp>abcd</samp>&rsquo;). Usually user should supply initial values for fitted parameters by <var>ini</var> variable. But if he/she don&rsquo;t supply it then the zeros are used. Parameter <var>print</var>=<code>true</code> switch on printing the found coefficients to <var>Message</var> (see <a href="#Error-handling">Error handling</a>).
</p>
<p>Functions Fit() and FitS() do not draw the obtained data themselves. They fill the data <var>fit</var> by formula &lsquo;<samp>f</samp>&rsquo; with found coefficients and return it. At this, the &lsquo;<samp>x,y,z</samp>&rsquo; coordinates are equidistantly distributed in the axis range. Number of points in <var>fit</var> is selected as maximal value of <var>fit</var> size and the value of <var>mglFitPnts</var>. Note, that this functions use GSL library and do something only if MathGL was compiled with GSL support. See section <a href="#Nonlinear-fitting-sample">Nonlinear fitting hints</a>, for sample code and picture.
</p>
<p><a name="fits"></a>
</p><dl>
<dt><a name="index-fits"></a><u>MGL command:</u> <b>fits</b><i> res adat sdat 'func' 'var' [ini=0]</i></dt>
<dt><a name="index-fits-1"></a><u>MGL command:</u> <b>fits</b><i> res xdat adat sdat 'func' 'var' [ini=0]</i></dt>
<dt><a name="index-fits-2"></a><u>MGL command:</u> <b>fits</b><i> res xdat ydat adat sdat 'func' 'var' [ini=0]</i></dt>
<dt><a name="index-fits-3"></a><u>MGL command:</u> <b>fits</b><i> res xdat ydat zdat adat sdat 'func' 'var' [ini=0]</i></dt>
<dd><p>Fit data along x-, y- and z-directions for array specified parametrically <var>a</var>[i,j,k](<var>x</var>[i,j,k], <var>y</var>[i,j,k], <var>z</var>[i,j,k]) with weight factor <var>s</var>[i,j,k].
</p></dd></dl>

<p><a name="fit"></a>
</p><dl>
<dt><a name="index-fit"></a><u>MGL command:</u> <b>fit</b><i> res adat sdat 'func' 'var' [ini=0]</i></dt>
<dt><a name="index-fit-1"></a><u>MGL command:</u> <b>fit</b><i> res xdat adat sdat 'func' 'var' [ini=0]</i></dt>
<dt><a name="index-fit-2"></a><u>MGL command:</u> <b>fit</b><i> res xdat ydat adat sdat 'func' 'var' [ini=0]</i></dt>
<dt><a name="index-fit-3"></a><u>MGL command:</u> <b>fit</b><i> res xdat ydat zdat adat sdat 'func' 'var' [ini=0]</i></dt>
<dd><p>Fit data along x-, y- and z-directions for array specified parametrically <var>a</var>[i,j,k](<var>x</var>[i,j,k], <var>y</var>[i,j,k], <var>z</var>[i,j,k]) with weight factor 1.
</p></dd></dl>



<p><a name="putsfit"></a>
</p><dl>
<dt><a name="index-putsfit"></a><u>MGL command:</u> <b>putsfit</b><i> <code>x y</code> ['pre'='' 'fnt'='' <code>size=-1</code>]</i></dt>
<dd><p>Print last fitted formula with found coefficients (as numbers) at position <var>p0</var>. The string <var>prefix</var> will be printed before formula. All other parameters are the same as in <a href="#Text-printing">Text printing</a>.
</p></dd></dl>




<hr size="6">
<a name="Data-manipulation"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Nonlinear-fitting" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Data-manipulation-1"></a>
<h2 class="section">3.17 Data manipulation</h2>
<a name="index-Hist"></a>
<a name="index-Fill"></a>
<a name="index-DataGrid"></a>

<dl>
<dt><a name="index-hist"></a><u>MGL command:</u> <b>hist</b><i> <small>RES</small> xdat adat</i></dt>
<dt><a name="index-hist-1"></a><u>MGL command:</u> <b>hist</b><i> <small>RES</small> xdat ydat adat</i></dt>
<dt><a name="index-hist-2"></a><u>MGL command:</u> <b>hist</b><i> <small>RES</small> xdat ydat zdat adat</i></dt>
<dd><p>These functions make distribution (histogram) of data. They do not draw the obtained data themselves. These functions can be useful if user have data defined for random points (for example, after PIC simulation) and he want to produce a plot which require regular data (defined on grid(s)). The range for grids is always selected as axis range. Arrays <var>x</var>, <var>y</var>, <var>z</var> define the positions (coordinates) of random points. Array <var>a</var> define the data value. Number of points in output array <var>res</var> is selected as maximal value of <var>res</var> size and the value of <var>mglFitPnts</var>.
</p></dd></dl>


<dl>
<dt><a name="index-fill"></a><u>MGL command:</u> <b>fill</b><i> dat 'eq'</i></dt>
<dt><a name="index-fill-1"></a><u>MGL command:</u> <b>fill</b><i> dat 'eq' vdat</i></dt>
<dt><a name="index-fill-2"></a><u>MGL command:</u> <b>fill</b><i> dat 'eq' vdat wdat</i></dt>
<dd><p>Fills the value of array &lsquo;<samp>u</samp>&rsquo; according to the formula in string <var>eq</var>. Formula is an arbitrary expression depending  on variables &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo;, &lsquo;<samp>u</samp>&rsquo;, &lsquo;<samp>v</samp>&rsquo;, &lsquo;<samp>w</samp>&rsquo;. Coordinates &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo; are supposed to be normalized in axis range. Variable &lsquo;<samp>u</samp>&rsquo; is the original value of the array. Variables &lsquo;<samp>v</samp>&rsquo; and &lsquo;<samp>w</samp>&rsquo; are values of arrays <var>v</var>, <var>w</var> which can be <code>NULL</code> (i.e. can be omitted).
</p></dd></dl>

<dl>
<dt><a name="index-datagrid"></a><u>MGL command:</u> <b>datagrid</b><i> dat xdat ydat zdat</i></dt>
<dd><p>Fills the value of array &lsquo;<samp>u</samp>&rsquo; according to the linear interpolation of triangulated surface, found for arbitrary placed points &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo;. Interpolation is done at points equidistantly distributed in axis range. NAN value is used for grid points placed outside of triangulated surface.
</p></dd></dl>



<dl>
<dt><a name="index-pde"></a><u>MGL command:</u> <b>pde</b><i> <small>RES</small> 'ham' ini_re ini_im [<code>dz=0.1 k0=100</code>]</i></dt>
<dd><p>Solves equation du/dz = i*k0*<var>ham</var>(p,q,x,y,z,|u|)[u], where p=-i/k0*d/dx, q=-i/k0*d/dy are pseudo-differential operators. Parameters <var>ini_re</var>, <var>ini_im</var> specify real and imaginary part of initial field distribution. Coordinates &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo; are supposed to be normalized in axis range. Note, that really this ranges are increased by factor 3/2 for purpose of reducing reflection from boundaries. Parameter <var>dz</var> set the step along evolutionary coordinate z. At this moment, simplified form of function <var>ham</var> is supported &ndash; all &ldquo;mixed&rdquo; terms (like &lsquo;<samp>x*p</samp>&rsquo;-&gt;x*d/dx) are excluded. For example, in 2D case this function is effectively <em>ham = f(p,z) + g(x,z,u)</em>. However commutable combinations (like &lsquo;<samp>x*q</samp>&rsquo;-&gt;x*d/dy) are allowed. Here variable &lsquo;<samp>u</samp>&rsquo; is used for field amplitude |u|. This allow one solve nonlinear problems &ndash; for example, for nonlinear Shrodinger equation you may set <code>ham=&quot;p^2 + q^2 - u^2&quot;</code>. You may specify imaginary part for wave absorption, like <code>ham = &quot;p^2 + i*x*(x&gt;0)&quot;</code>, but only if dependence on variable &lsquo;<samp>i</samp>&rsquo; is linear (i.e. <em>ham = hre+i*him</em>). See section <a href="#PDE-solving-hints">PDE solving hints</a>, for sample code and picture.
</p></dd></dl>











<hr size="6">
<a name="Data-processing"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Data-manipulation" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Public-variables" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#MathGL-core" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Data-processing-1"></a>
<h1 class="chapter">4. Data processing</h1>

<p>This chapter describe commands for allocation, resizing, loading and saving, modifying of data arrays. Also it can numerically differentiate and integrate data, interpolate, fill data by formula and so on. Class supports data with dimensions up to 3 (like function of 3 variables &ndash; x,y,z). Data arrays are denoted by Small Caps (like <small>DAT</small>) if it can be (re-)created by MGL commands.
</p>

<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Public-variables">4.1 Public variables</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Data-constructor">4.2 Data constructor</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Data-resizing">4.3 Data resizing</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Data-filling">4.4 Data filling</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#File-I_002fO">4.5 File I/O</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Make-another-data">4.6 Make another data</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Data-changing">4.7 Data changing</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Interpolation">4.8 Interpolation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Data-information">4.9 Data information</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Operators">4.10 Operators</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Global-functions">4.11 Global functions</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Evaluate-expression">4.12 Evaluate expression</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#MGL-variables">4.13 MGL variables</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>


<hr size="6">
<a name="Public-variables"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Data-processing" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-constructor" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Public-variables-1"></a>
<h2 class="section">4.1 Public variables</h2>

<p>MGL don&rsquo;t support direct access to data arrays. See section <a href="#Data-filling">Data filling</a>
</p>


<hr size="6">
<a name="Data-constructor"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Public-variables" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-resizing" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Data-constructor-1"></a>
<h2 class="section">4.2 Data constructor</h2>
<a name="index-mglData"></a>

<p>There are many functions, which can create data for output (see <a href="#Data-filling">Data filling</a>, <a href="#File-I_002fO">File I/O</a>, <a href="#Make-another-data">Make another data</a>, <a href="#Global-functions">Global functions</a>). Here I put most useful of them.
</p>
<p><a name="new"></a>
</p><dl>
<dt><a name="index-new"></a><u>MGL command:</u> <b>new</b><i> <small>DAT</small> [<code>nx=1</code> 'eq']</i></dt>
<dt><a name="index-new-1"></a><u>MGL command:</u> <b>new</b><i> <small>DAT</small> <code>nx ny</code> ['eq']</i></dt>
<dt><a name="index-new-2"></a><u>MGL command:</u> <b>new</b><i> <small>DAT</small> <code>nx ny nz</code> ['eq']</i></dt>
<dd><p>Default constructor. Allocates the memory for data array and initializes it by zero. If string <var>eq</var> is specified then data will be filled by corresponding formula as in <a href="#fill">fill</a>.
</p></dd></dl>

<p><a name="copy"></a>
</p><dl>
<dt><a name="index-copy"></a><u>MGL command:</u> <b>copy</b><i> <small>DAT</small> dat2 ['eq'='']</i></dt>
<dt><a name="index-copy-1"></a><u>MGL command:</u> <b>copy</b><i> <small>DAT</small> <code>val</code></i></dt>
<dd><p>Copy constructor. Allocates the memory for data array and copy values from other array. At this, if parameter <var>eq</var> is specified then the data will be modified by corresponding formula similarly to <a href="#fill">fill</a>.
</p></dd></dl>

<dl>
<dt><a name="index-read"></a><u>MGL command:</u> <b>read</b><i> <small>DAT</small> 'fname'</i></dt>
<dd><p>Reads data from tab-separated text file with auto determining sizes of the data.
</p></dd></dl>

<dl>
<dt><a name="index-delete"></a><u>MGL command:</u> <b>delete</b><i> dat</i></dt>
<dd><p>Deletes the instance of class mglData.
</p></dd></dl>



<hr size="6">
<a name="Data-resizing"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Data-constructor" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-filling" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Data-resizing-1"></a>
<h2 class="section">4.3 Data resizing</h2>
<a name="index-Create"></a>
<a name="index-Rearrange"></a>
<a name="index-Extend"></a>
<a name="index-Transpose"></a>
<a name="index-Squeeze"></a>
<a name="index-Crop"></a>
<a name="index-Insert"></a>
<a name="index-Delete"></a>
<a name="index-Sort"></a>
<a name="index-Clean"></a>
<a name="index-Join"></a>

<dl>
<dt><a name="index-new-3"></a><u>MGL command:</u> <b>new</b><i> <small>DAT</small> [<code>nx=1 ny=1 nz=1</code>]</i></dt>
<dd><p>Creates or recreates the array with specified size and fills it by zero. This function does nothing if one of parameters <var>mx</var>, <var>my</var>, <var>mz</var> is zero or negative.
</p></dd></dl>

<p><a name="rearrange"></a>
</p><dl>
<dt><a name="index-rearrange"></a><u>MGL command:</u> <b>rearrange</b><i> dat <code>mx [my=0 mz=0]</code></i></dt>
<dd><p>Rearrange dimensions without changing data array so that resulting sizes should  be <var>mx</var>*<var>my</var>*<var>mz</var> &lt; nx*ny*nz. If some of parameter <var>my</var> or <var>mz</var> are zero then it will be selected to optimal fill of data array. For example, if <var>my</var>=0 then it will be change to <var>my</var>=nx*ny*nz/<var>mx</var> and <var>mz</var>=1.
</p></dd></dl>

<p><a name="transpose"></a>
</p><dl>
<dt><a name="index-transpose"></a><u>MGL command:</u> <b>transpose</b><i> dat ['dim'='yxz']</i></dt>
<dd><p>Transposes (shift order of) dimensions of the data. New order of dimensions is specified in string <var>dim</var>. This function can be useful also after reading of one-dimensional data.
</p></dd></dl>

<p><a name="extend"></a>
</p><dl>
<dt><a name="index-extend"></a><u>MGL command:</u> <b>extend</b><i> dat <code>n1 [n2=0]</code></i></dt>
<dd><p>Increase the dimensions of the data by inserting new (|<var>n1</var>|+1)-th slices after (for <var>n1</var>&gt;0) or before (for <var>n1</var>&lt;0) of existed one. It is possible to insert 2 dimensions simultaneously for 1d data by using parameter <var>n2</var>. Data to new slices is copy from existed one. For example, for <var>n1</var>&gt;0 new array will be
a_ij^new = a_i^old where j=0...<var>n1</var>. Correspondingly, for <var>n1</var>&lt;0 new array will be a_ij^new = a_j^old where i=0...|<var>n1</var>|.
</p></dd></dl>

<p><a name="squeeze"></a>
</p><dl>
<dt><a name="index-squeeze"></a><u>MGL command:</u> <b>squeeze</b><i> dat <code>rx [ry=1 rz=1 sm=off]</code></i></dt>
<dd><p>Reduces the data size by excluding data elements which indexes are not divisible by <var>rx</var>, <var>ry</var>, <var>rz</var> correspondingly. Parameter <var>smooth</var> set to use smoothing
(i.e. out[i]=\sum_{j=i,i+r} a[j]/r) or not (i.e. out[i]=a[j*r]).
</p></dd></dl>

<p><a name="crop"></a>
</p><dl>
<dt><a name="index-crop"></a><u>MGL command:</u> <b>crop</b><i> dat <code>n1 n2</code> 'dir'</i></dt>
<dd><p>Cuts off edges of the data <var>i</var>&lt;<var>n1</var> and <var>i</var>&gt;<var>n2</var> if <var>n2</var>&gt;0 or <var>i</var>&gt;<code>n[xyz]</code>-<var>n2</var> if <var>n2</var>&lt;=0 along direction <var>dir</var>.
</p></dd></dl>

<p><a name="insert"></a>
</p><dl>
<dt><a name="index-insert"></a><u>MGL command:</u> <b>insert</b><i> dat 'dir' <code>[pos=off num=0]</code></i></dt>
<dd><p>Insert <var>num</var> slices along <var>dir</var>-direction at position <var>pos</var> and fill it by zeros.
</p></dd></dl>

<p><a name="delete"></a>
</p><dl>
<dt><a name="index-delete-1"></a><u>MGL command:</u> <b>delete</b><i> dat 'dir' <code>[pos=off num=0]</code></i></dt>
<dd><p>Delete <var>num</var> slices along <var>dir</var>-direction at position <var>pos</var>.
</p></dd></dl>

<p><a name="sort"></a>
</p><dl>
<dt><a name="index-sort"></a><u>MGL command:</u> <b>sort</b><i> dat <code>idx [idy=-1]</code></i></dt>
<dd><p>Sort data rows (or slices in 3D case) by values of specified column <var>idx</var> (or cell {<var>idx</var>,<var>idy</var>} for 3D case). Note, this function is not thread safe!
</p></dd></dl>

<p><a name="clean"></a>
</p><dl>
<dt><a name="index-clean"></a><u>MGL command:</u> <b>clean</b><i> dat <code>idx</code></i></dt>
<dd><p>Delete rows which values are equal to next row for given column <var>idx</var>.
</p></dd></dl>

<p><a name="join"></a>
</p><dl>
<dt><a name="index-join"></a><u>MGL command:</u> <b>join</b><i> dat vdat</i></dt>
<dd><p>Join data cells from <var>vdat</var> to <var>dat</var>. At this, function increase <var>dat</var> sizes according following: z-size for 3D data arrays arrays with equal x-,y-sizes; or y-size for 2D data arrays with equal x-sizes; or x-size otherwise.
</p></dd></dl>



<hr size="6">
<a name="Data-filling"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Data-resizing" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#File-I_002fO" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Data-filling-1"></a>
<h2 class="section">4.4 Data filling</h2>
<a name="index-Fill-1"></a>
<a name="index-Modify"></a>
<a name="index-Set"></a>
<a name="index-List"></a>
<a name="index-Var"></a>

<p><a name="list"></a>
</p><dl>
<dt><a name="index-list"></a><u>MGL command:</u> <b>list</b><i> <small>DAT</small> <code>v1 ...</code></i></dt>
<dd><p>Creates new variable with name <var>dat</var> and fills it by numeric values of command arguments <code>v1 ...</code>. Command can create one-dimensional and two-dimensional arrays with arbitrary values. For creating 2d array the user should use delimiter &lsquo;<samp>|</samp>&rsquo; which means that the following values lie in next row. Array sizes are [maximal of row sizes * number of rows]. For example, command <code>list 1 | 2 3</code> creates the array [1 0; 2 3]. Note, that the maximal number of arguments is 1000.
</p></dd></dl>
<dl>
<dt><a name="index-list-1"></a><u>MGL command:</u> <b>list</b><i> <small>DAT</small> d1 ...</i></dt>
<dd><p>Creates new variable with name <var>dat</var> and fills it by data values of arrays of command arguments <var>d1 ...</var>. Command can create two-dimensional or three-dimensional (if arrays in arguments are 2d arrays) arrays with arbitrary values. Minor dimensions of all arrays in arguments should be equal to dimensions of first array d1. In the opposite case the argument will be ignored. Note, that the maximal number of arguments is 1000.
</p></dd></dl>


<p><a name="var"></a>
</p><dl>
<dt><a name="index-var"></a><u>MGL command:</u> <b>var</b><i> <small>DAT</small> <code>num v1 [v2=nan]</code></i></dt>
<dd><p>Creates new variable with name <var>dat</var> for one-dimensional array of size <var>num</var>. Array elements are equidistantly distributed in range [<var>v1</var>, <var>v2</var>]. If <var>v2</var>=<code>nan</code> then <var>v2=v1</var> is used.
</p></dd></dl>

<p><a name="fill"></a>
</p><dl>
<dt><a name="index-fill-3"></a><u>MGL command:</u> <b>fill</b><i> dat v1 v2 ['dir'='x']</i></dt>
<dd><p>Equidistantly fills the data values to range [<var>v1</var>, <var>v2</var>] in direction <var>dir</var>={&lsquo;<samp>x</samp>&rsquo;,&lsquo;<samp>y</samp>&rsquo;,&lsquo;<samp>z</samp>&rsquo;}.
</p></dd></dl>

<dl>
<dt><a name="index-fill-4"></a><u>MGL command:</u> <b>fill</b><i> dat 'eq'</i></dt>
<dt><a name="index-fill-5"></a><u>MGL command:</u> <b>fill</b><i> dat 'eq' vdat</i></dt>
<dt><a name="index-fill-6"></a><u>MGL command:</u> <b>fill</b><i> dat 'eq' vdat wdat</i></dt>
<dd><p>Fills the value of array according to the formula in string <var>eq</var>. Formula is an arbitrary expression depending  on variables &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo;, &lsquo;<samp>u</samp>&rsquo;, &lsquo;<samp>v</samp>&rsquo;, &lsquo;<samp>w</samp>&rsquo;. Coordinates &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo; are supposed to be normalized in axis range of canvas <var>gr</var> (in difference from <code>Modify</code> functions). Variable &lsquo;<samp>u</samp>&rsquo; is the original value of the array. Variables &lsquo;<samp>v</samp>&rsquo; and &lsquo;<samp>w</samp>&rsquo; are values of <var>vdat</var>, <var>wdat</var> which can be <code>NULL</code> (i.e. can be omitted).
</p></dd></dl>

<p><a name="modify"></a>
</p><dl>
<dt><a name="index-modify"></a><u>MGL command:</u> <b>modify</b><i> dat 'eq' [<code>dim=0</code>]</i></dt>
<dt><a name="index-modify-1"></a><u>MGL command:</u> <b>modify</b><i> dat 'eq' vdat</i></dt>
<dt><a name="index-modify-2"></a><u>MGL command:</u> <b>modify</b><i> dat 'eq' vdat wdat</i></dt>
<dd><p>The same as previous ones but coordinates &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo; are supposed to be normalized in range [0,1]. If <var>dim</var>&gt;0 is specified then modification will be fulfilled only for slices &gt;=<var>dim</var>.
</p></dd></dl>

<p><a name="fillsample"></a>
</p><dl>
<dt><a name="index-fillsample"></a><u>MGL command:</u> <b>fillsample</b><i> dat 'how'</i></dt>
<dd><p>Fills data by &rsquo;x&rsquo; or &rsquo;k&rsquo; samples for Hankel (&rsquo;h&rsquo;) or Fourier (&rsquo;f&rsquo;) transform.
</p></dd></dl>


<p><a name="datagrid"></a>
</p><dl>
<dt><a name="index-datagrid-1"></a><u>MGL command:</u> <b>datagrid</b><i> dat xdat ydat zdat</i></dt>
<dd><p>Fills the value of array according to the linear interpolation of triangulated surface, found for arbitrary placed points &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo;. NAN value is used for grid points placed outside of triangulated surface.
</p></dd></dl>


<p><a name="put"></a>
</p><dl>
<dt><a name="index-put"></a><u>MGL command:</u> <b>put</b><i> dat <code>val [i=: j=: k=:]</code></i></dt>
<dd><p>Sets value(s) of array a[<var>i</var>, <var>j</var>, <var>k</var>] = <var>val</var>. Negative indexes <var>i</var>, <var>j</var>, <var>k</var>=-1 set the value <var>val</var> to whole range in corresponding direction(s). For example, <code>Put(val,-1,0,-1);</code> sets a[i,0,j]=<var>val</var> for i=0...(nx-1), j=0...(nz-1).
</p></dd></dl>

<dl>
<dt><a name="index-put-1"></a><u>MGL command:</u> <b>put</b><i> dat vdat [<code>i=: j=: k=:</code>]</i></dt>
<dd><p>Copies value(s) from array <var>v</var> to the range of original array. Negative indexes <var>i</var>, <var>j</var>, <var>k</var>=-1 set the range in corresponding direction(s). At this minor dimensions of array <var>v</var> should be large than corresponding dimensions of this array. For example, <code>Put(v,-1,0,-1);</code> sets a[i,0,j]=v.ny&gt;nz ? v[i,j] : v[i], where i=0...(nx-1), j=0...(nz-1) and condition v.nx&gt;=nx is true.
</p></dd></dl>

<p><a name="idset"></a>
</p><dl>
<dt><a name="index-idset"></a><u>MGL command:</u> <b>idset</b><i> dat 'ids'</i></dt>
<dd><p>Sets the symbol <var>ids</var> for data columns. The string should contain one symbol &rsquo;a&rsquo;...&rsquo;z&rsquo; per column. These ids are used in <a href="#column">column</a>.
</p></dd></dl>



<hr size="6">
<a name="File-I_002fO"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Data-filling" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Make-another-data" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="File-I_002fO-1"></a>
<h2 class="section">4.5 File I/O</h2>
<a name="index-Read"></a>
<a name="index-ReadMat"></a>
<a name="index-ReadRange"></a>
<a name="index-ReadAll"></a>
<a name="index-Save"></a>
<a name="index-ReadHDF"></a>
<a name="index-SaveHDF"></a>
<a name="index-Import"></a>
<a name="index-Export"></a>

<p><a name="read"></a>
</p><dl>
<dt><a name="index-read-1"></a><u>MGL command:</u> <b>read</b><i> <small>DAT</small> 'fname'</i></dt>
<dd><p>Reads data from tab-separated text file with auto determining sizes of the data. Double newline means the beginning of new z-slice.
</p></dd></dl>

<dl>
<dt><a name="index-read-2"></a><u>MGL command:</u> <b>read</b><i> <small>DAT</small> 'fname' <code>mx [my=1 mz=1]</code></i></dt>
<dd><p>Reads data from text file with specified data sizes. This function does nothing if one of parameters <var>mx</var>, <var>my</var> or <var>mz</var> is zero or negative.
</p></dd></dl>

<p><a name="readmat"></a>
</p><dl>
<dt><a name="index-readmat"></a><u>MGL command:</u> <b>readmat</b><i> <small>DAT</small> 'fname' [<code>dim=2</code>]</i></dt>
<dd><p>Read data from text file with size specified at beginning of the file by first <var>dim</var> numbers. At this, variable <var>dim</var> set data dimensions.
</p></dd></dl>

<p><a name="readall"></a>
</p><dl>
<dt><a name="index-readall"></a><u>MGL command:</u> <b>readall</b><i> <small>DAT</small> 'templ' <code>v1 v2 [dv=1 slice=off]</code></i></dt>
<dd><p>Join data arrays from several text files. The file names are determined by function call <code>sprintf(fname,templ,val);</code>, where <var>val</var> changes from <var>from</var> to <var>to</var> with step <var>step</var>. The data load one-by-one in the same slice if <var>as_slice</var>=<code>false</code> or as slice-by-slice if <var>as_slice</var>=<code>true</code>.
</p></dd></dl>

<dl>
<dt><a name="index-readall-1"></a><u>MGL command:</u> <b>readall</b><i> <small>DAT</small> 'templ' <code>[slice=off]</code></i></dt>
<dd><p>Join data arrays from several text files which filenames satisfied the template <var>templ</var> (for example, <var>templ</var>=<code>&quot;t_*.dat&quot;</code>). The data load one-by-one in the same slice if <var>as_slice</var>=<code>false</code> or as slice-by-slice if <var>as_slice</var>=<code>true</code>.
</p></dd></dl>

<p><a name="save"></a>
</p><dl>
<dt><a name="index-save"></a><u>MGL command:</u> <b>save</b><i> dat 'fname'</i></dt>
<dd><p>Saves the whole data array (for <var>ns</var>=<code>-1</code>) or only <var>ns</var>-th slice to text file.
</p></dd></dl>

<p><a name="readhdf"></a>
</p><dl>
<dt><a name="index-readhdf"></a><u>MGL command:</u> <b>readhdf</b><i> <small>DAT</small> 'fname' 'dname'</i></dt>
<dd><p>Reads data array named <var>dname</var> from HDF5 or HDF4 file. This function does nothing if HDF5|HDF4 was disabled during library compilation.
</p></dd></dl>

<p><a name="savehdf"></a>
</p><dl>
<dt><a name="index-savehdf"></a><u>MGL command:</u> <b>savehdf</b><i> dat 'fname' 'dname'</i></dt>
<dd><p>Saves data array named <var>dname</var> to HDF5 file. This function does nothing if HDF5 was disabled during library compilation.
</p></dd></dl>

<p><a name="datas"></a>
</p><dl>
<dt><a name="index-datas"></a><u>MGL command:</u> <b>datas</b><i> 'fname'</i></dt>
<dd><p>Put data names from HDF5 file <var>fname</var> into <var>buf</var> as &rsquo;\t&rsquo; separated fields. In MGL version the list of data names will be printed as message. This function does nothing if HDF5 was disabled during library compilation.
</p></dd></dl>

<p><a name="import"></a>
</p><dl>
<dt><a name="index-import"></a><u>MGL command:</u> <b>import</b><i> <small>DAT</small> 'fname' 'sch' [<code>v1=0 v2=1</code>]</i></dt>
<dd><p>Reads data from bitmap file (now support only PNG format). The RGB values of bitmap pixels are transformed to mreal values in range [<var>v1</var>, <var>v2</var>] using color scheme <var>scheme</var> (see section <a href="#Color-scheme">Color scheme</a>).
</p></dd></dl>

<p><a name="export"></a>
</p><dl>
<dt><a name="index-export"></a><u>MGL command:</u> <b>export</b><i> dat 'fname' 'sch' [<code>v1=0 v2=0</code>]</i></dt>
<dd><p>Saves data matrix (or <code>ns</code>-th slice for 3d data) to bitmap file (now support only PNG format). The data values are transformed from range [<var>v1</var>, <var>v2</var>] to RGB pixels of bitmap using color scheme <var>scheme</var> (see section <a href="#Color-scheme">Color scheme</a>). If <var>v1</var>&gt;=<var>v2</var> then the values of <var>v1</var>, <var>v2</var> are automatically determined as minimal and maximal value of the data array.
</p></dd></dl>


<hr size="6">
<a name="Make-another-data"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#File-I_002fO" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-changing" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Make-another-data-1"></a>
<h2 class="section">4.6 Make another data</h2>
<a name="index-SubData"></a>
<a name="index-Column"></a>
<a name="index-Trace"></a>
<a name="index-Hist-1"></a>
<a name="index-Resize"></a>
<a name="index-Evaluate"></a>
<a name="index-Combine"></a>
<a name="index-Momentum"></a>
<a name="index-Sum"></a>
<a name="index-Min"></a>
<a name="index-Max"></a>
<a name="index-Roots"></a>

<p><a name="subdata"></a>
</p><dl>
<dt><a name="index-subdata"></a><u>MGL command:</u> <b>subdata</b><i> <small>RES</small> dat <code>xx [yy=: zz=:]</code></i></dt>
<dd><p>Extracts sub-array data from the original data array keeping fixed positive index. For example <code>SubData(-1,2)</code> extracts 3d row (indexes are zero based), <code>SubData(4,-1)</code> extracts 5th column, <code>SubData(-1,-1,3)</code> extracts 4th slice and so on. If argument(s) are non-integer then linear interpolation between slices is used. In MGL version this command usually is used as inline one <code>dat(xx,yy,zz)</code>.
</p></dd></dl>

<dl>
<dt><a name="index-subdata-1"></a><u>MGL command:</u> <b>subdata</b><i> <small>RES</small> dat xdat [ydat=: zdat=:]</i></dt>
<dd><p>Extracts sub-array data from the original data array for indexes specified by arrays <var>xx</var>, <var>yy</var>, <var>zz</var> (indirect access). This function work like previous one for 1D arguments or numbers, and resulting array dimensions are equal dimensions of 1D arrays for corresponding direction. For 2D and 3D arrays in arguments, the resulting array have the same dimensions as input arrays. The dimensions of all argument must be the same (or to be scalar 1*1*1) if they are 2D or 3D arrays. In MGL version this command usually is used as inline one <code>dat(xx,yy,zz)</code>.
</p></dd></dl>

<p><a name="column"></a>
</p><dl>
<dt><a name="index-column"></a><u>MGL command:</u> <b>column</b><i> <small>RES</small> dat 'eq'</i></dt>
<dd><p>Get column (or slice) of the data filled by formula <var>eq</var> on column ids. For example, <code>Column(&quot;n*w^2/exp(t)&quot;);</code>. The column ids must be defined first by <a href="#idset">idset</a> function or read from files. In MGL version this command usually is used as inline one <code>dat('eq')</code>.
</p></dd></dl>

<p><a name="resize"></a>
</p><dl>
<dt><a name="index-resize"></a><u>MGL command:</u> <b>resize</b><i> <small>RES</small> dat <code>mx [my=1 mz=1]</code></i></dt>
<dd><p>Resizes the data to new size <var>mx</var>, <var>my</var>, <var>mz</var> from box (part) [<var>x1</var>,<var>x2</var>] x [<var>y1</var>,<var>y2</var>] x [<var>z1</var>,<var>z2</var>] of original array. Initially x,y,z coordinates are supposed to be in [0,1].
</p></dd></dl>

<p><a name="evaluate"></a>
</p><dl>
<dt><a name="index-evaluate"></a><u>MGL command:</u> <b>evaluate</b><i> <small>RES</small> dat idat [<code>norm=on</code>]</i></dt>
<dt><a name="index-evaluate-1"></a><u>MGL command:</u> <b>evaluate</b><i> <small>RES</small> dat idat jdat [<code>norm=on</code>]</i></dt>
<dt><a name="index-evaluate-2"></a><u>MGL command:</u> <b>evaluate</b><i> <small>RES</small> dat idat jdat kdat [<code>norm=on</code>]</i></dt>
<dd><p>Gets array which values is result of interpolation of original array for coordinates from other arrays. All dimensions must be the same for data <var>idat</var>, <var>jdat</var>, <var>kdat</var>. Coordinates from <var>idat</var>, <var>jdat</var>, <var>kdat</var> are supposed to be normalized in range [0,1] (if <var>norm</var>=<code>true</code>) or in ranges [0,nx], [0,ny], [0,nz] correspondingly.
</p></dd></dl>

<p><a name="solve"></a>
</p><dl>
<dt><a name="index-solve"></a><u>MGL command:</u> <b>solve</b><i> <small>RES</small> dat <code>val</code> 'dir' [<code>norm=on</code>]</i></dt>
<dt><a name="index-solve-1"></a><u>MGL command:</u> <b>solve</b><i> <small>RES</small> dat <code>val</code> 'dir' idat [<code>norm=on</code>]</i></dt>
<dd><p>Gets array which values is indexes (roots) along given direction <var>dir</var>, where interpolated values of data <var>dat</var> are equal to <var>val</var>. Output data will have the sizes of <var>dat</var> in directions transverse to <var>dir</var>. If data <var>idat</var> is provided then its values are used as starting points. This allows to find several branches by consequentive calls. Indexes are supposed to be normalized in range [0,1] (if <var>norm</var>=<code>true</code>) or in ranges [0,nx], [0,ny], [0,nz] correspondingly. See <a href="#Solve-sample">Solve sample</a>, for sample code and picture.
</p></dd></dl>

<p><a name="hist"></a>
</p><dl>
<dt><a name="index-hist-3"></a><u>MGL command:</u> <b>hist</b><i> <small>RES</small> dat <code>num v1 v2 [nsub=0]</code></i></dt>
<dt><a name="index-hist-4"></a><u>MGL command:</u> <b>hist</b><i> <small>RES</small> dat wdat <code>num v1 v2 [nsub=0]</code></i></dt>
<dd><p>Creates <var>n</var>-th points distribution of the data values in range [<var>v1</var>, <var>v2</var>]. Array <var>w</var> specifies weights of the data elements (by default is 1). Parameter <var>nsub</var> define the number of additional interpolated points (for smoothness of histogram). See also <a href="#Data-manipulation">Data manipulation</a>
</p></dd></dl>

<p><a name="momentum"></a>
</p><dl>
<dt><a name="index-momentum"></a><u>MGL command:</u> <b>momentum</b><i> <small>RES</small> dat 'how' ['dir'='z']</i></dt>
<dd><p>Gets momentum (1d-array) of the data along direction <var>dir</var>. String <var>how</var> contain kind of momentum. The momentum is defined like as
res_k = \sum_ij how(x_i,y_j,z_k) a_ij/ \sum_ij a_ij
if <var>dir</var>=&lsquo;<samp>z</samp>&rsquo; and so on. Coordinates &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo; are data indexes normalized in range [0,1].
</p></dd></dl>

<p><a name="sum"></a>
</p><dl>
<dt><a name="index-sum"></a><u>MGL command:</u> <b>sum</b><i> <small>RES</small> dat 'dir'</i></dt>
<dd><p>Gets array which is the result of summation in given direction or direction(s).
</p></dd></dl>

<p><a name="max"></a>
</p><dl>
<dt><a name="index-max"></a><u>MGL command:</u> <b>max</b><i> <small>RES</small> dat 'dir'</i></dt>
<dd><p>Gets array which is the maximal data values in given direction or direction(s).
</p></dd></dl>

<p><a name="min"></a>
</p><dl>
<dt><a name="index-min"></a><u>MGL command:</u> <b>min</b><i> <small>RES</small> dat 'dir'</i></dt>
<dd><p>Gets array which is the maximal data values in given direction or direction(s).
</p></dd></dl>

<p><a name="combine"></a>
</p><dl>
<dt><a name="index-combine"></a><u>MGL command:</u> <b>combine</b><i> <small>RES</small> adat bdat</i></dt>
<dd><p>Returns direct multiplication of arrays (like, res[i,j] = this[i]*a[j] and so on).
</p></dd></dl>

<p><a name="trace"></a>
</p><dl>
<dt><a name="index-trace"></a><u>MGL command:</u> <b>trace</b><i> <small>RES</small> dat</i></dt>
<dd><p>Gets array of diagonal elements a[i,i] (for 2D case) or a[i,i,i] (for 3D case) where i=0...nx-1. Function return copy of itself for 1D case. Data array must have dimensions ny,nz &gt;= nx or ny,nz = 1.
</p></dd></dl>


<p><a name="roots"></a>
</p><dl>
<dt><a name="index-roots"></a><u>MGL command:</u> <b>roots</b><i> <small>RES</small> 'func' ini ['var'='x']</i></dt>
<dt><a name="index-roots-1"></a><u>MGL command:</u> <b>roots</b><i> <small>RES</small> 'func' <code>ini</code> ['var'='x']</i></dt>
<dd><p>Find roots of equation &rsquo;func&rsquo;=0 for variable <var>var</var> with initial guess <var>ini</var>. Secant method is used for root finding.
</p></dd></dl>


<hr size="6">
<a name="Data-changing"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Make-another-data" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Interpolation" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Data-changing-1"></a>
<h2 class="section">4.7 Data changing</h2>
<a name="index-CumSum"></a>
<a name="index-Integral"></a>
<a name="index-Diff"></a>
<a name="index-Diff2"></a>
<a name="index-SinFFT"></a>
<a name="index-CosFFT"></a>
<a name="index-Hankel"></a>
<a name="index-Swap"></a>
<a name="index-Roll"></a>
<a name="index-Mirror"></a>
<a name="index-Sew"></a>
<a name="index-Smooth"></a>
<a name="index-Envelop"></a>
<a name="index-Norm"></a>
<a name="index-NormSl"></a>

<p>These functions change the data in some direction like differentiations, integrations and so on. The direction in which the change will applied is specified by the string parameter, which may contain &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo; or &lsquo;<samp>z</samp>&rsquo; characters for 1-st, 2-nd and 3-d dimension correspondingly.
</p>
<p><a name="cumsum"></a>
</p><dl>
<dt><a name="index-cumsum"></a><u>MGL command:</u> <b>cumsum</b><i> dat 'dir'</i></dt>
<dd><p>Cumulative summation of the data in given direction or directions.
</p></dd></dl>

<p><a name="integrate"></a>
</p><dl>
<dt><a name="index-integrate"></a><u>MGL command:</u> <b>integrate</b><i> dat 'dir'</i></dt>
<dd><p>Integrates (like cumulative summation) the data in given direction or directions.
</p></dd></dl>

<p><a name="diff"></a>
</p><dl>
<dt><a name="index-diff"></a><u>MGL command:</u> <b>diff</b><i> dat 'dir'</i></dt>
<dd><p>Differentiates the data in given direction or directions.
</p></dd></dl>

<dl>
<dt><a name="index-diff-1"></a><u>MGL command:</u> <b>diff</b><i> dat xdat ydat [zdat=0]</i></dt>
<dd><p>Differentiates the data specified parametrically in direction <var>x</var> with <var>y</var>, <var>z</var>=constant. Parametrical differentiation uses the formula (for 2D case): <em>da/dx = (a_j*y_i-a_i*y_j)/(x_j*y_i-x_i*y_j)</em> where <em>a_i=da/di, a_j=da/dj</em> denotes usual differentiation along 1st and 2nd dimensions. The similar formula is used for 3D case. Note, that you may change the order of arguments &ndash; for example, if you have 2D data a(i,j) which depend on coordinates {x(i,j), y(i,j)} then usual derivative along &lsquo;<samp>x</samp>&rsquo; will be <code>Diff(x,y);</code> and usual derivative along &lsquo;<samp>y</samp>&rsquo; will be <code>Diff(y,x);</code>.
</p></dd></dl>

<p><a name="diff2"></a>
</p><dl>
<dt><a name="index-diff2"></a><u>MGL command:</u> <b>diff2</b><i> dat 'dir'</i></dt>
<dd><p>Double-differentiates (like Laplace operator) the data in given direction.
</p></dd></dl>

<p><a name="sinfft"></a>
</p><dl>
<dt><a name="index-sinfft"></a><u>MGL command:</u> <b>sinfft</b><i> dat 'dir'</i></dt>
<dd><p>Do Sine transform of the data in given direction or directions. The Sine transform is <em>\sum a_j \sin(k j)</em> (see <a href="http://en.wikipedia.org/wiki/Discrete_sine_transform#DST-I">http://en.wikipedia.org/wiki/Discrete_sine_transform#DST-I</a>).
</p></dd></dl>

<p><a name="cosfft"></a>
</p><dl>
<dt><a name="index-cosfft"></a><u>MGL command:</u> <b>cosfft</b><i> dat 'dir'</i></dt>
<dd><p>Do Cosine transform of the data in given direction or directions. The Cosine transform is <em>\sum a_j \cos(k j)</em> (see <a href="http://en.wikipedia.org/wiki/Discrete_cosine_transform#DCT-I">http://en.wikipedia.org/wiki/Discrete_cosine_transform#DCT-I</a>).
</p></dd></dl>


<p><a name="hankel"></a>
</p><dl>
<dt><a name="index-hankel"></a><u>MGL command:</u> <b>hankel</b><i> dat 'dir'</i></dt>
<dd><p>Do Hankel transform of the data in given direction or directions. The Hankel transform is <em>\sum a_j J_0(k j)</em> (see <a href="http://en.wikipedia.org/wiki/Hankel_transform">http://en.wikipedia.org/wiki/Hankel_transform</a>).
</p></dd></dl>

<p><a name="swap"></a>
</p><dl>
<dt><a name="index-swap"></a><u>MGL command:</u> <b>swap</b><i> dat 'dir'</i></dt>
<dd><p>Swaps the left and right part of the data in given direction (useful for Fourier spectrum).
</p></dd></dl>

<p><a name="roll"></a>
</p><dl>
<dt><a name="index-roll"></a><u>MGL command:</u> <b>roll</b><i> dat 'dir' num</i></dt>
<dd><p>Rolls the data along direction <var>dir</var>. Resulting array will be out[i] = ini[(i+<var>num</var>)%nx] if <code>dir='x'</code>.
</p></dd></dl>

<p><a name="mirror"></a>
</p><dl>
<dt><a name="index-mirror"></a><u>MGL command:</u> <b>mirror</b><i> dat 'dir'</i></dt>
<dd><p>Mirror the left-to-right part of the data in given direction. Looks like change the value index <var>i</var>-&gt;<var>n-i</var>. Note, that the similar effect in graphics you can reach by using options (see section <a href="#Command-options">Command options</a>), for example, <code>surf dat; xrange 1 -1</code>.
</p></dd></dl>

<p><a name="sew"></a>
</p><dl>
<dt><a name="index-sew"></a><u>MGL command:</u> <b>sew</b><i> dat ['dir'='xyz' <code>da=2*pi</code>]</i></dt>
<dd><p>Remove value steps (like phase jumps after inverse trigonometric functions) with period <var>da</var> in given direction.
</p></dd></dl>

<p><a name="smooth"></a>
</p><dl>
<dt><a name="index-smooth"></a><u>MGL command:</u> <b>smooth</b><i> data <code>type</code> ['dir'='xyz']</i></dt>
<dd><p>Smooths the data on specified direction or directions. String <var>dirs</var> specifies the dimensions which will be smoothed. It may contain characters: &lsquo;<samp>x</samp>&rsquo; for 1st dimension, &lsquo;<samp>y</samp>&rsquo; for 2nd dimension, &lsquo;<samp>z</samp>&rsquo; for 3d dimension. If string <var>dir</var> contain: &lsquo;<samp>0</samp>&rsquo; then does nothing, &lsquo;<samp>3</samp>&rsquo; &ndash; linear averaging over 3 points, &lsquo;<samp>5</samp>&rsquo; &ndash; linear averaging over 5 points. By default quadratic averaging over 5 points is used.
</p></dd></dl>

<p><a name="envelop"></a>
</p><dl>
<dt><a name="index-envelop"></a><u>MGL command:</u> <b>envelop</b><i> dat ['dir'='x']</i></dt>
<dd><p>Find envelop for data values along direction <var>dir</var>.
</p></dd></dl>

<p><a name="norm"></a>
</p><dl>
<dt><a name="index-norm"></a><u>MGL command:</u> <b>norm</b><i> dat <code>v1 v2 [sym=off dim=0]</code></i></dt>
<dd><p>Normalizes the data to range [<var>v1</var>,<var>v2</var>]. If flag <var>sym</var>=<code>true</code> then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. Modification will be applied only for slices &gt;=<var>dim</var>.
</p></dd></dl>

<p><a name="normsl"></a>
</p><dl>
<dt><a name="index-normsl"></a><u>MGL command:</u> <b>normsl</b><i> dat <code>v1 v2</code> ['dir'='z' <code>keep=on sym=off</code>]</i></dt>
<dd><p>Normalizes data slice-by-slice along direction <var>dir</var> the data in slices to range [<var>v1</var>,<var>v2</var>]. If flag <var>sym</var>=<code>true</code> then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. If <var>keep_en</var> is set then maximal value of k-th slice will be limited by
<em>\sqrt\sum a_ij(k)/\sum a_ij(0)</em>.
</p></dd></dl>


<hr size="6">
<a name="Interpolation"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Data-changing" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-information" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Interpolation-1"></a>
<h2 class="section">4.8 Interpolation</h2>

<p>MGL scripts can use linear interpolation by <a href="#subdata">subdata</a> command, or spline interpolation by <a href="#evaluate">evaluate</a> command. Also you can use <a href="#resize">resize</a> for obtaining a data array with new sizes.
</p>


<hr size="6">
<a name="Data-information"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Interpolation" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Operators" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Data-information-1"></a>
<h2 class="section">4.9 Data information</h2>

<p>There are a set of functions for obtaining data properties in MGL language. However most of them can be found using &quot;suffixes&quot;. Suffix can get some numerical value of the data array (like its size, maximal or minimal value, the sum of elements and so on) as number. Later it can be used as usual number in command arguments. The suffixes start from point &lsquo;<samp>.</samp>&rsquo; right after (without spaces) variable name or its sub-array. For example, <code>a.nx</code> give the x-size of data <var>a</var>, <code>b(1).max</code> give maximal value of second row of variable <var>b</var>, <code>(c(:,0)^2).sum</code> give the sum of squares of elements in the first column of <var>c</var> and so on.
</p>

<a name="index-PrintInfo"></a>
<p><a name="info"></a>
</p><dl>
<dt><a name="index-info"></a><u>MGL command:</u> <b>info</b><i> dat</i></dt>
<dd><p>Gets or prints to file <var>fp</var> or as message (in MGL) information about the data (sizes, maximum/minimum, momentums and so on).
</p></dd></dl>

<dl>
<dt><a name="index-info-1"></a><u>MGL command:</u> <b>info</b><i> 'txt'</i></dt>
<dd><p>Prints string <var>txt</var> as message.
</p></dd></dl>

<dl>
<dt><a name="index-info-2"></a><u>MGL command:</u> <b>info</b><i> val</i></dt>
<dd><p>Prints value of number <var>val</var> as message.
</p></dd></dl>

<a name="index-GetNx"></a>
<a name="index-GetNy"></a>
<a name="index-GetNz"></a>
<p><a name="g_t_002enx"></a> <a name="g_t_002eny"></a> <a name="g_t_002enz"></a>
</p><dl>
<dt><a name="index-_002enx"></a><u>MGL suffix:</u> (dat) <b>.nx</b></dt>
<dt><a name="index-_002eny"></a><u>MGL suffix:</u> (dat) <b>.ny</b></dt>
<dt><a name="index-_002enz"></a><u>MGL suffix:</u> (dat) <b>.nz</b></dt>
<dd><p>Gets the x-, y-, z-size of the data.
</p></dd></dl>



<a name="index-Maximal"></a>
<p><a name="g_t_002emax"></a>
</p><dl>
<dt><a name="index-_002emax"></a><u>MGL suffix:</u> (dat) <b>.max</b></dt>
<dd><p>Gets maximal value of the data.
</p></dd></dl>

<a name="index-Minimal"></a>
<p><a name="g_t_002emin"></a>
</p><dl>
<dt><a name="index-_002emin"></a><u>MGL suffix:</u> (dat) <b>.min</b></dt>
<dd><p>Gets minimal value of the data.
</p></dd></dl>


<p><a name="g_t_002emx"></a> <a name="g_t_002emy"></a> <a name="g_t_002emz"></a>
</p><dl>
<dt><a name="index-_002emx"></a><u>MGL suffix:</u> (dat) <b>.mx</b></dt>
<dt><a name="index-_002emy"></a><u>MGL suffix:</u> (dat) <b>.my</b></dt>
<dt><a name="index-_002emz"></a><u>MGL suffix:</u> (dat) <b>.mz</b></dt>
<dd><p>Gets approximated (interpolated) position of maximum to variables <var>x</var>, <var>y</var>, <var>z</var> and returns the maximal value.
</p></dd></dl>


<a name="index-Momentum-1"></a>
<p><a name="g_t_002eax"></a> <a name="g_t_002eay"></a> <a name="g_t_002eaz"></a> <a name="g_t_002eaa"></a> <a name="g_t_002esum"></a>
<a name="g_t_002ewx"></a> <a name="g_t_002ewy"></a> <a name="g_t_002ewz"></a> <a name="g_t_002ewa"></a>
<a name="g_t_002esx"></a> <a name="g_t_002esy"></a> <a name="g_t_002esz"></a> <a name="g_t_002esa"></a>
<a name="g_t_002ekx"></a> <a name="g_t_002eky"></a> <a name="g_t_002ekz"></a> <a name="g_t_002eka"></a>
</p><dl>
<dt><a name="index-_002esum"></a><u>MGL suffix:</u> (dat) <b>.sum</b></dt>
<dt><a name="index-_002eax"></a><u>MGL suffix:</u> (dat) <b>.ax</b></dt>
<dt><a name="index-_002eay"></a><u>MGL suffix:</u> (dat) <b>.ay</b></dt>
<dt><a name="index-_002eaz"></a><u>MGL suffix:</u> (dat) <b>.az</b></dt>
<dt><a name="index-_002eaa"></a><u>MGL suffix:</u> (dat) <b>.aa</b></dt>
<dt><a name="index-_002ewx"></a><u>MGL suffix:</u> (dat) <b>.wx</b></dt>
<dt><a name="index-_002ewy"></a><u>MGL suffix:</u> (dat) <b>.wy</b></dt>
<dt><a name="index-_002ewz"></a><u>MGL suffix:</u> (dat) <b>.wz</b></dt>
<dt><a name="index-_002ewa"></a><u>MGL suffix:</u> (dat) <b>.wa</b></dt>
<dt><a name="index-_002esx"></a><u>MGL suffix:</u> (dat) <b>.sx</b></dt>
<dt><a name="index-_002esy"></a><u>MGL suffix:</u> (dat) <b>.sy</b></dt>
<dt><a name="index-_002esz"></a><u>MGL suffix:</u> (dat) <b>.sz</b></dt>
<dt><a name="index-_002esa"></a><u>MGL suffix:</u> (dat) <b>.sa</b></dt>
<dt><a name="index-_002ekx"></a><u>MGL suffix:</u> (dat) <b>.kx</b></dt>
<dt><a name="index-_002eky"></a><u>MGL suffix:</u> (dat) <b>.ky</b></dt>
<dt><a name="index-_002ekz"></a><u>MGL suffix:</u> (dat) <b>.kz</b></dt>
<dt><a name="index-_002eka"></a><u>MGL suffix:</u> (dat) <b>.ka</b></dt>
<dd><p>Gets zero-momentum (energy, <em>I=\sum dat_i</em>) and write first momentum (median, <em>a = \sum \xi_i dat_i/I</em>), second momentum (width, <em>w^2 = \sum (\xi_i-a)^2 dat_i/I</em>), third momentum (skewness, <em>s = \sum (\xi_i-a)^3 dat_i/ I w^3</em>) and fourth momentum (kurtosis, <em>k = \sum (\xi_i-a)^4 dat_i / 3 I w^4</em>) to variables. Here <em>\xi</em> is corresponding coordinate if <var>dir</var> is &lsquo;<samp>'x'</samp>&rsquo;, &lsquo;<samp>'y'</samp>&rsquo; or &lsquo;<samp>'z'</samp>&rsquo;. Otherwise median is <em>a = \sum dat_i/N</em>, width is <em>w^2 = \sum (dat_i-a)^2/N</em> and so on.
</p></dd></dl>

<p><a name="g_t_002efst"></a>
</p><dl>
<dt><a name="index-_002efst"></a><u>MGL suffix:</u> (dat) <b>.fst</b></dt>
<dd><p>Find position (after specified in <var>i</var>, <var>j</var>, <var>k</var>) of first nonzero value of formula <var>cond</var>. Function return the data value at found position.
</p></dd></dl>

<p><a name="g_t_002elst"></a>
</p><dl>
<dt><a name="index-_002elst"></a><u>MGL suffix:</u> (dat) <b>.lst</b></dt>
<dd><p>Find position (before specified in <var>i</var>, <var>j</var>, <var>k</var>) of last nonzero value of formula <var>cond</var>. Function return the data value at found position.
</p></dd></dl>


<p><a name="g_t_002ea"></a>
</p><dl>
<dt><a name="index-_002ea"></a><u>MGL suffix:</u> (dat) <b>.a</b></dt>
<dd><p>Give first (for <code>.a</code>, i.e. <code>dat-&gt;a[0]</code>).
</p></dd></dl>



<hr size="6">
<a name="Operators"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Data-information" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Global-functions" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Operators-1"></a>
<h2 class="section">4.10 Operators</h2>

<dl>
<dt><a name="index-copy-2"></a><u>MGL command:</u> <b>copy</b><i> <small>DAT</small> dat2 ['eq'='']</i></dt>
<dd><p>Copies data from other variable.
</p></dd></dl>

<dl>
<dt><a name="index-copy-3"></a><u>MGL command:</u> <b>copy</b><i> dat <code>val</code></i></dt>
<dd><p>Set all data values equal to <var>val</var>.
</p></dd></dl>

<p><a name="multo"></a>
</p><dl>
<dt><a name="index-multo"></a><u>MGL command:</u> <b>multo</b><i> dat dat2</i></dt>
<dt><a name="index-multo-1"></a><u>MGL command:</u> <b>multo</b><i> dat <code>val</code></i></dt>
<dd><p>Multiplies data element by the other one or by value.
</p></dd></dl>

<p><a name="divto"></a>
</p><dl>
<dt><a name="index-divto"></a><u>MGL command:</u> <b>divto</b><i> dat dat2</i></dt>
<dt><a name="index-divto-1"></a><u>MGL command:</u> <b>divto</b><i> dat <code>val</code></i></dt>
<dd><p>Divides each data element by the other one or by value.
</p></dd></dl>

<p><a name="addto"></a>
</p><dl>
<dt><a name="index-addto"></a><u>MGL command:</u> <b>addto</b><i> dat dat2</i></dt>
<dt><a name="index-addto-1"></a><u>MGL command:</u> <b>addto</b><i> dat <code>val</code></i></dt>
<dd><p>Adds to each data element the other one or the value.
</p></dd></dl>

<p><a name="subto"></a>
</p><dl>
<dt><a name="index-subto"></a><u>MGL command:</u> <b>subto</b><i> dat dat2</i></dt>
<dt><a name="index-subto-1"></a><u>MGL command:</u> <b>subto</b><i> dat <code>val</code></i></dt>
<dd><p>Subtracts from each data element the other one or the value.
</p></dd></dl>



<hr size="6">
<a name="Global-functions"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Operators" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Evaluate-expression" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Global-functions-1"></a>
<h2 class="section">4.11 Global functions</h2>


<p><a name="transform"></a>
</p><dl>
<dt><a name="index-transform"></a><u>MGL command:</u> <b>transform</b><i> <small>DAT</small> 'type' real imag</i></dt>
<dd><p>Does integral transformation of complex data <var>real</var>, <var>imag</var> on specified direction. The order of transformations is specified in string <var>type</var>: first character for x-dimension, second one for y-dimension, third one for z-dimension. The possible character are: &lsquo;<samp>f</samp>&rsquo; is forward Fourier transformation, &lsquo;<samp>i</samp>&rsquo; is inverse Fourier transformation, &lsquo;<samp>s</samp>&rsquo; is Sine transform, &lsquo;<samp>c</samp>&rsquo; is Cosine transform, &lsquo;<samp>h</samp>&rsquo; is Hankel transform, &lsquo;<samp>n</samp>&rsquo; or &lsquo;<samp> </samp>&rsquo; is no transformation.
</p></dd></dl>

<p><a name="transforma"></a>
</p><dl>
<dt><a name="index-transforma"></a><u>MGL command:</u> <b>transforma</b><i> <small>DAT</small> 'type' ampl phase</i></dt>
<dd><p>The same as previous but with specified amplitude <var>ampl</var> and phase <var>phase</var> of complex numbers.
</p></dd></dl>

<p><a name="fourier"></a>
</p><dl>
<dt><a name="index-fourier"></a><u>MGL command:</u> <b>fourier</b><i> reDat imDat 'dir'</i></dt>
<dd><p>Does Fourier transform of complex data <var>re</var>+i*<var>im</var> in directions <var>dir</var>. Result is placed back into <var>re</var> and <var>im</var> data arrays.
</p></dd></dl>

<p><a name="stfad"></a>
</p><dl>
<dt><a name="index-stfad"></a><u>MGL command:</u> <b>stfad</b><i> <small>RES</small> real imag <code>dn</code> ['dir'='x']</i></dt>
<dd><p>Short time Fourier transformation for real and imaginary parts. Output  is amplitude of partial Fourier of length <var>dn</var>. For example if <var>dir</var>=&lsquo;<samp>x</samp>&rsquo;, result will have size {int(nx/dn), dn, ny} and it will contain <em>res[i,j,k]=|\sum_d^dn exp(I*j*d)*(real[i*dn+d,k]+I*imag[i*dn+d,k])|/dn</em>.
</p></dd></dl>

<p><a name="pde"></a>
</p><dl>
<dt><a name="index-pde-1"></a><u>MGL command:</u> <b>pde</b><i> <small>RES</small> 'ham' ini_re ini_im [<code>dz=0.1 k0=100</code>]</i></dt>
<dd><p>Solves equation du/dz = i*k0*<var>ham</var>(p,q,x,y,z,|u|)[u], where p=-i/k0*d/dx, q=-i/k0*d/dy are pseudo-differential operators. Parameters <var>ini_re</var>, <var>ini_im</var> specify real and imaginary part of initial field distribution. Parameters <var>Min</var>, <var>Max</var> set the bounding box for the solution. Note, that really this ranges are increased by factor 3/2 for purpose of reducing reflection from boundaries. Parameter <var>dz</var> set the step along evolutionary coordinate z. At this moment, simplified form of function <var>ham</var> is supported &ndash; all &ldquo;mixed&rdquo; terms (like &lsquo;<samp>x*p</samp>&rsquo;-&gt;x*d/dx) are excluded. For example, in 2D case this function is effectively <em>ham = f(p,z) + g(x,z,u)</em>. However commutable combinations (like &lsquo;<samp>x*q</samp>&rsquo;-&gt;x*d/dy) are allowed. Here variable &lsquo;<samp>u</samp>&rsquo; is used for field amplitude |u|. This allow one solve nonlinear problems &ndash; for example, for nonlinear Shrodinger equation you may set <code>ham=&quot;p^2 + q^2 - u^2&quot;</code>. You may specify imaginary part for wave absorption, like <code>ham = &quot;p^2 + i*x*(x&gt;0)&quot;</code>, but only if dependence on variable &lsquo;<samp>i</samp>&rsquo; is linear (i.e. <em>ham = hre+i*him</em>). See section <a href="#PDE-solving-hints">PDE solving hints</a>, for sample code and picture.
</p></dd></dl>

<p><a name="ray"></a>
</p><dl>
<dt><a name="index-ray"></a><u>MGL command:</u> <b>ray</b><i> <small>RES</small> 'ham' <code>x0 y0 z0 p0 q0 v0 [dt=0.1 tmax=10]</code></i></dt>
<dd><p>Solves GO ray equation like dr/dt = d <var>ham</var>/dp, dp/dt = -d <var>ham</var>/dr. This is Hamiltonian equations for particle trajectory in 3D case. Here <var>ham</var> is Hamiltonian which may depend on coordinates &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo;, momentums &lsquo;<samp>p</samp>&rsquo;=px, &lsquo;<samp>q</samp>&rsquo;=py, &lsquo;<samp>v</samp>&rsquo;=pz and time &lsquo;<samp>t</samp>&rsquo;: <em>ham = H(x,y,z,p,q,v,t)</em>. The starting point (at <code>t=0</code>) is defined by variables <var>r0</var>, <var>p0</var>. Parameters <var>dt</var> and <var>tmax</var> specify the integration step and maximal time for ray tracing. Result is array of {x,y,z,p,q,v,t} with dimensions {7 * int(<var>tmax</var>/<var>dt</var>+1) }.
</p></dd></dl>

<p><a name="qo2d"></a>
</p><dl>
<dt><a name="index-qo2d"></a><u>MGL command:</u> <b>qo2d</b><i> <small>RES</small> 'ham' ini_re ini_im ray [<code>r=1 k0=100</code> xx yy]</i></dt>
<dd><p>Solves equation du/dt = i*k0*<var>ham</var>(p,q,x,y,|u|)[u], where p=-i/k0*d/dx, q=-i/k0*d/dy are pseudo-differential operators (see <code>mglPDE()</code> for details). Parameters <var>ini_re</var>, <var>ini_im</var> specify real and imaginary part of initial field distribution. Parameters <var>ray</var> set the reference ray, i.e. the ray around which the accompanied coordinate system will be maked. You may use, for example, the array created by <code>mglRay()</code> function. Note, that the reference ray <strong>must be</strong> smooth enough to make accompanied coodrinates unambiguity. Otherwise errors in the solution may appear. If <var>xx</var> and <var>yy</var> are non-zero then Cartesian coordinates for each point will be written into them. See also <code>mglPDE()</code>. See section <a href="#PDE-solving-hints">PDE solving hints</a>, for sample code and picture.
</p></dd></dl>

<p><a name="jacobian"></a>
</p><dl>
<dt><a name="index-jacobian"></a><u>MGL command:</u> <b>jacobian</b><i> <small>RES</small> xdat ydat [zdat]</i></dt>
<dd><p>Computes the Jacobian for transformation {i,j,k} to {<var>x</var>,<var>y</var>,<var>z</var>} where initial coordinates  {i,j,k} are data indexes normalized in range [0,1]. The Jacobian is determined by formula det||<em>dr_\alpha/d\xi_\beta</em>|| where <em>r</em>={<var>x</var>,<var>y</var>,<var>z</var>} and <em>\xi</em>={i,j,k}. All dimensions must be the same for all data arrays. Data must be 3D if all 3 arrays {<var>x</var>,<var>y</var>,<var>z</var>} are specified or 2D if only 2 arrays {<var>x</var>,<var>y</var>} are specified.
</p></dd></dl>

<p><a name="triangulation"></a>
</p><dl>
<dt><a name="index-triangulation"></a><u>MGL command:</u> <b>triangulation</b><i> <small>RES</small> xdat ydat</i></dt>
<dd><p>Computes triangulation for arbitrary placed points with coordinates {<var>x</var>,<var>y</var>} (i.e. finds triangles which connect points). MathGL use <a href="http://www.s-hull.org/">s-hull</a> code for triangulation. The sizes of 1st dimension <strong>must be equal</strong> for all arrays <code>x.nx=y.nx</code>. Resulting array can be used in <a href="#triplot">triplot</a> or <a href="#tricont">tricont</a> functions for visualization of reconstructed surface.
</p></dd></dl>



<hr size="6">
<a name="Evaluate-expression"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Global-functions" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MGL-variables" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Evaluate-expression-1"></a>
<h2 class="section">4.12 Evaluate expression</h2>

<p>You can use arbitrary formulas of existed data arrays or constants as any argument of data processing or data plotting commands. There are only 2 limitations: formula shouldn&rsquo;t contain spaces (to be recognized as single argument), and formula cannot be used as argument which will be (re)created by MGL command.
</p>


<hr size="6">
<a name="MGL-variables"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Evaluate-expression" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="MGL-variables-1"></a>
<h2 class="section">4.13 MGL variables</h2>

<p>For information about MGL variables see <a href="#MGL-definition">MGL definition</a>.
</p>




<hr size="6">
<a name="Examples"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#MGL-variables" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Basic-usage" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Data-processing" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="MathGL-examples"></a>
<h1 class="chapter">5. MathGL examples</h1>

<p>This chapter contain information about basic and advanced MathGL, hints and samples for all types of graphics. I recommend you read first 2 sections one after another and at least look on <a href="#Hints">Hints</a> section. Also I recommend you to look at <a href="#General-concepts">General concepts</a> and <a href="#FAQ">FAQ</a>.
</p>
<p>Most of sample scripts placed below use a set of functions for preparing the data.
</p><pre class="verbatim">func 'prepare1d'
new y 50 3
modify y '0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)'
modify y 'sin(2*pi*x)' 1
modify y 'cos(2*pi*x)' 2
new x1 50 'x'
new x2 50 '0.05-0.03*cos(pi*x)'
new y1 50 '0.5-0.3*cos(pi*x)'
new y2 50 '-0.3*sin(pi*x)'
return

func 'prepare2d'
new a 50 40 '0.6*sin(pi*(x+1))*sin(1.5*pi*(y+1))+0.4*cos(0.75*pi*(x+1)*(y+1))'
new b 50 40 '0.6*cos(pi*(x+1))*cos(1.5*pi*(y+1))+0.4*cos(0.75*pi*(x+1)*(y+1))'
return

func 'prepare3d'
new c 61 50 40 '-2*(x^2+y^2+z^4-z^2)+0.2'
new d 61 50 40 '1-2*tanh((x+y)*(x+y))'
return

func 'prepare2v'
new a 20 30 '0.6*sin(pi*(x+1))*sin(1.5*pi*(y+1))+0.4*cos(0.75*pi*(x+1)*(y+1))'
new b 20 30 '0.6*cos(pi*(x+1))*cos(1.5*pi*(y+1))+0.4*cos(0.75*pi*(x+1)*(y+1))'
return

func 'prepare3v'
define $1 pow(x*x+y*y+(z-0.3)*(z-0.3)+0.03,1.5)
define $2 pow(x*x+y*y+(z+0.3)*(z+0.3)+0.03,1.5)
new ex 10 10 10 '0.2*x/$1-0.2*x/$2'
new ey 10 10 10 '0.2*y/$1-0.2*y/$2'
new ez 10 10 10 '0.2*(z-0.3)/$1-0.2*(z+0.3)/$2'
return
</pre><p>Basically, you can put this text after the script. Note, that you need to terminate main script by <a href="#stop">stop</a> command before defining a function.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Basic-usage">5.1 Basic usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Advanced-usage">5.2 Advanced usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Data-handling">5.3 Data handling</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Data-plotting">5.4 Data plotting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#g_t1D-samples">5.5 1D samples</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#g_t2D-samples">5.6 2D samples</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#g_t3D-samples">5.7 3D samples</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Vector-field-samples">5.8 Vector field samples</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Hints">5.9 Hints</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#FAQ">5.10 FAQ</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>


<hr size="6">
<a name="Basic-usage"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Examples" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Advanced-usage" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Basic-usage-1"></a>
<h2 class="section">5.1 Basic usage</h2>

<p>MGL script can be used by several manners. Each has positive and negative sides:
</p><ul>
<li>
<em>Using UDAV.</em>

<p>Positive sides are possibilities to view the plot at once and to modify it, rotate, zoom or switch on transparency or lighting by hands or by mouse. Negative side is the needness of the X-terminal. </p>
</li><li>
<em>Using command line tools.</em>

<p>Positive aspects are: batch processing of similar data set, for example, a set of resulting data files for different calculation parameters), running from the console program, including the cluster calculation), fast and automated drawing, saving pictures for further analysis, or demonstration). Negative sides are: the usage of the external program for picture viewing. Also, the data plotting is non-visual. So, you have to imagine the picture, view angles, lighting and so on) before the plotting. I recommend to use graphical window for determining the optimal parameters of plotting on the base of some typical data set. And later use these parameters for batch processing in console program.
</p>
<p>In this case you can use the program: <code>mglconv</code> or <code>mglview</code> for viewing.
</p>
</li><li>
<em>Using C/C++/... code.</em>

<p>You can easily execute MGL script within C/C++/Fortan code. This can be useful for fast data plotting, for example, in web applications, where textual string (MGL script) may contain all necessary information for plot. The basic C++ code may look as following
</p><pre class="verbatim">const char *mgl_script; // script itself, can be of type const wchar_t*
mglGraph gr;
mglParse pr;
pr.Execute(&amp;gr, mgl_script);
</pre></li></ul>

<p>The simplest script is
</p><pre class="verbatim">box         # draw bounding box
axis        # draw axis
fplot 'x^3' # draw some function
</pre>
<p>Just type it in UDAV and press F5. Also you can save it in text file &lsquo;<samp>test.mgl</samp>&rsquo; and type in the console <code>mglconv test.mgl</code> what produce file &lsquo;<samp>test.mgl.png</samp>&rsquo; with resulting picture.
</p>
<hr size="6">
<a name="Advanced-usage"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Basic-usage" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Subplots" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Advanced-usage-1"></a>
<h2 class="section">5.2 Advanced usage</h2>

<p>Now I show several non-obvious features of MGL: several subplots in a single picture, curvilinear coordinates, text printing and so on. Generally you may miss this section at first reading, but I don&rsquo;t recommend it.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Subplots">5.2.1 Subplots</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Axis-and-ticks">5.2.2 Axis and ticks</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Curvilinear-coordinates">5.2.3 Curvilinear coordinates</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Colorbars">5.2.4 Colorbars</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Bounding-box">5.2.5 Bounding box</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Ternary-axis">5.2.6 Ternary axis</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Text-features">5.2.7 Text features</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Legend-sample">5.2.8 Legend sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Cutting-sample">5.2.9 Cutting sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr size="6">
<a name="Subplots"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Advanced-usage" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Axis-and-ticks" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Advanced-usage" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Subplots-1"></a>
<h3 class="subsection">5.2.1 Subplots</h3>

<p>Let me demonstrate possibilities of plot positioning and rotation. MathGL has a set of functions: <a href="#subplot">subplot</a>, <a href="#inplot">inplot</a>, <a href="#title">title</a>, <a href="#aspect">aspect</a> and <a href="#rotate">rotate</a> and so on (see <a href="#Subplots-and-rotation">Subplots and rotation</a>). The order of their calling is strictly determined. First, one changes the position of plot in image area (functions <a href="#subplot">subplot</a>, <a href="#inplot">inplot</a> and <a href="#multiplot">multiplot</a>). Secondly, you can add the title of plot by <a href="#title">title</a> function. After that one may rotate the plot (command <a href="#rotate">rotate</a>). Finally, one may change aspects of axes (command <a href="#aspect">aspect</a>). The following code illustrates the aforesaid it:
</p><pre class="verbatim">subplot 2 2 0
box:text -1 1.1 'Just box' ':L'
inplot 0.2 0.5 0.7 off
box:text 0 1.2 'InPlot example'

subplot 2 2 1:title 'Rotate only'
rotate 50 60:box

subplot 2 2 2:title 'Rotate and Aspect'
rotate 50 60:aspect 1 1 2:box

subplot 2 2 3:title 'Aspect in other direction'
rotate 50 60:aspect 1 2 2:box
</pre><p>Here I used function <code>Puts</code> for printing the text in arbitrary position of picture (see <a href="#Text-printing">Text printing</a>). Text coordinates and size are connected with axes. However, text coordinates may be everywhere, including the outside the bounding box. I&rsquo;ll show its features later in <a href="#Text-features">Text features</a>.
</p>
<p>Note that several commands can be placed in a string if they are separated by &lsquo;<samp>:</samp>&rsquo; symbol.
</p>
 <img src="png/aspect.png" alt="Example of several subplots on the single picture.">

<p>More complicated sample show how to use most of positioning functions:
</p><pre class="verbatim">subplot 3 2 0:title 'StickPlot'
stickplot 3 0 20 30:box 'r':text 0 0 '0' 'r'
stickplot 3 1 20 30:box 'g':text 0 0 '1' 'g'
stickplot 3 2 20 30:box 'b':text 0 0 '2' 'b'

subplot 3 2 3 '':title 'ColumnPlot'
columnplot 3 0:box 'r':text 0 0 '0' 'r'
columnplot 3 1:box 'g':text 0 0 '1' 'g'
columnplot 3 2:box 'b':text 0 0 '2' 'b'

subplot 3 2 4 '':title 'GridPlot'
gridplot 2 2 0:box 'r':text 0 0 '0' 'r'
gridplot 2 2 1:box 'g':text 0 0 '1' 'g'
gridplot 2 2 2:box 'b':text 0 0 '2' 'b'
gridplot 2 2 3:box 'm':text 0 0 '3' 'm'

subplot 3 2 5 '':title 'InPlot':box
inplot 0.4 1 0.6 1 on:box 'r'

multiplot 3 2 1 2 1 '':title 'MultiPlot':box
</pre>
 <img src="png/inplot.png" alt="Example for most of positioning functions.">

<hr size="6">
<a name="Axis-and-ticks"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Subplots" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Curvilinear-coordinates" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Advanced-usage" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Axis-and-ticks-1"></a>
<h3 class="subsection">5.2.2 Axis and ticks</h3>

<p>MathGL library can draw not only the bounding box but also the axes, grids, labels and so on. The ranges of axes and their origin (the point of intersection) are determined by functions <code>SetRange()</code>, <code>SetRanges()</code>, <code>SetOrigin()</code> (see <a href="#Ranges-_0028bounding-box_0029">Ranges (bounding box)</a>). Ticks on axis are specified by function <code>SetTicks</code>, <code>SetTicksVal</code>, <code>SetTicksTime</code> (see <a href="#Ticks">Ticks</a>). But usually
</p>
<p>Command <a href="#axis">axis</a> draws axes. Its textual string shows in which directions the axis or axes will be drawn (by default <code>&quot;xyz&quot;</code>, function draws axes in all directions). Command <a href="#grid">grid</a> draws grid perpendicularly to specified directions. Example of axes and grid drawing is:
</p><pre class="verbatim">subplot 2 2 0:title 'Axis origin, Grid'
origin 0 0:axis:grid:fplot 'x^3'

subplot 2 2 1:title '2 axis'
ranges -1 1 -1 1:origin -1 -1:axis
ylabel 'axis_1':fplot 'sin(pi*x)' 'r2'
ranges 0 1 0 1:origin 1 1:axis
ylabel 'axis_2':fplot 'cos(pi*x)'

subplot 2 2 3:title 'More axis'
origin nan nan:xrange -1 1:axis
xlabel 'x' 0:ylabel 'y_1' 0:fplot 'x^2' 'k'
yrange -1 1:origin -1.3 -1:axis 'y' 'r'
ylabel '#r{y_2}' 0.2:fplot 'x^3' 'r'

subplot 2 2 2:title '4 segments, inverted axis':origin 0 0:
inplot 0.5 1 0.5 1 on:ranges 0 10 0 2:axis
fplot 'sqrt(x/2)':xlabel 'W' 1:ylabel 'U' 1
inplot 0 0.5 0.5 1 on:ranges 1 0 0 2:axis 'x'
fplot 'sqrt(x)+x^3':xlabel '\tau' 1
inplot 0.5 1 0 0.5 on:ranges 0 10 4 0:axis 'y'
fplot 'x/4':ylabel 'L' -1
inplot 0 0.5 0 0.5 on:ranges 1 0 4 0:fplot '4*x^2'
</pre>
<p>Note, that MathGL can draw not only single axis (which is default). But also several axis on the plot (see right plots). The idea is that the change of settings does not influence on the already drawn graphics. So, for 2-axes I setup the first axis and draw everything concerning it. Then I setup the second axis and draw things for the second axis. Generally, the similar idea allows one to draw rather complicated plot of 4 axis with different ranges (see bottom left plot).
</p>
<p>At this inverted axis can be created by 2 methods. First one is used in this sample &ndash; just specify minimal axis value to be large than maximal one. This method work well for 2D axis, but can wrongly place labels in 3D case. Second method is more general and work in 3D case too &ndash; just use <a href="#aspect">aspect</a> function with negative arguments. For example, following code will produce exactly the same result for 2D case, but 2nd variant will look better in 3D.
</p><pre class="verbatim"># variant 1
ranges 0 10 4 0:axis

# variant 2
ranges 0 10 0 4:aspect 1 -1:axis
</pre>
 <img src="png/axis.png" alt="Example of axis.">

<p>Another MathGL feature is fine ticks tunning. By default (if it is not changed by <code>SetTicks</code> function), MathGL try to adjust ticks positioning, so that they looks most human readable. At this, MathGL try to extract common factor for too large or too small axis ranges, as well as for too narrow ranges. Last one is non-common notation and can be disabled by <code>SetTuneTicks</code> function.
</p>
<p>Also, one can specify its own ticks with arbitrary labels by help of <code>SetTicksVal</code> function. Or one can set ticks in time format. In last case MathGL will try to select optimal format for labels with automatic switching between years, months/days, hours/minutes/seconds or microseconds. However, you can specify its own time representation using formats described in <a href="http://www.manpagez.com/man/3/strftime/">http://www.manpagez.com/man/3/strftime/</a>. Most common variants are &lsquo;<samp>%X</samp>&rsquo; for national representation of time, &lsquo;<samp>%x</samp>&rsquo; for national representation of date, &lsquo;<samp>%Y</samp>&rsquo; for year with century.
</p>
<p>The sample code, demonstrated ticks feature is
</p><pre class="verbatim">subplot 3 2 0:title 'Usual axis'
axis

subplot 3 2 1:title 'Too big/small range'
ranges -1000 1000 0 0.001:axis

subplot 3 2 3:title 'Too narrow range'
ranges 100 100.1 10 10.01:axis

subplot 3 2 4:title 'Disable ticks tuning'
tuneticks off:axis

subplot 3 2 2:title 'Manual ticks'
ranges -pi pi 0 2
xtick -pi '\pi' -pi/2 '-\pi/2' 0 '0' 0.886 'x^*' pi/2 '\pi/2' pi 'pi'
# or you can use:
#list v -pi -pi/2 0 0.886 pi/2 pi:xtick v '-\pi\n-\pi/2\n{}0\n{}x^*\n\pi/2\n\pi'
axis:grid:fplot '2*cos(x^2)^2' 'r2'

subplot 3 2 5:title 'Time ticks'
xrange 0 3e5:ticktime 'x':axis
</pre>
 <img src="png/ticks.png" alt="Features of axis ticks.">

<p>The last sample I want to show in this subsection is Log-axis. From MathGL&rsquo;s point of view, the log-axis is particular case of general curvilinear coordinates. So, we need first define new coordinates (see also <a href="#Curvilinear-coordinates">Curvilinear coordinates</a>) by help of <code>SetFunc</code> or <code>SetCoor</code> functions. At this one should wary about proper axis range. So the code looks as following:
</p><pre class="verbatim">subplot 2 2 0 '&lt;_':title 'Semi-log axis'
ranges 0.01 100 -1 1:axis 'lg(x)' '' ''
axis:grid 'xy' 'g':fplot 'sin(1/x)'
xlabel 'x' 0:ylabel 'y = sin 1/x' 0

subplot 2 2 1 '&lt;_':title 'Log-log axis'
ranges 0.01 100 0.1 100:axis 'lg(x)' 'lg(y)' ''
axis:fplot 'sqrt(1+x^2)'
xlabel 'x' 0:ylabel 'y = \sqrt{1+x^2}' 0

subplot 2 2 2 '&lt;_':title 'Minus-log axis'
ranges -100 -0.01 -100 -0.1:axis '-lg(-x)' '-lg(-y)' ''
axis:fplot '-sqrt(1+x^2)'
xlabel 'x' 0:ylabel 'y = -\sqrt{1+x^2}' 0

subplot 2 2 3 '&lt;_':title 'Log-ticks'
ranges 0.01 100 0 100:axis 'sqrt(x)' '' ''
axis:fplot 'x'
xlabel 'x' 1:ylabel 'y = x' 0
</pre>
 <img src="png/loglog.png" alt="Features of axis ticks.">

<p>You can see that MathGL automatically switch to log-ticks as we define log-axis formula (in difference from v.1.*). Moreover, it switch to log-ticks for any formula if axis range will be large enough (see right bottom plot). Another interesting feature is that you not necessary define usual log-axis (i.e. when coordinates are positive), but you can define &ldquo;minus-log&rdquo; axis when coordinate is negative (see left bottom plot).
</p>
<hr size="6">
<a name="Curvilinear-coordinates"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Axis-and-ticks" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Colorbars" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Advanced-usage" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Curvilinear-coordinates-1"></a>
<h3 class="subsection">5.2.3 Curvilinear coordinates</h3>

<p>As I noted in previous subsection, MathGL support curvilinear coordinates. In difference from other plotting programs and libraries, MathGL uses textual formulas for connection of the old (data) and new (output) coordinates. This allows one to plot in arbitrary coordinates. The following code plots the line <var>y</var>=0, <var>z</var>=0 in Cartesian, polar, parabolic and spiral coordinates:
</p><pre class="verbatim">origin -1 1 -1
subplot 2 2 0:title 'Cartesian':rotate 50 60
fplot '2*t-1' '0.5' '0' '2r':axis:grid

axis 'y*sin(pi*x)' 'y*cos(pi*x)' '':
subplot 2 2 1:title 'Cylindrical':rotate 50 60
fplot '2*t-1' '0.5' '0' '2r':axis:grid

axis '2*y*x' 'y*y - x*x' ''
subplot 2 2 2:title 'Parabolic':rotate 50 60
fplot '2*t-1' '0.5' '0' '2r':axis:grid

axis 'y*sin(pi*x)' 'y*cos(pi*x)' 'x+z'
subplot 2 2 3:title 'Spiral':rotate 50 60
fplot '2*t-1' '0.5' '0' '2r':axis:grid
</pre>
 <img src="png/curvcoor.png" alt="Example of curvilinear coordinates">


<hr size="6">
<a name="Colorbars"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Curvilinear-coordinates" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Bounding-box" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Advanced-usage" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Colorbars-1"></a>
<h3 class="subsection">5.2.4 Colorbars</h3>

<p>MathGL handle <a href="#colorbar">colorbar</a> as special kind of axis. So, most of functions for axis and ticks setup will work for colorbar too. Colorbars can be in log-scale, and generally as arbitrary function scale; common factor of colorbar labels can be separated; and so on.
</p>
<p>But of course, there are differences &ndash; colorbars usually located out of bounding box. At this, colorbars can be at subplot boundaries (by default), or at bounding box (if symbol &lsquo;<samp>I</samp>&rsquo; is specified). Colorbars can handle sharp colors. And they can be located at arbitrary position too. The sample code, which demonstrate colorbar features is:
</p><pre class="verbatim">call 'prepare2d'
new v 9 'x'

subplot 2 2 0:title 'Colorbar out of box':box
colorbar '&lt;':colorbar '&gt;':colorbar '_':colorbar '^'

subplot 2 2 1:title 'Colorbar near box':box
colorbar '&lt;I':colorbar '&gt;I':colorbar '_I':colorbar '^I'

subplot 2 2 2:title 'manual colors':box:contd v a
colorbar v '&lt;':colorbar v '&gt;':colorbar v '_':colorbar v '^'

subplot 2 2 3:title '':text -0.5 1.55 'Color positions' ':C' -2

colorbar 'bwr&gt;' 0.25 0:text -0.9 1.2 'Default'
colorbar 'b{w,0.3}r&gt;' 0.5 0:text -0.1 1.2 'Manual'

crange 0.01 1e3
colorbar '&gt;' 0.75 0:text 0.65 1.2 'Normal scale'
colorbar '&gt;':text 1.35 1.2 'Log scale'
</pre>
 <img src="png/colorbar.png" alt="Example of colorbars">


<hr size="6">
<a name="Bounding-box"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Colorbars" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Ternary-axis" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Advanced-usage" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Bounding-box-1"></a>
<h3 class="subsection">5.2.5 Bounding box</h3>

<p>Box around the plot is rather useful thing because it allows one to: see the plot boundaries, and better estimate points position since box contain another set of ticks. MathGL provide special function for drawing such box &ndash; <a href="#box">box</a> function. By default, it draw black or white box with ticks (color depend on transparency type, see <a href="#Types-of-transparency">Types of transparency</a>). However, you can change the color of box, or add drawing of rectangles at rear faces of box. Also you can disable ticks drawing, but I don&rsquo;t know why anybody will want it. The sample code, which demonstrate <a href="#box">box</a> features is:
</p><pre class="verbatim">subplot 2 2 0:title 'Box (default)':rotate 50 60:box

subplot 2 2 1:title 'colored':rotate 50 60:box 'r'

subplot 2 2 2:title 'with faces':rotate 50 60:box '@'

subplot 2 2 3:title 'both':rotate 50 60:box '@cm'
</pre>
 <img src="png/box.png" alt="Example of Box()">


<hr size="6">
<a name="Ternary-axis"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Bounding-box" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Text-features" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Advanced-usage" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Ternary-axis-1"></a>
<h3 class="subsection">5.2.6 Ternary axis</h3>

<p>There are another unusual axis types which are supported by MathGL. These are ternary and quaternary axis. Ternary axis is special axis of 3 coordinates <var>a</var>, <var>b</var>, <var>c</var> which satisfy relation <var>a</var>+<var>b</var>+<var>c</var>=1. Correspondingly, quaternary axis is special axis of 4 coordinates <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var> which satisfy relation <var>a</var>+<var>b</var>+<var>c</var>+<var>d</var>=1.
</p>
<p>Generally speaking, only 2 of coordinates (3 for quaternary) are independent. So, MathGL just introduce some special transformation formulas which treat <var>a</var> as &lsquo;<samp>x</samp>&rsquo;, <var>b</var> as &lsquo;<samp>y</samp>&rsquo; (and <var>c</var> as &lsquo;<samp>z</samp>&rsquo; for quaternary). As result, all plotting functions (curves, surfaces, contours and so on) work as usual, but in new axis. You should use <a href="#ternary">ternary</a> function for switching to ternary/quaternary coordinates. The sample code is:
</p><pre class="verbatim">ranges 0 1 0 1 0 1
new x 50 '0.25*(1+cos(2*pi*x))'
new y 50 '0.25*(1+sin(2*pi*x))'
new z 50 'x'
new a 20 30 '30*x*y*(1-x-y)^2*(x+y&lt;1)'
new rx 10 'rnd':copy ry (1-rx)*rnd
light on

subplot 2 2 0:title 'Ordinary axis 3D':rotate 50 60
box:axis:grid
plot x y z 'r2':surf a '#'
xlabel 'B':ylabel 'C':zlabel 'Z'

subplot 2 2 1:title 'Ternary axis (x+y+t=1)':ternary 1
box:axis:grid 'xyz' 'B;'
plot x y 'r2':plot rx ry 'q^ ':cont a:line 0.5 0 0 0.75 'g2'
xlabel 'B':ylabel 'C':tlabel 'A'

subplot 2 2 2:title 'Quaternary axis 3D':rotate 50 60:ternary 2
box:axis:grid 'xyz' 'B;'
plot x y z 'r2':surf a '#'
xlabel 'B':ylabel 'C':tlabel 'A':zlabel 'D'

subplot 2 2 3:title 'Ternary axis 3D':rotate 50 60:ternary 1
box:axis:grid 'xyz' 'B;'
plot x y z 'r2':surf a '#'
xlabel 'B':ylabel 'C':tlabel 'A':zlabel 'Z'
</pre>
 <img src="png/ternary.png" alt="Ternary and Quaternary axis">

<hr size="6">
<a name="Text-features"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Ternary-axis" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Legend-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Advanced-usage" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Text-features-1"></a>
<h3 class="subsection">5.2.7 Text features</h3>

<p>MathGL prints text by vector font. There are functions for manual specifying of text position (like <code>Puts</code>) and for its automatic selection (like <code>Label</code>, <code>Legend</code> and so on). MathGL prints text always in specified position even if it lies outside the bounding box. The default size of font is specified by functions <var>SetFontSize*</var> (see <a href="#Font-settings">Font settings</a>). However, the actual size of output string depends on subplot size (depends on functions <code>SubPlot</code>, <code>InPlot</code>). The switching of the font style (italic, bold, wire and so on) can be done for the whole string (by function parameter) or inside the string. By default MathGL parses TeX-like commands for symbols and indexes (see <a href="#Font-styles">Font styles</a>).
</p>
<p>Text can be printed as usual one (from left to right), along some direction (rotated text), or along a curve. Text can be printed on several lines, divided by new line symbol &lsquo;<samp>\n</samp>&rsquo;.
</p>
<p>Example of MathGL font drawing is:
</p><pre class="verbatim">call 'prepare1d'

subplot 2 2 0 ''
text 0 1 'Text can be in ASCII and in Unicode'
text 0 0.6 'It can be \wire{wire}, \big{big} or #r{colored}'
text 0 0.2 'One can change style in string: \b{bold}, \i{italic, \b{both}}'
text 0 -0.2 'Easy to \a{overline} or \u{underline}'
text 0 -0.6 'Easy to change indexes ^{up} _{down} @{center}'
text 0 -1 'It parse TeX: \int \alpha \cdot \
\sqrt3{sin(\pi x)^2 + \gamma_{i_k}} dx'

subplot 2 2 1 ''
 text 0 0.5 '\sqrt{\frac{\alpha^{\gamma^2}+\overset 1{\big\infty}}{\sqrt3{2+b}}}' '@' -2
text 0 -0.5 'Text can be printed\n{}on several lines'

subplot 2 2 2 '':box:plot y(:,0)
text y 'This is very very long string drawn along a curve' 'k'
text y 'Another string drawn above a curve' 'Tr'

subplot 2 2 3 '':line -1 -1 1 -1 'rA':text 0 -1 1 -1 'Horizontal'
line -1 -1 1 1 'rA':text 0 0 1 1 'At angle' '@'
line -1 -1 -1 1 'rA':text -1 0 -1 1 'Vertical'
</pre>
 <img src="png/text.png" alt="Example of text printing">

<p>You can change font faces by loading font files by function <a href="#loadfont">loadfont</a>. Note, that this is long-run procedure. Font faces can be downloaded from <a href="http://mathgl.sourceforge.net/download.html">MathGL website</a> or from <a href="http://sourceforge.net/project/showfiles.php?group_id=152187&amp;package_id=267177">here</a>. The sample code is:
</p><pre class="verbatim">define d 0.25
loadfont 'STIX':text 0 1.1 'default font (STIX)'
loadfont 'adventor':text 0 1.1-d 'adventor font'
loadfont 'bonum':text 0 1.1-2*d 'bonum font'
loadfont 'chorus':text 0 1.1-3*d 'chorus font'
loadfont 'cursor':text 0 1.1-4*d 'cursor font'
loadfont 'heros':text 0 1.1-5*d 'heros font'
loadfont 'heroscn':text 0 1.1-6*d 'heroscn font'
loadfont 'pagella':text 0 1.1-7*d 'pagella font'
loadfont 'schola':text 0 1.1-8*d 'schola font'
loadfont 'termes':text 0 1.1-9*d 'termes font'
</pre>
 <img src="png/fonts.png" alt="Example of font faces">

<hr size="6">
<a name="Legend-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Text-features" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Cutting-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Advanced-usage" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Legend-sample-1"></a>
<h3 class="subsection">5.2.8 Legend sample</h3>

<p>Legend is one of standard ways to show plot annotations. Basically you need to connect the plot style (line style, marker and color) with some text. In MathGL, you can do it by 2 methods: manually using <a href="#addlegend">addlegend</a> function; or use &lsquo;<samp>legend</samp>&rsquo; option (see <a href="#Command-options">Command options</a>), which will use last plot style. In both cases, legend entries will be added into internal accumulator, which later used for legend drawing itself. <a href="#clearlegend">clearlegend</a> function allow you to remove all saved legend entries.
</p>
<p>There are 2 features. If plot style is empty then text will be printed without indent. If you want to plot the text with indent but without plot sample then you need to use space &lsquo;<samp> </samp>&rsquo; as plot style. Such style &lsquo;<samp> </samp>&rsquo; will draw a plot sample (line with marker(s)) which is invisible line (i.e. nothing) and print the text with indent as usual one.
</p>
<p>Command <a href="#legend">legend</a> draw legend on the plot. The position of the legend can be selected automatic or manually. You can change the size and style of text labels, as well as setup the plot sample. The sample code demonstrating legend features is:
</p><pre class="verbatim">addlegend 'sin(\pi {x^2})' 'b'
addlegend 'sin(\pi x)' 'g*'
addlegend 'sin(\pi \sqrt{x})' 'rd'
addlegend 'jsut text' ' '
addlegend 'no indent for this' ''

subplot 2 2 0 '':title 'Legend (default)':box
legend

text 0.75 0.65 'Absolute position' 'A'
legend 3 'A#'

subplot 2 2 2 '':title 'coloring':box
legend 0 'r#':legend 1 'Wb#':legend 2 'ygr#'

subplot 2 2 3 '':title 'manual position':box
legend 0.5 1:text 0.5 0.55 'at x=0.5, y=1' 'a'
legend 1 '#-':text 0.75 0.25 'Horizontal legend' 'a'
</pre>
 <img src="png/legend.png" alt="Example of legend">

<hr size="6">
<a name="Cutting-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Legend-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-handling" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Advanced-usage" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Cutting-sample-1"></a>
<h3 class="subsection">5.2.9 Cutting sample</h3>

<p>The last common thing which I want to show in this section is how one can cut off points from plot. There are 4 mechanism for that.
</p><ul>
<li>
You can set one of coordinate to NAN value. All points with NAN values will be omitted.

</li><li>
You can enable cutting at edges by <code>SetCut</code> function. As result all points out of bounding box will be omitted.

</li><li>
You can set cutting box by <code>SetCutBox</code> function. All points inside this box will be omitted.

</li><li>
You can define cutting formula by <code>SetCutOff</code> function. All points for which the value of formula is nonzero will be omitted. Note, that this is the slowest variant.
</li></ul>

<p>Below I place the code which demonstrate last 3 possibilities:
</p><pre class="verbatim">call 'prepare2d'
call 'prepare3d'

subplot 2 2 0:title 'Cut on (default)':rotate 50 60
light on:box:surf a; zrange -1 0.5

subplot 2 2 1:title 'Cut off':rotate 50 60
box:surf a; zrange -1 0.5; cut off

subplot 2 2 2:title 'Cut in box':rotate 50 60:box:alpha on
cut 0 -1 -1 1 0 1.1:surf3 c
cut 0 0 0 0 0 0	# restore back

subplot 2 2 3:title 'Cut by formula':rotate 50 60:box
cut '(z&gt;(x+0.5*y-1)^2-1) &amp; (z&gt;(x-0.5*y-1)^2-1)':surf3 c
</pre>
 <img src="png/cut.png" alt="Example of point cutting">




<hr size="6">
<a name="Data-handling"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Cutting-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Array-creation" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Data-handling-1"></a>
<h2 class="section">5.3 Data handling</h2>

<p>Class <code>mglData</code> contains all functions for the data handling in MathGL (see section <a href="#Data-processing">Data processing</a>). There are several matters why I use class <code>mglData</code> but not a single array: it does not depend on type of data (mreal or double), sizes of data arrays are kept with data, memory working is simpler and safer.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Array-creation">5.3.1 Array creation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Change-data">5.3.2 Change data</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr size="6">
<a name="Array-creation"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Data-handling" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Change-data" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-handling" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Array-creation-1"></a>
<h3 class="subsection">5.3.1 Array creation</h3>

<p>One can put numbers into the data instance by several ways. Let us do it for square function:
</p><ul>
<li>
one can create array by <code>list</code> command
<pre class="verbatim">list a 0 0.04 0.16 0.36 0.64 1
</pre>
</li><li>
another way is to copy from &ldquo;inline&rdquo; array
<pre class="verbatim">copy a [0,0.04,0.16,0.36,0.64,1]
</pre>
</li><li>
next way is to fill the data by textual formula with the help of <code>modify</code> function
<pre class="verbatim">new a 6
modify a 'x^2'
</pre>
</li><li>
or one may fill the array in some interval and modify it later
<pre class="verbatim">new a 6
fill a 0 1
modify a 'u^2'
</pre>
</li><li>
or fill the array using current axis range
<pre class="verbatim">new a 6
fill a '(x+1)^2/4'
</pre><p>or use single line
</p><pre class="verbatim">new a 6 '(x+1)^2/4'
</pre>
</li><li>
finally it can be loaded from file
<pre class="verbatim">new s 6 '(x+1)^2/4'
save s 'sqr.dat'    # create file first
read a 'sqr.dat'    # load it
</pre>
</li><li>
at this one can read only part of data
<pre class="verbatim">new s 6 '(x+1)^2/4'
save s 'sqr.dat'    # create file first
read a 'sqr.dat' 5  # load it
</pre></li></ul>

<p>Creation of 2d- and 3d-arrays is mostly the same. One can use direct data filling by <code>list</code> command
</p><pre class="verbatim">list a 11 12 13 | 21 22 23 | 31 32 33
</pre><p>or by inline arrays
</p><pre class="verbatim">copy a [[11,12,13],[21,22,23],[31,32,33]]
</pre><p>Also data can be filled by formula
</p><pre class="verbatim">new z 30 40 'sin(pi*x)*cos(pi*y)'
</pre><p>or loaded from a file.
</p>
<hr size="6">
<a name="Change-data"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Array-creation" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-plotting" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Data-handling" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Change-data-1"></a>
<h3 class="subsection">5.3.2 Change data</h3>

<p>MathGL has functions for data processing: differentiating, integrating, smoothing and so on (for more detail, see <a href="#Data-processing">Data processing</a>). Let us consider some examples. The simplest ones are integration and differentiation. The direction in which operation will be performed is specified by textual string, which may contain symbols &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo; or &lsquo;<samp>z</samp>&rsquo;. For example, the call of <code>diff 'x'</code> will differentiate data along &lsquo;<samp>x</samp>&rsquo; direction; the call of <code>integrate 'xy'</code> perform the double integration of data along &lsquo;<samp>x</samp>&rsquo; and &lsquo;<samp>y</samp>&rsquo; directions; the call of <code>diff2 'xyz'</code> will apply 3d Laplace operator to data and so on. Example of this operations on 2d array a=x*y is presented in code:
</p><pre class="verbatim">ranges 0 1 0 1 0 1:new a 30 40 'x*y'
subplot 2 2 0:title 'a(x,y)':rotate 60 40
surf a:box

subplot 2 2 1:title 'da/dx':rotate 60 40
diff a 'x':surf a:box

subplot 2 2 2:title '\int da/dx dxdy':rotate 60 40
integrate a 'xy':surf a:box

subplot 2 2 3:title '\int {d^2}a/dxdy dx':rotate 60 40
diff2 a 'y':surf a:box
</pre>
 <img src="png/dat_diff.png" alt="Example of data differentiation and integration">

<p>Data smoothing (command <a href="#smooth">smooth</a>) is more interesting and important. This function has single argument which define type of smoothing and its direction. Now 3 methods are supported: &lsquo;<samp>3</samp>&rsquo; &ndash; linear averaging by 3 points, &lsquo;<samp>5</samp>&rsquo; &ndash; linear averaging by 5 points, and default one &ndash; quadratic averaging by 5 points.
</p>
<p>MathGL also have some amazing functions which is not so important for data processing as useful for data plotting. There are functions for finding envelope (useful for plotting rapidly oscillating data), for data sewing (useful to removing jumps on the phase), for data resizing (interpolation). Let me demonstrate it:
</p><pre class="verbatim">subplot 2 2 0 '':title 'Envelop sample'
new d1 1000 'exp(-8*x^2)*sin(10*pi*x)'
axis:plot d1 'b'
envelop d1 'x'
plot d1 'r'

subplot 2 2 1 '':title 'Smooth sample':ranges 0 1 0 1
new y0 30 '0.4*sin(pi*x) + 0.3*cos(1.5*pi*x) - 0.4*sin(2*pi*x)+0.5*rnd'
copy y1 y0:smooth y1 'x3':plot y1 'r';legend '&quot;3&quot; style'
copy y2 y0:smooth y2 'x5':plot y2 'g';legend '&quot;5&quot; style'
copy y3 y0:smooth y3 'x':plot y3 'b';legend 'default'
plot y0 '{m7}:s';legend 'none':legend:box

subplot 2 2 2:title 'Sew sample':rotate 50 60:light on:alpha on
new d2 100 100 'mod((y^2-(1-x)^2)/2,0.1)'
box:surf d2 'b'
sew d2 'xy' 0.1
surf d2 'r'

subplot 2 2 3:title 'Resize sample (interpolation)'
new x0 10 'rnd':new v0 10 'rnd'
resize x1 x0 100:resize v1 v0 100
plot x0 v0 'b+ ':plot x1 v1 'r-':label x0 v0 '%n'
</pre>
 <img src="png/dat_extra.png" alt="Example of data smoothing">

<p>Finally one can create new data arrays on base of the existing one: extract slice, row or column of data (<a href="#subdata">subdata</a>), summarize along a direction(s) (<a href="#sum">sum</a>), find distribution of data elements (<a href="#hist">hist</a>) and so on.
</p>
<p><a name="Solve-sample"></a>
Another interesting feature of MathGL is interpolation and root-finding. There are several functions for linear and cubic spline interpolation (see <a href="#Interpolation">Interpolation</a>). Also there is a function <a href="#evaluate">evaluate</a> which do interpolation of data array for values of each data element of index data. It look as indirect access to the data elements.
</p>
<p>This function have inverse function <a href="#solve">solve</a> which find array of indexes at which data array is equal to given value (i.e. work as root finding). But <a href="#solve">solve</a> function have the issue &ndash; usually multidimensional data (2d and 3d ones) have an infinite number of indexes which give some value. This is contour lines for 2d data, or isosurface(s) for 3d data. So, <a href="#solve">solve</a> function will return index only in given direction, assuming that other index(es) are the same as equidistant index(es) of original data. Let me demonstrate this on the following sample.
</p>
<pre class="verbatim">zrange 0 1
new x 20 30 '(x+2)/3*cos(pi*y)'
new y 20 30 '(x+2)/3*sin(pi*y)'
new z 20 30 'exp(-6*x^2-2*sin(pi*y)^2)'

subplot 2 1 0:title 'Cartesian space':rotate 30 -40
axis 'xyzU':box
xlabel 'x':ylabel 'y'origin 1 1:grid 'xy'
mesh x y z

# section along 'x' direction
solve u x 0.5 'x'
var v u.nx 0 1
evaluate yy y u v
evaluate xx x u v
evaluate zz z u v
plot xx yy zz 'k2o'

# 1st section along 'y' direction
solve u1 x -0.5 'y'
var v1 u1.nx 0 1
evaluate yy y v1 u1
evaluate xx x v1 u1
evaluate zz z v1 u1
plot xx yy zz 'b2^'

# 2nd section along 'y' direction
solve u2 x -0.5 'y' u1
evaluate yy y v1 u2
evaluate xx x v1 u2
evaluate zz z v1 u2
plot xx yy zz 'r2v'

subplot 2 1 1:title 'Accompanied space'
ranges 0 1 0 1:origin 0 0
axis:box:xlabel 'i':ylabel 'j':grid2 z 'h'

plot u v 'k2o':line 0.4 0.5 0.8 0.5 'kA'
plot v1 u1 'b2^':line 0.5 0.15 0.5 0.3 'bA'
plot v1 u2 'r2v':line 0.5 0.7 0.5 0.85 'rA'
</pre>
 <img src="png/solve.png" alt="Example of data interpolation and root finding">


<hr size="6">
<a name="Data-plotting"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Change-data" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Data-plotting-1"></a>
<h2 class="section">5.4 Data plotting</h2>

<p>Let me now show how to plot the data. Next section will give much more examples for all plotting functions. Here I just show some basics. MathGL generally has 2 types of plotting functions. Simple variant requires a single data array for plotting, other data (coordinates) are considered uniformly distributed in axis range. Second variant requires data arrays for all coordinates. It allows one to plot rather complex multivalent curves and surfaces (in case of parametric dependencies). Usually each function have one textual argument for plot style and accept options (see <a href="#Command-options">Command options</a>).
</p>
<p>Note, that the call of drawing function adds something to picture but does not clear the previous plots (as it does in Matlab). Another difference from Matlab is that all setup (like transparency, lightning, axis borders and so on) must be specified <strong>before</strong> plotting functions.
</p>
<p>Let start for plots for 1D data. Term &ldquo;1D data&rdquo; means that data depend on single index (parameter) like curve in parametric form {x(i),y(i),z(i)}, i=1...n. The textual argument allow you specify styles of line and marks (see <a href="#Line-styles">Line styles</a>). If this parameter is empty <code>''</code> then solid line with color from palette is used (see <a href="#Palette-and-colors">Palette and colors</a>).
</p>
<p>Below I shall show the features of 1D plotting on base of <a href="#plot">plot</a> function. Let us start from sinus plot:
</p><pre class="verbatim">new y0 50 'sin(pi*x)'
subplot 2 2 0
plot y0:box
</pre><p>Style of line is not specified in <a href="#plot">plot</a> function. So MathGL uses the solid line with first color of palette (this is blue). Next subplot shows array <var>y1</var> with 2 rows:
</p><pre class="verbatim">subplot 2 2 1
new y1 50 2
fill y1 'cos(pi*(x+y/4))*2/(y+3)'
plot y1:box
</pre><p>As previously I did not specify the style of lines. As a result, MathGL again uses solid line with next colors in palette (there are green and red). Now let us plot a circle on the same subplot. The circle is parametric curve <em>x=cos(\pi t), y=sin(\pi t)</em>. I will set the color of the circle (dark yellow, &lsquo;<samp>Y</samp>&rsquo;) and put marks &lsquo;<samp>+</samp>&rsquo; at point position:
</p><pre class="verbatim">new x 50 'cos(pi*x)'
plot x y0 'Y+'
</pre><p>Note that solid line is used because I did not specify the type of line. The same picture can be achieved by <a href="#plot">plot</a> and <a href="#subdata">subdata</a> functions. Let us draw ellipse by orange dash line:
</p><pre class="verbatim">plot y1(:,0) y1(:,1) 'q|'
</pre>
<p>Drawing in 3D space is mostly the same. Let us draw spiral with default line style. Now its color is 4-th color from palette (this is cyan):
</p><pre class="verbatim">subplot 2 2 2:rotate 60 40
new z 50 'x'
plot x y0 z:box
</pre><p>Functions <a href="#plot">plot</a> and <a href="#subdata">subdata</a> make 3D curve plot but for single array. Use it to put circle marks on the previous plot:
</p><pre class="verbatim">new y2 10 3 'cos(pi*(x+y/2))'
modify y2 '2*x-1' 2
plot y2(:,0) y2(:,1) y2(:,2) 'bo '
</pre><p>Note that line style is empty &lsquo;<samp> </samp>&rsquo; here. Usage of other 1D plotting functions looks similar:
</p><pre class="verbatim">subplot 2 2 3:rotate 60 40
bars x y0 z 'r':box
</pre>
<p>Surfaces <a href="#surf">surf</a> and other 2D plots (see section <a href="#g_t2D-plotting">2D plotting</a>) are drown the same simpler as 1D one. The difference is that the string parameter specifies not the line style but the color scheme of the plot (see <a href="#Color-scheme">Color scheme</a>). Here I draw attention on 4 most interesting color schemes. There is gray scheme where color is changed from black to white (string &lsquo;<samp>kw</samp>&rsquo;) or from white to black (string &lsquo;<samp>wk</samp>&rsquo;). Another scheme is useful for accentuation of negative (by blue color) and positive (by red color) regions on plot (string &lsquo;<samp>&quot;BbwrR&quot;</samp>&rsquo;). Last one is the popular &ldquo;jet&rdquo; scheme (string &lsquo;<samp>&quot;BbcyrR&quot;</samp>&rsquo;).
</p>
<p>Now I shall show the example of a surface drawing. At first let us switch lightning on
</p><pre class="verbatim">light on
</pre><p>and draw the surface, considering coordinates x,y to be uniformly distributed in interval <var>Min</var>*<var>Max</var>
</p><pre class="verbatim">new a0 50 40 '0.6*sin(pi*(x+1))*sin(1.5*pi*(y+1))+0.4*cos(0.75*pi*(x+1)*(y+1))'
subplot 2 2 0:rotate 60 40
surf a0:box
</pre><p>Color scheme was not specified. So previous color scheme is used. In this case it is default color scheme (&ldquo;jet&rdquo;) for the first plot. Next example is a sphere. The sphere is parametrically specified surface:
</p><pre class="verbatim">new x 50 40 '0.8*sin(pi*x)*cos(pi*y/2)'
new y 50 40 '0.8*cos(pi*x)*cos(pi*y/2)'
new z 50 40 '0.8*sin(pi*y/2)'
subplot 2 2 1:rotate 60 40
surf x y z 'BbwrR':box
</pre><p>I set color scheme to <code>&quot;BbwrR&quot;</code> that corresponds to red top and blue bottom of the sphere.
</p>
<p>Surfaces will be plotted for each of slice of the data if <var>nz</var>&gt;1. Next example draws surfaces for data arrays with <var>nz</var>=3:
</p><pre class="verbatim">new a1 50 40 3
modify a1 '0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))'
modify a1 '0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*sin(3*pi*(x*y))' 1
modify a1 '0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))' 2
subplot 2 2 2:rotate 60 40
alpha on
surf a1:box
</pre><p>Note, that it may entail a confusion. However, if one will use density plot then the picture will look better:
</p><pre class="verbatim">subplot 2 2 3:rotate 60 40
dens a1:box
</pre>
<p>Drawing of other 2D plots is analogous. The only peculiarity is the usage of flag &lsquo;<samp>#</samp>&rsquo;. By default this flag switches on the drawing of a grid on plot (<a href="#grid">grid</a> or <a href="#mesh">mesh</a> for plots in plain or in volume). However, for isosurfaces (including surfaces of rotation <a href="#axial">axial</a>) this flag switches the  face drawing off and figure becomes wired.
</p>
<hr size="6">
<a name="g_t1D-samples"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Data-plotting" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Plot-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="g_t1D-samples-1"></a>
<h2 class="section">5.5 1D samples</h2>

<p>This section is devoted to visualization of 1D data arrays. 1D means the data which depend on single index (parameter) like curve in parametric form {x(i),y(i),z(i)}, i=1...n. Most of samples will use the same data for plotting. So, I put its initialization in separate function
</p><pre class="verbatim">func 'prepare1d'
new y 50 3
modify y '0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)'
modify y 'sin(2*pi*x)' 1
modify y 'cos(2*pi*x)' 2
new x1 50 'x'
new x2 50 '0.05-0.03*cos(pi*x)'
new y1 50 '0.5-0.3*cos(pi*x)'
new y2 50 '-0.3*sin(pi*x)'
return
</pre><p>Basically, you can put this text after the script. Note, that you need to terminate main script by <a href="#stop">stop</a> command before defining a function.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Plot-sample">5.5.1 Plot sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Radar-sample">5.5.2 Radar sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Step-sample">5.5.3 Step sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Tens-sample">5.5.4 Tens sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Area-sample">5.5.5 Area sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Region-sample">5.5.6 Region sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Stem-sample">5.5.7 Stem sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Bars-sample">5.5.8 Bars sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Barh-sample">5.5.9 Barh sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Cones-sample">5.5.10 Cones sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Chart-sample">5.5.11 Chart sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#BoxPlot-sample">5.5.12 BoxPlot sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Candle-sample">5.5.13 Candle sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Error-sample">5.5.14 Error sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Mark-sample">5.5.15 Mark sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#TextMark-sample">5.5.16 TextMark sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Label-sample">5.5.17 Label sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Table-sample">5.5.18 Table sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Tube-sample">5.5.19 Tube sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Tape-sample">5.5.20 Tape sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Torus-sample">5.5.21 Torus sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>


<hr size="6">
<a name="Plot-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#g_t1D-samples" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Radar-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Plot-sample-1"></a>
<h3 class="subsection">5.5.1 Plot sample</h3>

<p>Command <a href="#plot">plot</a> is most standard way to visualize 1D data array. By default, <code>Plot</code> use colors from palette. However, you can specify manual color/palette, and even set to use new color for each points by using &lsquo;<samp>!</samp>&rsquo; style. Another feature is &lsquo;<samp> </samp>&rsquo; style which draw only markers without line between points. The sample code is:
</p><pre class="verbatim">call 'prepare1d'
subplot 2 2 0 '':title 'Plot plot (default)':box
plot y

subplot 2 2 2 '':title ''!' style; 'rgb' palette':box
plot y 'o!rgb'

subplot 2 2 3 '':title 'just markers':box
plot y ' +'

new yc 30 'sin(pi*x)':new xc 30 'cos(pi*x)':new z 30 'x'
subplot 2 2 1:title '3d variant':rotate 50 60:box
plot xc yc z 'rs'
</pre>
 <img src="png/plot.png" alt="Example of Plot()">


<hr size="6">
<a name="Radar-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Plot-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Step-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Radar-sample-1"></a>
<h3 class="subsection">5.5.2 Radar sample</h3>

<p>Command <a href="#radar">radar</a> plot is variant of <code>Plot</code> one, which make plot in polar coordinates and draw radial rays in point directions. If you just need a plot in polar coordinates then I recommend to use <a href="#Curvilinear-coordinates">Curvilinear coordinates</a> or <code>Plot</code> in parabolic form with <code>x=r*cos(fi); y=r*sin(fi);</code>. The sample code is:
</p><pre class="verbatim">new yr 10 3 '0.4*sin(pi*(x+1.5+y/2)+0.1*rnd)'
subplot 1 1 0 '':title 'Radar plot (with grid, &quot;\#&quot;)'
radar yr '#'
</pre>
 <img src="png/radar.png" alt="Example of Radar()">

<hr size="6">
<a name="Step-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Radar-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Tens-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Step-sample-1"></a>
<h3 class="subsection">5.5.3 Step sample</h3>

<p>Command <a href="#step">step</a> plot data as stairs. It have the same options as <code>Plot</code>. The sample code is:
</p><pre class="verbatim">call 'prepare1d'
origin 0 0 0:subplot 2 2 0 '':title 'Step plot (default)':box
step y

new yc 30 'sin(pi*x)':new xc 30 'cos(pi*x)':new z 30 'x'
subplot 2 2 1:title '3d variant':rotate 50 60:box
step xc yc z 'r'

subplot 2 2 2 '':title '&quot;!&quot; style':box
step y 's!rgb'
</pre>
 <img src="png/step.png" alt="Example of Step()">

<hr size="6">
<a name="Tens-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Step-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Area-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Tens-sample-1"></a>
<h3 class="subsection">5.5.4 Tens sample</h3>

<p>Command <a href="#tens">tens</a> is variant of <a href="#plot">plot</a> with smooth coloring along the curves. At this, color is determined as for surfaces (see <a href="#Color-scheme">Color scheme</a>). The sample code is:
</p><pre class="verbatim">call 'prepare1d'
subplot 2 2 0 '':title 'Tens plot (default)':box
tens y(:,0) y(:,1)

subplot 2 2 2 '':title ' style':box
tens y(:,0) y(:,1) 'o '

new yc 30 'sin(pi*x)':new xc 30 'cos(pi*x)':new z 30 'x'
subplot 2 2 1:title '3d variant':rotate 50 60:box
tens xc yc z z 's'
</pre>
 <img src="png/tens.png" alt="Example of Tens()">

<hr size="6">
<a name="Area-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Tens-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Region-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Area-sample-1"></a>
<h3 class="subsection">5.5.5 Area sample</h3>

<p>Command <a href="#area">area</a> fill the area between curve and axis plane. It support gradient filling if 2 colors per curve is specified. The sample code is:
</p><pre class="verbatim">call 'prepare1d'
origin 0 0 0
subplot 2 2 0 '':title 'Area plot (default)':box
area y

subplot 2 2 1 '':title '2 colors':box
area y 'cbgGyr'

subplot 2 2 2 '':title '&quot;!&quot; style':box
area y '!'

new yc 30 'sin(pi*x)':new xc 30 'cos(pi*x)':new z 30 'x'
subplot 2 2 3:title '3d variant':rotate 50 60:box
area xc yc z 'r':area xc -yc z 'b#'
</pre>
 <img src="png/area.png" alt="Example of Area()">

<hr size="6">
<a name="Region-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Area-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Stem-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Region-sample-1"></a>
<h3 class="subsection">5.5.6 Region sample</h3>

<p>Command <a href="#region">region</a> fill the area between 2 curves. It support gradient filling if 2 colors per curve is specified. Also it can fill only the region y1&lt;y&lt;y2 if style &lsquo;<samp>i</samp>&rsquo; is used. The sample code is:
</p><pre class="verbatim">call 'prepare1d'
copy y1 y(:,1):copy y2 y(:,2)
subplot 2 2 0 '':title 'Region plot (default)':box
region y1 y2:plot y1 'k2':plot y2 'k2'

subplot 2 2 1 '':title '2 colors':box
region y1 y2 'yr':plot y1 'k2':plot y2 'k2'

subplot 2 2 2 '':title '&quot;!&quot; style':box
region y1 y2 '!':plot y1 'k2':plot y2 'k2'

subplot 2 2 3 '':title '&quot;i&quot; style':box
region y1 y2 'ir':plot y1 'k2':plot y2 'k2'
</pre>
 <img src="png/region.png" alt="Example of Region()">

<hr size="6">
<a name="Stem-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Region-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Bars-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Stem-sample-1"></a>
<h3 class="subsection">5.5.7 Stem sample</h3>

<p>Command <a href="#stem">stem</a> draw vertical bars. It is most attractive if markers are drawn too. The sample code is:
</p><pre class="verbatim">call 'prepare1d'
origin 0 0 0:subplot 2 2 0 '':title 'Stem plot (default)':box
stem y

new yc 30 'sin(pi*x)':new xc 30 'cos(pi*x)':new z 30 'x'
subplot 2 2 1:title '3d variant':rotate 50 60:box
stem xc yc z 'rx'

subplot 2 2 2 '':title '&quot;!&quot; style':box
stem y 'o!rgb'
</pre>
 <img src="png/stem.png" alt="Example of Stem()">

<hr size="6">
<a name="Bars-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Stem-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Barh-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Bars-sample-1"></a>
<h3 class="subsection">5.5.8 Bars sample</h3>

<p>Command <a href="#bars">bars</a> draw vertical bars. It have a lot of options: bar-above-bar (&lsquo;<samp>a</samp>&rsquo; style), fall like (&lsquo;<samp>f</samp>&rsquo; style), 2 colors for positive and negative values, wired bars (&lsquo;<samp>#</samp>&rsquo; style), 3D variant. The sample code is:
</p><pre class="verbatim">new ys 10 3 '0.8*sin(pi*(x+y/4+1.25))+0.2*rnd':origin 0 0 0
subplot 3 2 0 '':title 'Bars plot (default)':box
bars ys

subplot 3 2 1 '':title '2 colors':box
bars ys 'cbgGyr'

subplot 3 2 4 '':title '&quot;\#&quot; style':box
bars ys '#'

new yc 30 'sin(pi*x)':new xc 30 'cos(pi*x)':new z 30 'x'
subplot 3 2 5:title '3d variant':rotate 50 60:box
bars xc yc z 'r'

subplot 3 2 2 '':title '&quot;a&quot; style':ranges -1 1 -3 3:box
bars ys 'a'

subplot 3 2 3 '':title '&quot;f&quot; style':box
bars ys 'f'
</pre>
 <img src="png/bars.png" alt="Example of Bars()">

<hr size="6">
<a name="Barh-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Bars-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Cones-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Barh-sample-1"></a>
<h3 class="subsection">5.5.9 Barh sample</h3>

<p>Command <a href="#barh">barh</a> is the similar to <code>Bars</code> but draw horizontal bars. The sample code is:
</p><pre class="verbatim">new ys 10 3 '0.8*sin(pi*(x+y/4+1.25))+0.2*rnd':origin 0 0 0
subplot 2 2 0 '':title 'Barh plot (default)':box
barh ys

subplot 2 2 1 '':title '2 colors':box
barh ys 'cbgGyr'

ranges -3 3 -1 1:subplot 2 2 2 '':title '&quot;a&quot; style':box:barh ys 'a'
subplot 2 2 3 '': title '&quot;f&quot; style':box
barh ys 'f'
</pre>
 <img src="png/barh.png" alt="Example of Barh()">

<hr size="6">
<a name="Cones-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Barh-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Chart-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Cones-sample-1"></a>
<h3 class="subsection">5.5.10 Cones sample</h3>

<p>Command <a href="#cones">cones</a> is similar to <code>Bars</code> but draw cones. The sample code is:
</p><pre class="verbatim">new ys 10 3 '0.8*sin(pi*(x+y/4+1.25))+0.2*rnd'
origin 0 0 0:light on
subplot 2 2 0:title 'Cones plot':rotate 50 60:box
cones ys

subplot 2 2 1:title '2 colors':rotate 50 60:box
cones ys 'cbgGyr'

subplot 2 2 2:title '&quot;\#&quot; style':rotate 50 60:box
cones ys '#'

subplot 2 2 3:title '&quot;a&quot; style':rotate 50 60:zrange -2 2:box
cones ys 'a'
</pre>
 <img src="png/cones.png" alt="Example of Cones()">

<hr size="6">
<a name="Chart-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Cones-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#BoxPlot-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Chart-sample-1"></a>
<h3 class="subsection">5.5.11 Chart sample</h3>

<p>Command <a href="#chart">chart</a> draw colored boxes with width proportional to data values. Use &lsquo;<samp> </samp>&rsquo; for empty box. Plot looks most attractive in polar coordinates &ndash; well known pie chart. The sample code is:
</p><pre class="verbatim">new ch 7 2 'rnd+0.1':light on
subplot 2 2 0:title 'Chart plot (default)':rotate 50 60:box
chart ch

subplot 2 2 1:title '&quot;\#&quot; style':rotate 50 60:box
chart ch '#'

subplot 2 2 2:title 'Pie chart; &quot; &quot; color':rotate 50 60:
axis '(y+1)/2*cos(pi*x)' '(y+1)/2*sin(pi*x)' '':box
chart ch 'bgr cmy#'

subplot 2 2 3:title 'Ring chart; &quot; &quot; color':rotate 50 60:
axis '(y+2)/3*cos(pi*x)' '(y+2)/3*sin(pi*x)' '':box
chart ch 'bgr cmy#'
</pre>
 <img src="png/chart.png" alt="Example of Chart()">

<hr size="6">
<a name="BoxPlot-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Chart-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Candle-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="BoxPlot-sample-1"></a>
<h3 class="subsection">5.5.12 BoxPlot sample</h3>

<p>Command <a href="#boxplot">boxplot</a> draw box-and-whisker diagram. The sample code is:
</p><pre class="verbatim">new a 10 7 '(2*rnd-1)^3/2'
subplot 1 1 0 '':title 'Boxplot plot':box
boxplot a
</pre>
 <img src="png/boxplot.png" alt="Example of BoxPlot()">

<hr size="6">
<a name="Candle-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#BoxPlot-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Error-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Candle-sample-1"></a>
<h3 class="subsection">5.5.13 Candle sample</h3>

<p>Command <a href="#candle">candle</a> draw candlestick chart. This is a combination of a line-chart and a bar-chart, in that each bar represents the range of price movement over a given time interval. The sample code is:
</p><pre class="verbatim">new y 30 'sin(pi*x/2)^2':copy y1 y/2:copy y2 (y+1)/2
subplot 1 1 0 '':title 'Candle plot (default)':yrange 0 1:box
candle y y1 y2
</pre>
 <img src="png/candle.png" alt="Example of Candle()">

<hr size="6">
<a name="Error-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Candle-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Mark-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Error-sample-1"></a>
<h3 class="subsection">5.5.14 Error sample</h3>

<p>Command <a href="#error">error</a> draw error boxes around the points. You can draw default boxes or semi-transparent symbol (like marker, see <a href="#Line-styles">Line styles</a>). Also you can set individual color for each box. The sample code is:
</p><pre class="verbatim">call 'prepare1d'
new y 50 '0.7*sin(pi*x-pi) + 0.5*cos(3*pi*(x+1)/2) + 0.2*sin(pi*(x+1)/2)'
new x0 10 'x + 0.1*rnd-0.05':new ex 10 '0.1':new ey 10 '0.2'
new y0 10 '0.7*sin(pi*x-pi) + 0.5*cos(3*pi*(x+1)/2) + 0.2*sin(pi*(x+1)/2) + 0.2*rnd-0.1'

subplot 2 2 0 '':title 'Error plot (default)':box:plot y
error x0 y0 ex ey 'k'

subplot 2 2 1 '':title '&quot;!&quot; style; no e_x':box:plot y
error x0 y0 ey 'o!rgb'

subplot 2 2 2 '':title '&quot;\@&quot; style':box:plot y
error x0 y0 ex ey '@'; alpha 0.5

subplot 2 2 3:title '3d variant':rotate 50 60:axis
for $1 0 9
  errbox 2*rnd-1 2*rnd-1 2*rnd-1 0.2 0.2 0.2 'bo'
next
</pre>
 <img src="png/error.png" alt="Example of Error()">

<hr size="6">
<a name="Mark-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Error-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#TextMark-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Mark-sample-1"></a>
<h3 class="subsection">5.5.15 Mark sample</h3>

<p>Command <a href="#mark">mark</a> draw markers at points. It is mostly the same as <code>Plot</code> but marker size can be variable. The sample code is:
</p><pre class="verbatim">call 'prepare1d'
subplot 1 1 0 '':title 'Mark plot (default)':box
mark y y1 's'
</pre>
 <img src="png/mark.png" alt="Example of Mark()">

<hr size="6">
<a name="TextMark-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Mark-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Label-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="TextMark-sample-1"></a>
<h3 class="subsection">5.5.16 TextMark sample</h3>

<p>Command <a href="#textmark">textmark</a> like <code>Mark</code> but draw text instead of markers. The sample code is:
</p><pre class="verbatim">call 'prepare1d'
subplot 1 1 0 '':title 'TextMark plot (default)':box
textmark y y1 '\gamma' 'r'
</pre>
 <img src="png/textmark.png" alt="Example of TextMark()">

<hr size="6">
<a name="Label-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#TextMark-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Table-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Label-sample-1"></a>
<h3 class="subsection">5.5.17 Label sample</h3>

<p>Command <a href="#label">label</a> print text at data points. The string may contain &lsquo;<samp>%x</samp>&rsquo;, &lsquo;<samp>%y</samp>&rsquo;, &lsquo;<samp>%z</samp>&rsquo; for x-, y-, z-coordinates of points, &lsquo;<samp>%n</samp>&rsquo; for point index. The sample code is:
</p><pre class="verbatim">new ys 10 '0.2*rnd-0.8*sin(pi*x)'
subplot 1 1 0 '':title 'Label plot':box
plot ys ' *':label ys 'y=%y'
</pre>
 <img src="png/label.png" alt="Example of Label()">


<hr size="6">
<a name="Table-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Label-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Tube-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Table-sample-1"></a>
<h3 class="subsection">5.5.18 Table sample</h3>

<p>Command <a href="#table">table</a> draw table with data values. The sample code is:
</p><pre class="verbatim">new ys 10 3 '0.8*sin(pi*(x+y/4+1.25))+0.2*rnd'
subplot 2 2 0:title 'Table sample':box
table ys 'y_1\n{}y_2\n{}y_3'

subplot 2 2 1:title 'no borders, colored'
table ys 'y_1\n{}y_2\n{}y_3' 'r|'

subplot 2 2 2:title 'no font decrease'
table ys 'y_1\n{}y_2\n{}y_3' '#'

subplot 2 2 3:title 'manual width and position':box
table 0.5 0.95 ys 'y_1\n{}y_2\n{}y_3' '#';value 0.7
</pre>
 <img src="png/table.png" alt="Example of Table()">


<hr size="6">
<a name="Tube-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Table-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Tape-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Tube-sample-1"></a>
<h3 class="subsection">5.5.19 Tube sample</h3>

<p>Command <a href="#tube">tube</a> draw tube with variable radius. The sample code is:
</p><pre class="verbatim">light on:call 'prepare1d'
new yc 50 'sin(pi*x)':new xc 50 'cos(pi*x)':new z 50 'x':divto y1 20

subplot 2 2 0 '':title 'Tube plot (default)':box
tube y 0.05

subplot 2 2 1 '':title 'variable radius':box
tube y y1

subplot 2 2 2 '':title '&quot;\#&quot; style':box
tube y 0.05 '#'

subplot 2 2 3:title '3d variant':rotate 50 60:box
tube xc yc z y2 'r'
</pre>
 <img src="png/tube.png" alt="Example of Tube()">


<hr size="6">
<a name="Tape-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Tube-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Torus-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Tape-sample-1"></a>
<h3 class="subsection">5.5.20 Tape sample</h3>

<p>Command <a href="#tape">tape</a> draw tapes which rotate around the curve as normal and binormal. The sample code is:
</p><pre class="verbatim">call 'prepare1d'
new yc 50 'sin(pi*x)':new xc 50 'cos(pi*x)':new z 50 'x'

subplot 2 2 0 '':title 'Tape plot (default)':box
tape y:plot y 'k'

subplot 2 2 1:title '3d variant, 2 colors':rotate 50 60:light on:box
plot xc yc z 'k':tape xc yc z 'rg'

subplot 2 2 2:title '3d variant, x only':rotate 50 60:box
plot xc yc z 'k':tape xc yc z 'xr':tape xc yc z 'xr#'

subplot 2 2 3:title '3d variant, z only':rotate 50 60:box
plot xc yc z 'k':tape xc yc z 'zg':tape xc yc z 'zg#'
</pre>
 <img src="png/tape.png" alt="Example of Tape()">


<hr size="6">
<a name="Torus-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Tape-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t1D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Torus-sample-1"></a>
<h3 class="subsection">5.5.21 Torus sample</h3>

<p>Command <a href="#torus">torus</a> draw surface of the curve rotation. The sample code is:
</p><pre class="verbatim">call 'prepare1d'
subplot 2 2 0:title 'Torus plot (default)':light on:rotate 50 60:box
torus y1 y2

subplot 2 2 1:title '&quot;x&quot; style':light on:rotate 50 60:box
torus y1 y2 'x'

subplot 2 2 2:title '&quot;z&quot; style':light on:rotate 50 60:box
torus y1 y2 'z'

subplot 2 2 3:title '&quot;\#&quot; style':light on:rotate 50 60:box
torus y1 y2 '#'
</pre>
 <img src="png/torus.png" alt="Example of Torus()">



<hr size="6">
<a name="g_t2D-samples"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Torus-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Surf-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="g_t2D-samples-1"></a>
<h2 class="section">5.6 2D samples</h2>

<p>This section is devoted to visualization of 2D data arrays. 2D means the data which depend on 2 indexes (parameters) like matrix z(i,j)=z(x(i),y(j)), i=1...n, j=1...m or in parametric form {x(i,j),y(i,j),z(i,j)}. Most of samples will use the same data for plotting. So, I put its initialization in separate function
</p><pre class="verbatim">func 'prepare2d'
new a 50 40 '0.6*sin(pi*(x+1))*sin(1.5*pi*(y+1))+0.4*cos(0.75*pi*(x+1)*(y+1))'
new b 50 40 '0.6*cos(pi*(x+1))*cos(1.5*pi*(y+1))+0.4*cos(0.75*pi*(x+1)*(y+1))'
return
</pre><p>Basically, you can put this text after the script. Note, that you need to terminate main script by <a href="#stop">stop</a> command before defining a function.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Surf-sample">5.6.1 Surf sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SurfC-sample">5.6.2 SurfC sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SurfA-sample">5.6.3 SurfA sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Mesh-sample">5.6.4 Mesh sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Fall-sample">5.6.5 Fall sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Belt-sample">5.6.6 Belt sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Boxs-sample">5.6.7 Boxs sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Tile-sample">5.6.8 Tile sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#TileS-sample">5.6.9 TileS sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Dens-sample">5.6.10 Dens sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Cont-sample">5.6.11 Cont sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#ContF-sample">5.6.12 ContF sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#ContD-sample">5.6.13 ContD sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#ContV-sample">5.6.14 ContV sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Axial-sample">5.6.15 Axial sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Grad-sample">5.6.16 Grad sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr size="6">
<a name="Surf-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#g_t2D-samples" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SurfC-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Surf-sample-1"></a>
<h3 class="subsection">5.6.1 Surf sample</h3>

<p>Command <a href="#surf">surf</a> is most standard way to visualize 2D data array. <code>Surf</code> use color scheme for coloring (see <a href="#Color-scheme">Color scheme</a>). You can use &lsquo;<samp>#</samp>&rsquo; style for drawing black meshes on the surface. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
subplot 2 2 0:title 'Surf plot (default)':rotate 50 60:light on:box:surf a

subplot 2 2 1:title '&quot;\#&quot; style; meshnum 10':rotate 50 60:box
surf a '#'; meshnum 10

subplot 2 2 2:title '&quot;.&quot; style':rotate 50 60:box
surf a '.'

new x 50 40 '0.8*sin(pi*x)*sin(pi*(y+1)/2)'
new y 50 40 '0.8*cos(pi*x)*sin(pi*(y+1)/2)'
new z 50 40 '0.8*cos(pi*(y+1)/2)'
subplot 2 2 3:title 'parametric form':rotate 50 60:box
surf x y z 'BbwrR'
</pre>
 <img src="png/surf.png" alt="Example of Surf()">

<hr size="6">
<a name="SurfC-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Surf-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SurfA-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="SurfC-sample-1"></a>
<h3 class="subsection">5.6.2 SurfC sample</h3>

<p>Command <a href="#surfc">surfc</a> is similar to <a href="#surf">surf</a> but its coloring is determined by another data. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
title 'SurfC plot':rotate 50 60:light on:box
surfc a b
</pre>
 <img src="png/surfc.png" alt="Example of SurfC()">

<hr size="6">
<a name="SurfA-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SurfC-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Mesh-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="SurfA-sample-1"></a>
<h3 class="subsection">5.6.3 SurfA sample</h3>

<p>Command <a href="#surfa">surfa</a> is similar to <a href="#surf">surf</a> but its transparency is determined by another data. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
title 'SurfC plot':rotate 50 60:light on:alpha on:box
surfa a b
</pre>
 <img src="png/surfa.png" alt="Example of SurfA()">


<hr size="6">
<a name="Mesh-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SurfA-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Fall-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Mesh-sample-1"></a>
<h3 class="subsection">5.6.4 Mesh sample</h3>

<p>Command <a href="#mesh">mesh</a> draw wired surface. You can use <a href="#meshnum">meshnum</a> for changing number of lines to be drawn. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
title 'Mesh plot':rotate 50 60:box
mesh a
</pre>
 <img src="png/mesh.png" alt="Example of Mesh()">

<hr size="6">
<a name="Fall-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Mesh-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Belt-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Fall-sample-1"></a>
<h3 class="subsection">5.6.5 Fall sample</h3>

<p>Command <a href="#fall">fall</a> draw waterfall surface. You can use <a href="#meshnum">meshnum</a> for changing number of lines to be drawn. Also you can use &lsquo;<samp>x</samp>&rsquo; style for drawing lines in other direction. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
title 'Fall plot':rotate 50 60:box
fall a
</pre>
 <img src="png/fall.png" alt="Example of Fall()">

<hr size="6">
<a name="Belt-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Fall-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Boxs-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Belt-sample-1"></a>
<h3 class="subsection">5.6.6 Belt sample</h3>

<p>Command <a href="#belt">belt</a> draw surface by belts. You can use &lsquo;<samp>x</samp>&rsquo; style for drawing lines in other direction. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
title 'Belt plot':rotate 50 60:box
belt a
</pre>
 <img src="png/belt.png" alt="Example of Belt()">

<hr size="6">
<a name="Boxs-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Belt-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Tile-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Boxs-sample-1"></a>
<h3 class="subsection">5.6.7 Boxs sample</h3>

<p>Command <a href="#boxs">boxs</a> draw surface by boxes. You can use &lsquo;<samp>#</samp>&rsquo; for drawing wire plot. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
origin 0 0 0
subplot 2 2 0:title 'Boxs plot (default)':rotate 40 60:light on:box
boxs a

subplot 2 2 1:title '&quot;\@&quot; style':rotate 50 60:box
boxs a '@'

subplot 2 2 2:title '&quot;\#&quot; style':rotate 50 60:box
boxs a '#'

subplot 2 2 3:title 'compare with Tile':rotate 50 60:box
tile a
</pre>
 <img src="png/boxs.png" alt="Example of Boxs()">

<hr size="6">
<a name="Tile-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Boxs-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#TileS-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Tile-sample-1"></a>
<h3 class="subsection">5.6.8 Tile sample</h3>

<p>Command <a href="#tile">tile</a> draw surface by tiles. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
subplot 1 1 0 '':title 'Tiles plot':box
tile a
</pre>
 <img src="png/tile.png" alt="Example of Tile()">

<hr size="6">
<a name="TileS-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Tile-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Dens-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="TileS-sample-1"></a>
<h3 class="subsection">5.6.9 TileS sample</h3>

<p>Command <a href="#tiles">tiles</a> is similar to <a href="#tile">tile</a> but tile sizes is determined by another data. This allows one to simulate transparency of the plot. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
subplot 1 1 0 '':title 'Tiles plot':box
tiles a b
</pre>
 <img src="png/tiles.png" alt="Example of TileS()">


<hr size="6">
<a name="Dens-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#TileS-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Cont-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Dens-sample-1"></a>
<h3 class="subsection">5.6.10 Dens sample</h3>

<p>Command <a href="#dens">dens</a> draw density plot for surface. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
subplot 2 2 0 '':title 'Dens plot (default)':box
dens a

subplot 2 2 1:title '3d variant':rotate 50 60:box
dens a

subplot 2 2 2 '':title '&quot;\#&quot; style; meshnum 10':box
dens a '#'; meshnum 10

new a1 30 40 3 '0.6*sin(2*pi*x+pi*(z+1)/2)*sin(3*pi*y+pi*z) +\
 0.4*cos(3*pi*(x*y)+pi*(z+1)^2/2)'
subplot 2 2 3:title 'several slices':rotate 50 60:box
dens a1
</pre>
 <img src="png/dens.png" alt="Example of Dens()">

<hr size="6">
<a name="Cont-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Dens-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#ContF-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Cont-sample-1"></a>
<h3 class="subsection">5.6.11 Cont sample</h3>

<p>Command <a href="#cont">cont</a> draw contour lines for surface. You can select automatic (default) or manual levels for contours, print contour labels, draw it on the surface (default) or at plane (as <code>Dens</code>). The sample code is:
</p><pre class="verbatim">call 'prepare2d'
list v -0.5 -0.15 0 0.15 0.5
subplot 2 2 0:title 'Cont plot (default)':rotate 50 60:box
cont a

subplot 2 2 1:title 'manual levels':rotate 50 60:box
cont v a

subplot 2 2 2:title '&quot;\_&quot; style':rotate 50 60:box
cont a '_'

subplot 2 2 3 '':title '&quot;t&quot; style':box
cont a 't'
</pre>
 <img src="png/cont.png" alt="Example of Cont()">

<hr size="6">
<a name="ContF-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Cont-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#ContD-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="ContF-sample-1"></a>
<h3 class="subsection">5.6.12 ContF sample</h3>

<p>Command <a href="#contf">contf</a> draw filled contours.  You can select automatic (default) or manual levels for contours. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
list v -0.5 -0.15 0 0.15 0.5
subplot 2 2 0:title 'ContF plot (default)':rotate 50 60:box
contf a

subplot 2 2 1:title 'manual levels':rotate 50 60:box
contf v a

subplot 2 2 2:title '&quot;\_&quot; style':rotate 50 60:box
contf a '_'

new a1 30 40 3 '0.6*sin(2*pi*x+pi*(z+1)/2)*sin(3*pi*y+pi*z) +\
 0.4*cos(3*pi*(x*y)+pi*(z+1)^2/2)'
subplot 2 2 3:title 'several slices':rotate 50 60:box
contf a1
</pre>
 <img src="png/contf.png" alt="Example of ContF()">

<hr size="6">
<a name="ContD-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#ContF-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#ContV-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="ContD-sample-1"></a>
<h3 class="subsection">5.6.13 ContD sample</h3>

<p>Command <a href="#contd">contd</a> is similar to <code>ContF</code> but with manual contour colors. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
list v -0.5 -0.15 0 0.15 0.5
subplot 2 2 0:title 'ContD plot (default)':rotate 50 60:box
contd a

subplot 2 2 1:title 'manual levels':rotate 50 60:box
contd v a

subplot 2 2 2:title '&quot;\_&quot; style':rotate 50 60:box
contd a '_'

new a1 30 40 3 '0.6*sin(2*pi*x+pi*(z+1)/2)*sin(3*pi*y+pi*z) +\
 0.4*cos(3*pi*(x*y)+pi*(z+1)^2/2)'
subplot 2 2 3:title 'several slices':rotate 50 60:box
contd a1
</pre>
 <img src="png/contd.png" alt="Example of ContD()">

<hr size="6">
<a name="ContV-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#ContD-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Axial-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="ContV-sample-1"></a>
<h3 class="subsection">5.6.14 ContV sample</h3>

<p>Command <a href="#contv">contv</a> draw vertical cylinders (belts) at contour lines. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
list v -0.5 -0.15 0 0.15 0.5
subplot 2 2 0:title 'ContV plot (default)':rotate 50 60:box
contv a

subplot 2 2 1:title 'manual levels':rotate 50 60:box
contv v a

subplot 2 2 2:title '&quot;\_&quot; style':rotate 50 60:box
contv a '_'

subplot 2 2 3:title 'ContV and ContF':rotate 50 60:light on:box
contv a:contf a:cont a 'k'
</pre>
 <img src="png/contv.png" alt="Example of ContV()">

<hr size="6">
<a name="Axial-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#ContV-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Grad-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Axial-sample-1"></a>
<h3 class="subsection">5.6.15 Axial sample</h3>

<p>Command <a href="#axial">axial</a> draw surfaces of rotation for contour lines. You can draw wire surfaces (&lsquo;<samp>#</samp>&rsquo; style) or ones rotated in other directions (&lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo; styles). The sample code is:
</p><pre class="verbatim">light on:alpha on:call 'prepare2d'
subplot 2 2 0:title 'Axial plot (default)':rotate 50 60:box
axial a

subplot 2 2 1:title '&quot;x&quot; style;\&quot;.\&quot; style':light on:rotate 50 60:box
axial a 'x.'

subplot 2 2 2:title '&quot;z&quot; style':light on:rotate 50 60:box
axial a 'z'

subplot 2 2 3:title '&quot;\#&quot; style':light on:rotate 50 60:box
axial a '#'
</pre>
 <img src="png/axial.png" alt="Example of Axial()">

<hr size="6">
<a name="Grad-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Axial-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-samples" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t2D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Grad-sample-1"></a>
<h3 class="subsection">5.6.16 Grad sample</h3>

<p>Command <a href="#grad">grad</a> draw gradient lines for matrix. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
subplot 1 1 0 '':title 'Grad plot':box
grad a:dens a '{u8}w{q8}'
</pre>
 <img src="png/grad.png" alt="Example of Grad()">



<hr size="6">
<a name="g_t3D-samples"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Grad-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Surf3-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="g_t3D-samples-1"></a>
<h2 class="section">5.7 3D samples</h2>

<p>This section is devoted to visualization of 3D data arrays. 3D means the data which depend on 3 indexes (parameters) like tensor a(i,j,k)=a(x(i),y(j),x(k)), i=1...n, j=1...m, k=1...l or in parametric form {x(i,j,k),y(i,j,k),z(i,j,k),a(i,j,k)}. Most of samples will use the same data for plotting. So, I put its initialization in separate function
</p><pre class="verbatim">func 'prepare3d'
new c 61 50 40 '-2*(x^2+y^2+z^4-z^2)+0.2'
new d 61 50 40 '1-2*tanh((x+y)*(x+y))'
return
</pre><p>Basically, you can put this text after the script. Note, that you need to terminate main script by <a href="#stop">stop</a> command before defining a function.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Surf3-sample">5.7.1 Surf3 sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Surf3C-sample">5.7.2 Surf3C sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Surf3A-sample">5.7.3 Surf3A sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Cloud-sample">5.7.4 Cloud sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Dens3-sample">5.7.5 Dens3 sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Cont3-sample">5.7.6 Cont3 sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#ContF3-sample">5.7.7 ContF3 sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Dens-projection-sample">5.7.8 Dens projection sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Cont-projection-sample">5.7.9 Cont projection sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#ContF-projection-sample">5.7.10 ContF projection sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#TriPlot-and-QuadPlot">5.7.11 TriPlot and QuadPlot</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Dots-sample">5.7.12 Dots sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr size="6">
<a name="Surf3-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#g_t3D-samples" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Surf3C-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Surf3-sample-1"></a>
<h3 class="subsection">5.7.1 Surf3 sample</h3>

<p>Command <a href="#surf3">surf3</a> is one of most suitable (for my opinion) functions to visualize 3D data. It draw the isosurface(s) &ndash; surface(s) of constant amplitude (3D analogue of contour lines). You can draw wired isosurfaces if specify &lsquo;<samp>#</samp>&rsquo; style. The sample code is:
</p><pre class="verbatim">call 'prepare3d'
light on:alpha on
subplot 2 2 1:title 'Surf3 plot':rotate 50 60:box
surf3 c

subplot 2 2 1:title '&quot;\#&quot; style':rotate 50 60:box
surf3 c '#'

subplot 2 2 2:title '&quot;.&quot; style':rotate 50 60:box
surf3 c '.'
</pre>
 <img src="png/surf3.png" alt="Example of Surf3()">

<hr size="6">
<a name="Surf3C-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Surf3-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Surf3A-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Surf3C-sample-1"></a>
<h3 class="subsection">5.7.2 Surf3C sample</h3>

<p>Command <a href="#surf3c">surf3c</a> is similar to <a href="#surf3">surf3</a> but its coloring is determined by another data. The sample code is:
</p><pre class="verbatim">call 'prepare3d'
title 'Surf3 plot':rotate 50 60:light on:alpha on:box
surf3c c d
</pre>
 <img src="png/surf3c.png" alt="Example of Surf3C()">

<hr size="6">
<a name="Surf3A-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Surf3C-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Cloud-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Surf3A-sample-1"></a>
<h3 class="subsection">5.7.3 Surf3A sample</h3>

<p>Command <a href="#surf3a">surf3a</a> is similar to <a href="#surf3">surf3</a> but its transparency is determined by another data. The sample code is:
</p><pre class="verbatim">call 'prepare3d'
title 'Surf3 plot':rotate 50 60:light on:alpha on:box
surf3a c d
</pre>
 <img src="png/surf3a.png" alt="Example of Surf3A()">

<hr size="6">
<a name="Cloud-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Surf3A-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Dens3-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Cloud-sample-1"></a>
<h3 class="subsection">5.7.4 Cloud sample</h3>

<p>Command <a href="#cloud">cloud</a> draw cloud-like object which is less transparent for higher data values. Similar plot can be created using many (about 10-20) <code>Surf3A(a,a)</code> isosurfaces. The sample code is:
</p><pre class="verbatim">call 'prepare3d'
subplot 2 2 0:title 'Cloud plot':rotate 50 60:alpha on:box
cloud c 'wyrRk'

subplot 2 2 1:title '&quot;!&quot; style':rotate 50 60:box
cloud c '!wyrRk'

subplot 2 2 2:title '&quot;.&quot; style':rotate 50 60:box
cloud c '.wyrRk'

subplot 2 2 3:title 'meshnum 10':rotate 50 60:box
cloud c 'wyrRk'; meshnum 10
</pre>
 <img src="png/cloud.png" alt="Example of Cloud()">

<hr size="6">
<a name="Dens3-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Cloud-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Cont3-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Dens3-sample-1"></a>
<h3 class="subsection">5.7.5 Dens3 sample</h3>

<p>Command <a href="#dens3">dens3</a> draw just usual density plot but at slices of 3D data. The sample code is:
</p><pre class="verbatim">call 'prepare3d'
title 'Dens3 sample':rotate 50 60:alpha on:alphadef 0.7
origin 0 0 0:box:axis '_xyz'
dens3 c 'x':dens3 c ':y':dens3 c 'z'
</pre>
 <img src="png/densa.png" alt="Example of Dens3()">

<hr size="6">
<a name="Cont3-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Dens3-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#ContF3-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Cont3-sample-1"></a>
<h3 class="subsection">5.7.6 Cont3 sample</h3>

<p>Command <a href="#cont3">cont3</a> draw just usual contour lines but at slices of 3D data. The sample code is:
</p><pre class="verbatim">call 'prepare3d'
title 'Cont3 sample':rotate 50 60:box
cont3 c 'x':cont3 c:cont3 c 'z'
</pre>
 <img src="png/conta.png" alt="Example of Cont3()">

<hr size="6">
<a name="ContF3-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Cont3-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Dens-projection-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="ContF3-sample-1"></a>
<h3 class="subsection">5.7.7 ContF3 sample</h3>

<p>Command <a href="#contf3">contf3</a> draw just usual filled contours but at slices of 3D data. The sample code is:
</p><pre class="verbatim">call 'prepare3d'
title 'Cont3 sample':rotate 50 60:box:light on
contf3 c 'x':contf3 c:contf3 c 'z'
cont3 c 'xk':cont3 c 'k':cont3 c 'zk'
</pre>
 <img src="png/contfa.png" alt="Example of ContF3()">

<hr size="6">
<a name="Dens-projection-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#ContF3-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Cont-projection-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Dens-projection-sample-1"></a>
<h3 class="subsection">5.7.8 Dens projection sample</h3>

<p>Functions <a href="#DensXYZ">DensXYZ</a> draw density plot on plane perpendicular to corresponding axis. One of possible application is drawing projections of 3D field. The sample code is:
</p><pre class="verbatim">call 'prepare3d'
title 'Dens[XYZ] sample':rotate 50 60:box
densx {sum c 'x'} '' -1
densy {sum c 'y'} '' 1
densz {sum c 'z'} '' -1
</pre>
 <img src="png/dens_xyz.png" alt="{Example of DensX()">

<hr size="6">
<a name="Cont-projection-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Dens-projection-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#ContF-projection-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Cont-projection-sample-1"></a>
<h3 class="subsection">5.7.9 Cont projection sample</h3>

<p>Functions <a href="#ContXYZ">ContXYZ</a> draw contour lines on plane perpendicular to corresponding axis. One of possible application is drawing projections of 3D field. The sample code is:
</p><pre class="verbatim">call 'prepare3d'
title 'Cont[XYZ] sample':rotate 50 60:box
contx {sum c 'x'} '' -1
conty {sum c 'y'} '' 1
contz {sum c 'z'} '' -1
</pre>
 <img src="png/cont_xyz.png" alt="{Example of ContX()">

<hr size="6">
<a name="ContF-projection-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Cont-projection-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#TriPlot-and-QuadPlot" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="ContF-projection-sample-1"></a>
<h3 class="subsection">5.7.10 ContF projection sample</h3>

<p>Functions <code>ContFXYZ</code> draw filled contours on plane perpendicular to corresponding axis. One of possible application is drawing projections of 3D field. The sample code is:
</p><pre class="verbatim">call 'prepare3d'
title 'ContF[XYZ] sample':rotate 50 60:box
contfx {sum c 'x'} '' -1
contfy {sum c 'y'} '' 1
contfz {sum c 'z'} '' -1
</pre>
 <img src="png/contf_xyz.png" alt="{Example of ContFX()">

<hr size="6">
<a name="TriPlot-and-QuadPlot"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#ContF-projection-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Dots-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="TriPlot-and-QuadPlot-1"></a>
<h3 class="subsection">5.7.11 TriPlot and QuadPlot</h3>

<p>Command <a href="#triplot">triplot</a> and <a href="#quadplot">quadplot</a> draw set of triangles (or quadrangles for <code>QuadPlot</code>) for irregular data arrays. Note, that you have to provide not only vertexes, but also the indexes of triangles or quadrangles. I.e. perform triangulation by some other library. The sample code is:
</p><pre class="verbatim">list q 0 1 2 3 | 4 5 6 7 | 0 2 4 6 | 1 3 5 7 | 0 4 1 5 | 2 6 3 7
list xq -1 1 -1 1 -1 1 -1 1
list yq -1 -1 1 1 -1 -1 1 1
list zq -1 -1 -1 -1 1 1 1 1
light on
subplot 2 2 0:title 'QuadPlot sample':rotate 50 60
quadplot q xq yq zq 'yr'
quadplot q xq yq zq '#k'

subplot 2 2 2:title 'QuadPlot coloring':rotate 50 60
quadplot q xq yq zq yq 'yr'
quadplot q xq yq zq '#k'

list t 0 1 2 | 0 1 3 | 0 2 3 | 1 2 3
list xt -1 1 0 0
list yt -1 -1 1 0
list zt -1 -1 -1 1
subplot 2 2 1:title 'TriPlot sample':rotate 50 60
triplot t xt yt zt 'b'
triplot t xt yt zt '#k'

subplot 2 2 3:title 'TriPlot coloring':rotate 50 60
triplot t xt yt zt yt 'cb'
triplot t xt yt zt '#k'
tricont t xt yt zt 'B'
</pre>
 <img src="png/triplot.png" alt="Example of TriPlot() and QuadPlot()">

<hr size="6">
<a name="Dots-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#TriPlot-and-QuadPlot" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Vector-field-samples" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t3D-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Dots-sample-1"></a>
<h3 class="subsection">5.7.12 Dots sample</h3>

<p>Command <a href="#dots">dots</a> is another way to draw irregular points. <code>Dots</code> use color scheme for coloring (see <a href="#Color-scheme">Color scheme</a>). The sample code is:
</p><pre class="verbatim">new t 1000 'pi*(rnd-0.5)':new f 1000 '2*pi*rnd'
copy x 0.9*cos(t)*cos(f)
copy y 0.9*cos(t)*sin(f)
copy z 0.6*sin(t)
title 'Dots sample':rotate 50 60:box
dots x y z
</pre>
 <img src="png/dots.png" alt="Example of Dots()">


<hr size="6">
<a name="Vector-field-samples"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Dots-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Vect-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Vector-field-samples-1"></a>
<h2 class="section">5.8 Vector field samples</h2>

<p>Vector field visualization (especially in 3d case) is more or less complex task. MathGL provides 3 general types of plots: vector field itself (<code>Vect</code>), flow threads (<code>Flow</code>), and flow pipes with radius proportional to field amplitude (<code>Pipe</code>).
</p>
<p>However, the plot may look tangly &ndash; there are too many overlapping lines. I may suggest 2 ways to solve this problem. The first one is to change <code>SetMeshNum</code> for decreasing the number of hachures. The second way is to use the flow thread chart <code>Flow</code>, or possible many flow thread from manual position (<code>FlowP</code>). Unfortunately, I don&rsquo;t know any other methods to visualize 3d vector field. If you know any, e-mail me and I shall add it to MathGL.
</p>
<p>Most of samples will use the same data for plotting. So, I put its initialization in separate function
</p><pre class="verbatim">func 'prepare2v'
new a 20 30 '0.6*sin(pi*(x+1))*sin(1.5*pi*(y+1))+0.4*cos(0.75*pi*(x+1)*(y+1))'
new b 20 30 '0.6*cos(pi*(x+1))*cos(1.5*pi*(y+1))+0.4*cos(0.75*pi*(x+1)*(y+1))'
return

func 'prepare3v'
define $1 pow(x*x+y*y+(z-0.3)*(z-0.3)+0.03,1.5)
define $2 pow(x*x+y*y+(z+0.3)*(z+0.3)+0.03,1.5)
new ex 10 10 10 '0.2*x/$1-0.2*x/$2'
new ey 10 10 10 '0.2*y/$1-0.2*y/$2'
new ez 10 10 10 '0.2*(z-0.3)/$1-0.2*(z+0.3)/$2'
return
</pre><p>Basically, you can put this text after the script. Note, that you need to terminate main script by <a href="#stop">stop</a> command before defining a function.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Vect-sample">5.8.1 Vect sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Vect3-sample">5.8.2 Vect3 sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Traj-sample">5.8.3 Traj sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Flow-sample">5.8.4 Flow sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Pipe-sample">5.8.5 Pipe sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Dew-sample">5.8.6 Dew sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>


<hr size="6">
<a name="Vect-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Vector-field-samples" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Vect3-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Vector-field-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Vect-sample-1"></a>
<h3 class="subsection">5.8.1 Vect sample</h3>

<p>Command <a href="#vect">vect</a> is most standard way to visualize vector fields &ndash; it draw a lot of arrows or hachures for each data cell. It have a lot of options which can be seen on the figure (and in the sample code). <code>Vect</code> use color scheme for coloring (see <a href="#Color-scheme">Color scheme</a>). The sample code is:
</p><pre class="verbatim">call 'prepare2v'
subplot 3 2 0 '':title 'Vect plot (default)':box
vect a b

subplot 3 2 1 '':title '&quot;.&quot; style; &quot;=&quot; style':box
vect a b '.='

subplot 3 2 2 '':title '&quot;f&quot; style':box
vect a b 'f'

subplot 3 2 3 '':title '&quot;&gt;&quot; style':box
vect a b '&gt;'

subplot 3 2 4 '':title '&quot;&lt;&quot; style':box
vect a b '&lt;'

call 'prepare3v'
subplot 3 2 5:title '3d variant':rotate 50 60:box
vect ex ey ez
</pre>
 <img src="png/vect.png" alt="Example of Vect()">

<hr size="6">
<a name="Vect3-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Vect-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Traj-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Vector-field-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Vect3-sample-1"></a>
<h3 class="subsection">5.8.2 Vect3 sample</h3>

<p>Command <a href="#vect3">vect3</a> draw just usual vector field plot but at slices of 3D data. The sample code is:
</p><pre class="verbatim">origin 0 0 0:call 'prepare3v'
subplot 2 1 0:title 'Vect3 sample':rotate 50 60
box:axis '_xyz'
vect3 ex ey ez 'x':vect3 ex ey ez:vect3 ex ey ez 'z'

subplot 2 1 1:title '&quot;f&quot; style':rotate 50 60
box:axis '_xyz'
vect3 ex ey ez 'fx':vect3 ex ey ez 'f':vect3 ex ey ez 'fz'
grid3 ex 'Wx':grid3 ex 'W':grid3 ex 'Wz'
</pre>
 <img src="png/vecta.png" alt="Example of Vect3()">

<hr size="6">
<a name="Traj-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Vect3-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Flow-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Vector-field-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Traj-sample-1"></a>
<h3 class="subsection">5.8.3 Traj sample</h3>

<p>Command <a href="#traj">traj</a> is 1D analogue of <code>Vect</code>. It draw vectors from specified points. The sample code is:
</p><pre class="verbatim">call 'prepare1d'
subplot 1 1 0 '':title 'Traj plot':box
plot x1 y:traj x1 y y1 y2
</pre>
 <img src="png/traj.png" alt="Example of Traj()">


<hr size="6">
<a name="Flow-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Traj-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Pipe-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Vector-field-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Flow-sample-1"></a>
<h3 class="subsection">5.8.4 Flow sample</h3>

<p>Command <a href="#flow">flow</a> is another standard way to visualize vector fields &ndash; it draw lines (threads) which is tangent to local vector field direction. MathGL draw threads from edges of bounding box and from central slices. Sometimes it is not most appropriate variant &ndash; you may want to use <code>FlowP</code> to specify manual position of threads. <code>Flow</code> use color scheme for coloring (see <a href="#Color-scheme">Color scheme</a>). At this warm color corresponds to normal flow (like attractor), cold one corresponds to inverse flow (like source). The sample code is:
</p><pre class="verbatim">call 'prepare2v'
subplot 2 2 0 '':title 'Flow plot (default)':box
flow a b

subplot 2 2 1 '':title '&quot;v&quot; style':box
flow a b 'v'

subplot 2 2 2 '':title 'from edges only':box
flow a b '#'

call 'prepare3v'
subplot 2 2 3:title '3d variant':rotate 50 60:box
flow ex ey ez
</pre>
 <img src="png/flow.png" alt="Example of Flow()">

<hr size="6">
<a name="Pipe-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Flow-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Dew-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Vector-field-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Pipe-sample-1"></a>
<h3 class="subsection">5.8.5 Pipe sample</h3>

<p>Command <a href="#pipe">pipe</a> is similar to <a href="#flow">flow</a> but draw pipes (tubes) which radius is proportional to the amplitude of vector field. <code>Pipe</code> use color scheme for coloring (see <a href="#Color-scheme">Color scheme</a>). At this warm color corresponds to normal flow (like attractor), cold one corresponds to inverse flow (like source). The sample code is:
</p><pre class="verbatim">call 'prepare2v'
subplot 2 2 0 '':title 'Pipe plot (default)':light on:box
pipe a b

subplot 2 2 1 '':title '&quot;i&quot; style':box
pipe a b 'i'

subplot 2 2 2 '':title 'from edges only':box
pipe a b '#'

call 'prepare3v'
subplot 2 2 3:title '3d variant':rotate 50 60:box
pipe ex ey ez '' 0.1
</pre>
 <img src="png/pipe.png" alt="Example of Pipe()">

<hr size="6">
<a name="Dew-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Pipe-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Vector-field-samples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Dew-sample-1"></a>
<h3 class="subsection">5.8.6 Dew sample</h3>

<p>Command <a href="#dew">dew</a> is similar to <code>Vect</code> but use drops instead of arrows. The sample code is:
</p><pre class="verbatim">call 'prepare2v'
subplot 1 1 0 '':title 'Dew plot':light on:box
dew a b
</pre>
 <img src="png/dew.png" alt="Example of Dew()">



<hr size="6">
<a name="Hints"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Dew-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t_0060_0060Compound_0027_0027-graphics" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Hints-1"></a>
<h2 class="section">5.9 Hints</h2>

<p>In this section I&rsquo;ve included some small hints and advices for the improving of the quality of plots and for the demonstration of some non-trivial features of MathGL library. In contrast to previous examples I showed mostly the idea but not the whole drawing function.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#g_t_0060_0060Compound_0027_0027-graphics">5.9.1 &ldquo;Compound&rdquo; graphics</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Transparency-and-lighting">5.9.2 Transparency and lighting</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Types-of-transparency">5.9.3 Types of transparency</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Axis-projection">5.9.4 Axis projection</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Adding-fog">5.9.5 Adding fog</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Several-light-sources">5.9.6 Several light sources</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Using-primitives">5.9.7 Using primitives</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#STFA-sample">5.9.8 STFA sample</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Mapping-visualization">5.9.9 Mapping visualization</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Making-histogram">5.9.10 Making histogram</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Nonlinear-fitting-sample">5.9.11 Nonlinear fitting hints</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#PDE-solving-hints">5.9.12 PDE solving hints</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#MGL-parser-using">5.9.13 MGL parser using</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Using-options">5.9.14 Using options</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#g_t_0060_0060Templates_0027_0027">5.9.15 &ldquo;Templates&rdquo;</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Stereo-image">5.9.16 Stereo image</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Reduce-memory-usage">5.9.17 Reduce memory usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr size="6">
<a name="g_t_0060_0060Compound_0027_0027-graphics"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Hints" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Transparency-and-lighting" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="g_t_0060_0060Compound_0027_0027-graphics-1"></a>
<h3 class="subsection">5.9.1 &ldquo;Compound&rdquo; graphics</h3>

<p>As I noted above, MathGL functions (except the special one, like Clf()) do  not erase the previous plotting but just add the new one. It allows one to draw &ldquo;compound&rdquo; plots easily. For example, popular Matlab command <code>surfc</code> can be emulated in MathGL by 2 calls:
</p><pre class="verbatim">  Surf(a);
  Cont(a, &quot;_&quot;);     // draw contours at bottom
</pre><p>Here <var>a</var> is 2-dimensional data for the plotting, <code>-1</code> is the value of z-coordinate at which the contour should be plotted (at the bottom in this example). Analogously, one can draw density plot instead of contour lines and so on.
</p>
<p>Another nice plot is contour lines plotted directly on the surface:
</p><pre class="verbatim">  Light(true);       // switch on light for the surface
  Surf(a, &quot;BbcyrR&quot;); // select 'jet' colormap for the surface
  Cont(a, &quot;y&quot;);      // and yellow color for contours
</pre><p>The possible difficulties arise in black&amp;white case, when the color of the surface can be close to the color of a contour line. In that case I may suggest the following code:
</p><pre class="verbatim">  Light(true);   // switch on light for the surface
  Surf(a, &quot;kw&quot;); // select 'gray' colormap for the surface
  CAxis(-1,0);   // first draw for darker surface colors
  Cont(a, &quot;w&quot;);  // white contours
  CAxis(0,1);    // now draw for brighter surface colors
  Cont(a, &quot;k&quot;);  // black contours
  CAxis(-1,1);   // return color range to original state
</pre><p>The idea is to divide the color range on 2 parts (dark and bright) and to select the contrasting color for contour lines for each of part.
</p>
<p>Similarly, one can plot flow thread over density plot of vector field amplitude (this is another amusing plot from Matlab) and so on. The list of compound graphics can be prolonged but I hope that the general idea is clear.
</p>
<p>Just for illustration I put here following sample code:
</p><pre class="verbatim">call 'prepare2v'
call 'prepare3d'
new v 10:fill v -0.5 1:copy d sqrt(a^2+b^2)
subplot 2 2 0:title 'Surf + Cont':rotate 50 60:light on:box
surf a:cont a 'y'

subplot 2 2 1 '':title 'Flow + Dens':light off:box
flow a b 'br':dens d

subplot 2 2 2:title 'Mesh + Cont':rotate 50 60:box
mesh a:cont a '_'

subplot 2 2 3:title 'Surf3 + ContF3':rotate 50 60:light on
box:contf3 v c 'z' 0:contf3 v c 'x':contf3 v c
cut 0 -1 -1 1 0 1.1
contf3 v c 'z' c.nz-1:surf3 c -0.5
</pre>
 <img src="png/combined.png" alt="Example of &ldquo;combined&rdquo; plots">

<hr size="6">
<a name="Transparency-and-lighting"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#g_t_0060_0060Compound_0027_0027-graphics" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Types-of-transparency" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Transparency-and-lighting-1"></a>
<h3 class="subsection">5.9.2 Transparency and lighting</h3>

<p>Here I want to show how transparency and lighting both and separately change the look of a surface. So, there is code and picture for that:
</p><pre class="verbatim">call 'prepare2d'
subplot 2 2 0:title 'default':rotate 50 60:box
surf a

subplot 2 2 1:title 'light on':rotate 50 60:box
light on:surf a

subplot 2 2 3:title 'light on; alpha on':rotate 50 60:box
alpha on:surf a

subplot 2 2 2:title 'alpha on':rotate 50 60:box
light off:surf a
</pre>
 <img src="png/alpha.png" alt="Example of transparency and lightings">

<hr size="6">
<a name="Types-of-transparency"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Transparency-and-lighting" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Axis-projection" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Types-of-transparency-1"></a>
<h3 class="subsection">5.9.3 Types of transparency</h3>

<p>MathGL library has advanced features for setting and handling the surface transparency. The simplest way to add transparency is the using of command <a href="#alpha">alpha</a>. As a result, all further surfaces (and isosurfaces, density plots and so on) become transparent. However, their  look can be additionally improved.
</p>
<p>The value of transparency can be different from surface to surface. To do it just use <code>SetAlphaDef</code> before the drawing of the surface, or use option <code>alpha</code> (see <a href="#Command-options">Command options</a>). If its value is close to 0 then the surface becomes more and more transparent. Contrary, if its value is close to 1 then the surface becomes practically non-transparent.
</p>
<p>Also you can change the way how the light goes through overlapped surfaces. The function <code>SetTranspType</code> defines it. By default the usual transparency is used (&lsquo;<samp>0</samp>&rsquo;) &ndash; surfaces below is less visible than the upper ones. A &ldquo;glass-like&rdquo; transparency (&lsquo;<samp>1</samp>&rsquo;) has a different look &ndash; each surface just decreases the background light (the surfaces are commutable in this case).
</p>
<p>A &ldquo;neon-like&rdquo; transparency (&lsquo;<samp>2</samp>&rsquo;) has more interesting look. In this case a surface is the light source (like a lamp on the dark background) and just adds some intensity to the color. At this, the library sets automatically the black color for the background and changes the default line color to white.
</p>
<p>As example I shall show several plots for different types of transparency. The code is the same except the values of <code>SetTranspType</code> function:
</p><pre class="verbatim">call 'prepare2d'
alpha on:light on
transptype 0:clf
subplot 2 2 0:rotate 50 60:surf a:box
subplot 2 2 1:rotate 50 60:dens a:box
subplot 2 2 2:rotate 50 60:cont a:box
subplot 2 2 3:rotate 50 60:axial a:box
</pre>
 <img src="png/type0.png" alt="Example of SetTranspType(0).">
 <img src="png/type1.png" alt="Example of SetTranspType(1).">
 <img src="png/type2.png" alt="Example of SetTranspType(2).">


<hr size="6">
<a name="Axis-projection"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Types-of-transparency" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Adding-fog" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Axis-projection-1"></a>
<h3 class="subsection">5.9.4 Axis projection</h3>

<p>You can easily make 3D plot and draw its x-,y-,z-projections (like in CAD) by using <a href="#ternary">ternary</a> function with arguments: 4 for Cartesian, 5 for Ternary and 6 for Quaternary coordinates. The sample code is:
</p><pre class="verbatim">ranges 0 1 0 1 0 1
new x 50 '0.25*(1+cos(2*pi*x))'
new y 50 '0.25*(1+sin(2*pi*x))'
new z 50 'x'
new a 20 30 '30*x*y*(1-x-y)^2*(x+y&lt;1)'
new rx 10 'rnd':new ry 10:fill ry '(1-v)*rnd' rx
light on

title 'Projection sample':ternary 4:rotate 50 60
box:axis:grid
plot x y z 'r2':surf a '#'
xlabel 'X':ylabel 'Y':zlabel 'Z'
</pre>
 <img src="png/projection.png" alt="Example of axis projections">

<hr size="6">
<a name="Adding-fog"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Axis-projection" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Several-light-sources" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Adding-fog-1"></a>
<h3 class="subsection">5.9.5 Adding fog</h3>

<p>MathGL can add a fog to the image. Its switching on is rather simple &ndash; just use <a href="#fog">fog</a> function. There is the only feature &ndash; fog is applied for whole image. Not to particular subplot. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
title 'Fog sample':rotate 50 60:light on
fog 1
box:surf a
</pre>
 <img src="png/fog.png" alt="Example of Fog().">

<hr size="6">
<a name="Several-light-sources"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Adding-fog" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Using-primitives" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Several-light-sources-1"></a>
<h3 class="subsection">5.9.6 Several light sources</h3>

<p>In contrast to the most of other programs, MathGL supports several (up to 10) light sources. Moreover, the color each of them can be different: white (this is usual), yellow, red, cyan, green and so on. The use of several light sources may be interesting for the highlighting of some peculiarities of the plot or just to make an amusing picture. Note, each light source can be switched on/off individually. The sample code is:
</p><pre class="verbatim">call 'prepare2d'
title 'Several light sources':rotate 50 60:light on
light 1 0 1 0 'c':light 2 1 0 0 'y':light 3 0 -1 0 'm'
box:surf a 'h'
</pre>
 <img src="png/several_light.png" alt="Example of several light sources.">

<hr size="6">
<a name="Using-primitives"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Several-light-sources" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#STFA-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Using-primitives-1"></a>
<h3 class="subsection">5.9.7 Using primitives</h3>

<p>MathGL provide a set of functions for drawing primitives (see <a href="#Primitives">Primitives</a>). Primitives are low level object, which used by most of plotting functions. Picture below demonstrate some of commonly used primitives.
</p><pre class="verbatim">subplot 2 2 0 '':title 'Line, Curve, Rhomb, Ellipse' '' -1.5
line -1 -1 -0.5 1 'qAI'
curve -0.6 -1 1 1 0 1 1 1 'rA'
ball 0 -0.5 '*':ball 1 -0.1 '*'
rhomb 0 0.4 1 0.9 0.2 'b#'
rhomb 0 0 1 0.4 0.2 'cg@'
ellipse 0 -0.5 1 -0.1 0.2 'u#'
ellipse 0 -1 1 -0.6 0.2 'm@'

light on
subplot 2 2 1:title 'Face[xyz]':rotate 50 60:box
facex 1 0 -1 1 1 'r':facey -1 -1 -1 1 1 'g':facez 1 -1 -1 -1 1 'b'
face -1 -1 1 -1 1 1 1 -1 0 1 1 1 'bmgr'

subplot 2 2 3 '':title 'Cone'
cone -0.7 -0.3 0 -0.7 0.7 0.5 0.2 0.1 'b':text -0.7 -0.7 'no edges\n(default)'
cone 0 -0.3 0 0 0.7 0.5 0.2 0.1 'g@':text 0 -0.7 'with edges\n('\@' style)'
cone 0.7 -0.3 0 0.7 0.7 0.5 0.2 0.1 'ry':text 0.7 -0.7 '&quot;arrow&quot; with\n{}gradient'

subplot 2 2 2 '':title 'Sphere and Drop'
line -0.9 0 1 0.9 0 1
text -0.9 -0.7 'sh=0':drop -0.9 0 0 1 0.5 'r' 0:ball -0.9 0 1 'k'
text -0.3 -0.7 'sh=0.33':drop -0.3 0 0 1 0.5 'r' 0.33:ball -0.3 0 1 'k'
text 0.3 -0.7 'sh=0.67':drop 0.3 0 0 1 0.5 'r' 0.67:ball 0.3 0 1 'k'
text 0.9 -0.7 'sh=1':drop 0.9 0 0 1 0.5 'r' 1:ball 0.9 0 1 'k'
</pre>
 <img src="png/primitives.png" alt="Primitives in MathGL.">

<p>Generally, you can create arbitrary new kind of plot using primitives. For example, MathGL don&rsquo;t provide any special functions for drawing molecules. However, you can do it using only one type of primitives <a href="#drop">drop</a>. The sample code is:
</p><pre class="verbatim">alpha on:light on
subplot 2 2 0 '':title 'Methane, CH_4':rotate 60 120
sphere 0 0 0 0.25 'k':drop 0 0 0 0 0 1 0.35 'h' 1 2:sphere 0 0 0.7 0.25 'g'
drop 0 0 0 -0.94 0 -0.33 0.35 'h' 1 2:sphere -0.66 0 -0.23 0.25 'g'
drop 0 0 0 0.47 0.82 -0.33 0.35 'h' 1 2:sphere 0.33 0.57 -0.23 0.25 'g'
drop 0 0 0 0.47 -0.82 -0.33 0.35 'h' 1 2:sphere 0.33 -0.57 -0.23 0.25 'g'

subplot 2 2 1 '':title 'Water, H{_2}O':rotate 60 100
sphere 0 0 0 0.25 'r':drop 0 0 0 0.3 0.5 0 0.3 'm' 1 2:sphere 0.3 0.5 0 0.25 'g'
drop 0 0 0 0.3 -0.5 0 0.3 'm' 1 2:sphere 0.3 -0.5 0 0.25 'g'

subplot 2 2 2 '':title 'Oxygen, O_2':rotate 60 120
drop 0 0.5 0 0 -0.3 0 0.3 'm' 1 2:sphere 0 0.5 0 0.25 'r'
drop 0 -0.5 0 0 0.3 0 0.3 'm' 1 2:sphere 0 -0.5 0 0.25 'r'

subplot 2 2 3 '':title 'Ammonia, NH_3':rotate 60 120
sphere 0 0 0 0.25 'b':drop 0 0 0 0.33 0.57 0 0.32 'n' 1 2
sphere 0.33 0.57 0 0.25 'g':drop 0 0 0 0.33 -0.57 0 0.32 'n' 1 2
sphere 0.33 -0.57 0 0.25 'g':drop 0 0 0 -0.65 0 0 0.32 'n' 1 2
sphere -0.65 0 0 0.25 'g'
</pre>
 <img src="png/molecule.png" alt="Example of molecules drawing.">

<p>Moreover, some of special plots can be more easily produced by primitives rather than by specialized function. For example, Venn diagram can be produced by <code>Error</code> plot:
</p><pre class="verbatim">list x -0.3 0 0.3:list y 0.3 -0.3 0.3:list e 0.7 0.7 0.7
title 'Venn-like diagram':alpha on
error x y e e '!rgb@#o'
</pre><p>You see that you have to specify and fill 3 data arrays. The same picture can be produced by just 3 calls of <a href="#circle">circle</a> function:
</p><pre class="verbatim">title 'Venn-like diagram':alpha on
circle -0.3 0.3 0.7 'rr@'
circle 0 -0.3 0.7 'gg@'
circle 0.3 0.3 0.7 'bb@'
</pre><p>Of course, the first variant is more suitable if you need to plot a lot of circles. But for few ones the usage of primitives looks easy.
</p>
 <img src="png/venn.png" alt="Example of Venn diagram.">

<hr size="6">
<a name="STFA-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Using-primitives" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Mapping-visualization" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="STFA-sample-1"></a>
<h3 class="subsection">5.9.8 STFA sample</h3>

<p>Short-time Fourier Analysis (<a href="#stfa">stfa</a>) is one of informative method for analyzing long rapidly oscillating 1D data arrays. It is used to determine the sinusoidal frequency and phase content of local sections of a signal as it changes over time.
</p>
<p>MathGL can find and draw STFA result. Just to show this feature I give following sample. Initial data arrays is 1D arrays with step-like frequency. Exactly this you can see at bottom on the STFA plot. The sample code is:
</p><pre class="verbatim">new a 2000:new b 2000
fill a 'cos(50*pi*x)*(x&lt;-.5)+cos(100*pi*x)*(x&lt;0)*(x&gt;-.5)+\
cos(200*pi*x)*(x&lt;.5)*(x&gt;0)+cos(400*pi*x)*(x&gt;.5)'

subplot 1 2 0 '&lt;_':title 'Initial signal'
plot a:axis:xlabel '\i t'

subplot 1 2 1 '&lt;_':title 'STFA plot'
stfa a b 64:axis:ylabel '\omega' 0:xlabel '\i t'
</pre>
 <img src="png/stfa.png" alt="Example of STFA().">

<hr size="6">
<a name="Mapping-visualization"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#STFA-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Making-histogram" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Mapping-visualization-1"></a>
<h3 class="subsection">5.9.9 Mapping visualization</h3>

<p>Sometime ago I worked with mapping and have a question about its visualization. Let me remember you that mapping is some transformation rule for one set of number to another one. The 1d mapping is just an ordinary function &ndash; it takes a number and transforms it to another one. The 2d mapping (which I used) is a pair of functions which take 2 numbers and transform them to another 2 ones. Except general plots (like <a href="#surfc">surfc</a>, <a href="#surfa">surfa</a>) there is a special plot &ndash; Arnold diagram. It shows the area which is the result of mapping of some initial area (usually square).
</p>
<p>I tried to make such plot in <a href="#map">map</a>. It shows the set of points or set of faces, which final position is the result of mapping. At this, the color gives information about their initial position and the height describes Jacobian value of the transformation. Unfortunately, it looks good only for the simplest mapping but for the  real multivalent quasi-chaotic mapping it produces a confusion. So, use it if you like :).
</p>
<p>The sample code for mapping visualization is:
</p><pre class="verbatim">new a 50 40 'x':new b 50 40 'y':zrange -2 2:text 0 0 '\to'
subplot 2 1 0:text 0 1.1 '\{x, y\}' '' -2:box
map a b 'brgk'

subplot 2 1 1:box
text 0 1.1 '\{\frac{x^3+y^3}{2}, \frac{x-y}{2}\}' '' -2
fill a '(x^3+y^3)/2':fill b '(x-y)/2':map a b 'brgk'
</pre>
 <img src="png/map.png" alt="Example of Map().">

<hr size="6">
<a name="Making-histogram"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Mapping-visualization" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Nonlinear-fitting-sample" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Making-histogram-1"></a>
<h3 class="subsection">5.9.10 Making histogram</h3>

<p>Using the <a href="#hist">hist</a> function(s) for making regular distributions is one of useful fast methods to process and plot irregular data. <code>Hist</code> can be used to find some momentum of set of points by specifying weight function. It is possible to create not only 1D distributions but also 2D and 3D ones. Below I place the simplest sample code which demonstrate <a href="#hist">hist</a> usage:
</p><pre class="verbatim">new x 10000 '2*rnd-1':new y 10000 '2*rnd-1':copy z exp(-6*(x^2+y^2))
hist xx x z:norm xx 0 1:hist yy y z:norm yy 0 1
multiplot 3 3 3 2 2 '':ranges -1 1 -1 1 0 1:box:dots x y z 'wyrRk'
multiplot 3 3 0 2 1 '':ranges -1 1 0 1:box:bars xx
multiplot 3 3 5 1 2 '':ranges 0 1 -1 1:box:barh yy
subplot 3 3 2:text 0.5 0.5 'Hist and\n{}MultiPlot\n{}sample' 'a' -3
</pre>
 <img src="png/hist.png" alt="Example of Hist().">


<hr size="6">
<a name="Nonlinear-fitting-sample"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Making-histogram" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#PDE-solving-hints" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Nonlinear-fitting-hints"></a>
<h3 class="subsection">5.9.11 Nonlinear fitting hints</h3>

<p>Nonlinear fitting is rather simple. All that you need is the data to fit, the approximation formula and the list of coefficients to fit (better with its initial guess values). Let me demonstrate it on the following simple example. First, let us use sin function with some random noise:
</p><pre class="verbatim">new rnd 100 '0.4*rnd+0.1+sin(2*pi*x)'
new in 100 '0.3+sin(2*pi*x)'
</pre><p>and plot it to see that data we will fit
</p><pre class="verbatim">title 'Fitting sample':yrange -2 2:box:axis:plot rnd '. '
</pre>
<p>The next step is the fitting itself. For that let me specify an initial values <var>ini</var> for coefficients &lsquo;<samp>abc</samp>&rsquo; and do the fitting for approximation formula &lsquo;<samp>a+b*sin(c*x)</samp>&rsquo;
</p><pre class="verbatim">list ini 1 1 3:fit res rnd 'a+b*sin(c*x)' 'abc' ini
</pre><p>Now display it
</p><pre class="verbatim">plot res 'r':plot in 'b'
text -0.9 -1.3 'fitted:' 'r:L'
putsfit 0 -1.8 'y = ' 'r'
text 0 2.2 'initial: y = 0.3+sin(2\pi x)' 'b'
</pre>
<p>NOTE! the fitting results may have strong dependence on initial values for coefficients due to algorithm features. The problem is that in general case there are several local &quot;optimums&quot; for coefficients and the program returns only first found one! There are no guaranties that it will be the best. Try for example to set <code>ini[3] = {0, 0, 0}</code> in the code above.
</p>
<p>The full sample code for nonlinear fitting is:
</p><pre class="verbatim">new rnd 100 '0.4*rnd+0.1+sin(2*pi*x)'
new in 100 '0.3+sin(2*pi*x)'
list ini 1 1 3:fit res rnd 'a+b*sin(c*x)' 'abc' ini
title 'Fitting sample':yrange -2 2:box:axis:plot rnd '. '
plot res 'r':plot in 'b'
text -0.9 -1.3 'fitted:' 'r:L'
putsfit 0 -1.8 'y = ' 'r'
text 0 2.2 'initial: y = 0.3+sin(2\pi x)' 'b'
</pre>
 <img src="png/fit.png" alt="Example of nonlinear fitting.">

<hr size="6">
<a name="PDE-solving-hints"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Nonlinear-fitting-sample" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#MGL-parser-using" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="PDE-solving-hints-1"></a>
<h3 class="subsection">5.9.12 PDE solving hints</h3>

<p>Solving of Partial Differential Equations (PDE, including beam tracing) and ray tracing (or finding particle trajectory) are more or less common task. So, MathGL have several functions for that. There are <code>mglRay()</code> for ray tracing, <code>mglPDE()</code> for PDE solving, <code>mglQO2d()</code> for beam tracing in 2D case (see <a href="#Global-functions">Global functions</a>). Note, that these functions take &ldquo;Hamiltonian&rdquo; or equations as string values. And I don&rsquo;t plan now to allow one to use user-defined functions. There are 2 reasons: the complexity of corresponding interface; and the basic nature of used methods which are good for samples but may not good for serious scientific calculations.
</p>
<p>The ray tracing can be done by <code>mglRay()</code> function. Really ray tracing equation is Hamiltonian equation for 3D space. So, the function can be also used for finding a particle trajectory (i.e. solve Hamiltonian ODE) for 1D, 2D or 3D cases. The function have a set of arguments. First of all, it is Hamiltonian which defined the media (or the equation) you are planning to use. The Hamiltonian is defined by string which may depend on coordinates &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo;, time &lsquo;<samp>t</samp>&rsquo; (for particle dynamics) and momentums &lsquo;<samp>p</samp>&rsquo;=<em>p_x</em>, &lsquo;<samp>q</samp>&rsquo;=<em>p_y</em>, &lsquo;<samp>v</samp>&rsquo;=<em>p_z</em>. Next, you have to define the initial conditions for coordinates and momentums at &lsquo;<samp>t</samp>&rsquo;=0 and set the integrations step (default is 0.1) and its duration (default is 10). The Runge-Kutta method of 4-th order is used for integration.
</p><pre class="verbatim">  const char *ham = &quot;p^2+q^2-x-1+i*0.5*(y+x)*(y&gt;-x)&quot;;
  mglData r = mglRay(ham, mglPoint(-0.7, -1), mglPoint(0, 0.5), 0.02, 2);
</pre><p>This example calculate the reflection from linear layer (media with Hamiltonian &lsquo;<samp>p^2+q^2-x-1</samp>&rsquo;=<em>p_x^2+p_y^2-x-1</em>). This is parabolic curve. The resulting array have 7 columns which contain data for {x,y,z,p,q,v,t}.
</p>
<p>The solution of PDE is a bit more complicated. As previous you have to specify the equation as pseudo-differential operator <em>\hat H(x, \nabla)</em> which is called sometime as &ldquo;Hamiltonian&rdquo; (for example, in beam tracing). As previously, it is defined by string which may depend on coordinates &lsquo;<samp>x</samp>&rsquo;, &lsquo;<samp>y</samp>&rsquo;, &lsquo;<samp>z</samp>&rsquo; (but not time!), momentums &lsquo;<samp>p</samp>&rsquo;=<em>(d/dx)/i k_0</em>, &lsquo;<samp>q</samp>&rsquo;=<em>(d/dy)/i k_0</em> and field amplitude &lsquo;<samp>u</samp>&rsquo;=<em>|u|</em>. The evolutionary coordinate is &lsquo;<samp>z</samp>&rsquo; in all cases. So that, the equation look like <em>du/dz = ik_0 H(x,y,\hat p, \hat q, |u|)[u]</em>. Dependence on field amplitude &lsquo;<samp>u</samp>&rsquo;=<em>|u|</em> allows one to solve nonlinear problems too. For example, for nonlinear Shrodinger equation you may set <code>ham=&quot;p^2 + q^2 - u^2&quot;</code>. Also you may specify imaginary part for wave absorption, like <code>ham = &quot;p^2 + i*x*(x&gt;0)&quot;</code>, but only if dependence on variable &lsquo;<samp>i</samp>&rsquo; is linear (i.e. <em>H = Hre+i*Him</em>).
</p>
<p>Next step is specifying the initial conditions at &lsquo;<samp>z</samp>&rsquo;=<code>Min.z</code>. The function need 2 arrays for real and for imaginary part. Note, that coordinates x,y,z are supposed to be in specified range [Min, Max]. So, the data arrays should have corresponding scales. Finally, you may set the integration step and parameter k0=<em>k_0</em>. Also keep in mind, that internally the 2 times large box is used (for suppressing numerical reflection from boundaries) and the equation should well defined even in this extended range.
</p>
<p>Final comment is concerning the possible form of pseudo-differential operator <em>H</em>. At this moment, simplified form of operator <em>H</em> is supported &ndash; all &ldquo;mixed&rdquo; terms (like &lsquo;<samp>x*p</samp>&rsquo;-&gt;x*d/dx) are excluded. For example, in 2D case this operator is effectively <em>H = f(p,z) + g(x,z,u)</em>. However commutable combinations (like &lsquo;<samp>x*q</samp>&rsquo;-&gt;x*d/dy) are allowed for 3D case.
</p>
<p>So, for example let solve the equation for beam deflected from linear layer and absorbed later. The operator will have the form &lsquo;<samp>&quot;p^2+q^2-x-1+i*0.5*(z+x)*(z&gt;-x)&quot;</samp>&rsquo; that correspond to equation <em>ik_0 \partial_z u + \Delta u + x \cdot u + i (x+z)/2 \cdot u = 0</em>. This is typical equation for Electron Cyclotron (EC) absorption in magnetized plasmas. For initial conditions let me select the beam with plane phase front <em>exp(-48*(x+0.7)^2)</em>. The corresponding code looks like this:
</p><pre class="verbatim">new re 128 'exp(-48*(x+0.7)^2)':new im 128
pde a 'p^2+q^2-x-1+i*0.5*(z+x)*(z&gt;-x)' re im 0.01 30
transpose a
subplot 1 1 0 '&lt;_':title 'PDE solver'
axis:xlabel '\i x':ylabel '\i z'
crange 0 1:dens a 'wyrRk'
fplot '-x' 'k|'
text 0 0.95 'Equation: ik_0\partial_zu + \Delta u + x\cdot u +\
 i \frac{x+z}{2}\cdot u = 0\n{}absorption: (x+z)/2 for x+z&gt;0'
</pre>
 <img src="png/pde.png" alt="Example of PDE solving.">

<p>The last example is example of beam tracing. Beam tracing equation is special kind of PDE equation written in coordinates accompanied to a ray. Generally this is the same parameters and limitation as for PDE solving but the coordinates are defined by the ray and by parameter of grid width <var>w</var> in direction transverse the ray. So, you don&rsquo;t need to specify the range of coordinates. <strong>BUT</strong> there is limitation. The accompanied coordinates are well defined only for smooth enough rays, i.e. then the ray curvature <em>K</em> (which is defined as <em>1/K^2 = (|\ddot r|^2 |\dot r|^2 - (\ddot r, \dot r)^2)/|\dot r|^6</em>) is much large then the grid width: <em>K&gt;&gt;w</em>. So, you may receive incorrect results if this condition will be broken.
</p>
<p>You may use following code for obtaining the same solution as in previous example:
</p><pre class="verbatim">define $1 'p^2+q^2-x-1+i*0.5*(y+x)*(y&gt;-x)'
subplot 1 1 0 '&lt;_':title 'Beam and ray tracing'
ray r $1 -0.7 -1 0 0 0.5 0 0.02 2:plot r(0) r(1) 'k'
axis:xlabel '\i x':ylabel '\i z'
new re 128 'exp(-48*x^2)':new im 128
new xx 1:new yy 1
qo2d a $1 re im r 1 30 xx yy
crange 0 1:dens xx yy a 'wyrRk':fplot '-x' 'k|'
text 0 0.85 'absorption: (x+y)/2 for x+y&gt;0'
text 0.7 -0.05 'central ray'
</pre>
 <img src="png/qo2d.png" alt="Example of beam tracing.">


<hr size="6">
<a name="MGL-parser-using"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#PDE-solving-hints" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Using-options" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="MGL-parser-using-1"></a>
<h3 class="subsection">5.9.13 MGL parser using</h3>

<p>MGL scripts can contain loops, conditions and user-defined functions. Below I show very simple example of its usage:
</p><pre class="verbatim">title 'MGL parser sample'
call 'sample'
stop

func 'sample'
new dat 100 'sin(2*pi*(x+1))'
plot dat; xrange 0 1
box:axis:xlabel 'x':ylabel 'y'
for $0 -1 1 0.1
if $0&lt;0
line 0 0 -1 $0 'r'
else
line 0 0 -1 $0 'r'
endif
next
</pre>
 <img src="png/parser.png" alt="Example of MGL script parsing.">

<hr size="6">
<a name="Using-options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#MGL-parser-using" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#g_t_0060_0060Templates_0027_0027" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Using-options-1"></a>
<h3 class="subsection">5.9.14 Using options</h3>

<p><a href="#Command-options">Command options</a> allow the easy setup of the selected plot by changing global settings only for this plot. Often, options are used for specifying the range of automatic variables (coordinates). However, options allows easily change plot transparency, numbers of line or faces to be drawn, or add legend entries. The sample function for options usage is:
</p><pre class="verbatim">new a 31 41 '-pi*x*exp(-(y+1)^2-4*x^2)'
alpha on:light on
subplot 2 2 0:title 'Options for coordinates':rotate 40 60:box
surf a 'r';yrange 0 1
surf a 'b';yrange 0 -1

subplot 2 2 1:title 'Option &quot;meshnum&quot;':rotate 40 60:box
mesh a 'r'; yrange 0 1
mesh a 'b';yrange 0 -1; meshnum 5

subplot 2 2 2:title 'Option &quot;alpha&quot;':rotate 40 60:box
surf a 'r';yrange 0 1; alpha 0.7
surf a 'b';yrange 0 -1; alpha 0.3

subplot 2 2 3 '&lt;_':title 'Option &quot;legend&quot;'
fplot 'x^3' 'r'; legend 'y = x^3'
fplot 'cos(pi*x)' 'b'; legend 'y = cos \pi x'
box:axis:legend 2
</pre>
 <img src="png/mirror.png" alt="Example of options usage.">

<hr size="6">
<a name="g_t_0060_0060Templates_0027_0027"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Using-options" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Stereo-image" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="g_t_0060_0060Templates_0027_0027-1"></a>
<h3 class="subsection">5.9.15 &ldquo;Templates&rdquo;</h3>

<p>As I have noted before, the change of settings will influence only for the further plotting commands. This allows one to create &ldquo;template&rdquo; function which will contain settings and primitive drawing for often used plots. Correspondingly one may call this template-function for drawing simplification.
</p>
<p>For example, let one has a set of points (experimental or numerical) and wants to compare it with theoretical law (for example, with exponent law <em>\exp(-x/2), x \in [0, 20]</em>). The template-function for this task is:
</p><pre class="verbatim">void template(mglGraph *gr)
{
  mglData  law(100);      // create the law
  law.Modify(&quot;exp(-10*x)&quot;);
  gr-&gt;SetRanges(0,20, 0.0001,1);
  gr-&gt;SetFunc(0,&quot;lg(y)&quot;,0);
  gr-&gt;Plot(law,&quot;r2&quot;);
  gr-&gt;Puts(mglPoint(10,0.2),&quot;Theoretical law: e^x&quot;,&quot;r:L&quot;);
  gr-&gt;Label('x',&quot;x val.&quot;); gr-&gt;Label('y',&quot;y val.&quot;);
  gr-&gt;Axis(); gr-&gt;Grid(&quot;xy&quot;,&quot;g;&quot;); gr-&gt;Box();
}
</pre><p>At this, one will only write a few lines for data drawing:
</p><pre class="verbatim">  template(gr);     // apply settings and default drawing from template
  mglData dat(&quot;fname.dat&quot;); // load the data
  // and draw it (suppose that data file have 2 columns)
  gr-&gt;Plot(dat.SubData(0),dat.SubData(1),&quot;bx &quot;);
</pre><p>A template-function can also contain settings for font, transparency, lightning, color scheme and so on.
</p>
<p>I understand that this is obvious thing for any professional programmer, but I several times receive suggestion about &ldquo;templates&rdquo; ... So, I decide to point out it here.
</p>
<hr size="6">
<a name="Stereo-image"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#g_t_0060_0060Templates_0027_0027" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Reduce-memory-usage" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Stereo-image-1"></a>
<h3 class="subsection">5.9.16 Stereo image</h3>

<p>One can easily create stereo image in MathGL. Stereo image can be produced by making two subplots with slightly different rotation angles. The corresponding code looks like this:
</p><pre class="verbatim">call 'prepare2d'
light on
subplot 2 1 0:rotate 50 60+1:box:surf a
subplot 2 1 1:rotate 50 60-1:box:surf a
</pre>
 <img src="png/stereo.png" alt="Example of stereo image.">

<hr size="6">
<a name="Reduce-memory-usage"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Stereo-image" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hints" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Reduce-memory-usage-1"></a>
<h3 class="subsection">5.9.17 Reduce memory usage</h3>

<p>By default MathGL save all primitives in memory, rearrange it and only later draw them on bitmaps. Usually, this speed up drawing, but may require a lot of memory for plots which contain a lot of faces (like <a href="#cloud">cloud</a>, <a href="#dew">dew</a>). You can use <a href="#quality">quality</a> function for setting to use direct drawing on bitmap and bypassing keeping any primitives in memory. This function also allow you to decrease the quality of the resulting image but increase the speed of the drawing.
</p>
<p>The code for lower memory usage looks like this:
</p><pre class="verbatim">quality 6  # firstly, set to draw directly on bitmap
for $1 0 1000
  sphere 2*rnd-1 2*rnd-1 0.05
next
</pre>


<hr size="6">
<a name="FAQ"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Reduce-memory-usage" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Examples" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="FAQ-1"></a>
<h2 class="section">5.10 FAQ</h2>

<dl compact="compact">
<dt> <strong>The plot does not appear</strong></dt>
<dd><p>Check that points of the plot are located inside the bounding box and resize the bounding box using <a href="#ranges">ranges</a> function. Check that the data have correct dimensions for selected type of plot. Sometimes the light reflection from flat surfaces (like, <a href="#dens">dens</a>) can look as if the plot were absent.
</p>
</dd>
<dt> <strong>I can not find some special kind of plot.</strong></dt>
<dd><p>Most &ldquo;new&rdquo; types of plots can be created by using the existing drawing functions. For example, the surface of curve rotation can be created by a special function <a href="#torus">torus</a>, or as a parametrically specified surface by <a href="#surf">surf</a>. See also, <a href="#Hints">Hints</a>. If you can not find a specific type of plot, please e-mail me and this plot will appear in the next version of MathGL library.
</p>
</dd>
<dt> <strong>How can I print in Russian/Spanish/Arabic/Japanese, and so on?</strong></dt>
<dd><p>The standard way is to use Unicode encoding for the text output. But the MathGL library also has interface for 8-bit (char *) strings with internal conversion to Unicode. This conversion depends on the current locale OS.
</p>
</dd>
<dt> <strong>How can I exclude a point or a region of plot from the drawing?</strong></dt>
<dd><p>There are 3 general ways. First, the point with <code>nan</code> value as one of the coordinates (including color/alpha range) will never be plotted. Second, special functions define the condition when the points should be omitted (see <a href="#Cutting">Cutting</a>). Last, you may change the transparency of a part of the plot by the help of functions <a href="#surfa">surfa</a>, <a href="#surf3a">surf3a</a> (see <a href="#Dual-plotting">Dual plotting</a>). In last case the transparency is switched on smoothly.
</p>
</dd>
<dt> <strong>How many people write this library?</strong></dt>
<dd><p>Most of the library was written by one person. This is a result of nearly a year of work (mostly in the evening and on holidays): I spent half a year to write the kernel and half a year to a year on extending, improving the library and writing documentation. This process continues now :). The build system (cmake files) was written mostly by D.Kulagin, and the export to PRC/PDF was written mostly by M.Vidassov.
</p>
</dd>
<dt> <strong>How can I display a bitmap on the figure?</strong></dt>
<dd><p>You can import data by command <a href="#import">import</a> and display it by <a href="#dens">dens</a> function. For example, for black-and-white bitmap you can use the code: <code>import bmp 'fname.png' 'wk':dens  bmp 'wk'</code>.
</p>

</dd>
<dt> <strong>How can I create 3D in PDF?</strong></dt>
<dd><p>Just use command <code>write fname.pdf</code>, which create PDF file if enable-pdf=ON at MathGL configure.
</p>
</dd>
<dt> <strong>How can I create TeX figure?</strong></dt>
<dd><p>Just use command <code>write fname.tex</code>, which create LaTeX files with figure itself &lsquo;<samp><var>fname</var>.tex</samp>&rsquo;, with MathGL colors &lsquo;<samp>mglcolors.tex</samp>&rsquo; and main file &lsquo;<samp>mglmain.tex</samp>&rsquo;. Last one can be used for viewing image by command like <code>pdflatex mglmain.tex</code>.
</p>

</dd>
<dt> <strong>How I can change the font family?</strong></dt>
<dd><p>First, you should download new font files from <a href="http://mathgl.sourceforge.net/download.html">here</a> or from <a href="http://sourceforge.net/project/showfiles.php?group_id=152187&amp;package_id=267177">here</a>. Next, you should load the font files into by the following command: <code>loadfont 'fontname'</code>. Here <var>fontname</var> is the base font name like &lsquo;<samp>STIX</samp>&rsquo;. Use <code>loadfont ''</code> to start using the default font.
</p>
</dd>
<dt> <strong>How can I draw tick out of a bounding box?</strong></dt>
<dd><p>Just set a negative value in <a href="#ticklen">ticklen</a>. For example, use <code>ticklen -0.1</code>.
</p>
</dd>
<dt> <strong>How can I prevent text rotation?</strong></dt>
<dd><p>Just use <code>rotatetext off</code>. Also you can use axis style &lsquo;<samp>U</samp>&rsquo; for disable only tick labels rotation.
</p>
</dd>
<dt> <strong>How can I draw equal axis range even for rectangular image?</strong></dt>
<dd><p>Just use <code>aspect nan nan</code> for each subplot, or at the beginning of the drawing.
</p>
</dd>
</dl>




<hr size="6">
<a name="Symbols-and-hot_002dkeys"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#FAQ" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-for-styles" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Examples" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Copying-This-Manual" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Symbols-and-hot_002dkeys-1"></a>
<h1 class="appendix">A. Symbols and hot-keys</h1>
<p>This appendix contain the full list of symbols (characters) used by MathGL for setting up plot. Also it contain sections for full list of hot-keys supported by mglview tool and by UDAV program.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Symbols-for-styles">A.1 Symbols for styles</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Hot_002dkeys-for-mglview">A.2 Hot-keys for mglview</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Hot_002dkeys-for-UDAV">A.3 Hot-keys for UDAV</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>


<hr size="6">
<a name="Symbols-for-styles"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hot_002dkeys-for-mglview" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Copying-This-Manual" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Symbols-for-styles-1"></a>
<h2 class="section">A.1 Symbols for styles</h2>

<p>Below is full list of all characters (symbols) which MathGL use for setting up the plot.
</p>
<dl compact="compact">
<dt> &lsquo;<samp>space ' '</samp>&rsquo;</dt>
<dd><p>empty line style (see <a href="#Line-styles">Line styles</a>);
</p>
<p>empty color in <a href="#chart">chart</a>.
</p>
</dd>
<dt> &lsquo;<samp>!</samp>&rsquo;</dt>
<dd><p>set to use new color from palette for each point (not for each curve, as default) in <a href="#g_t1D-plotting">1D plotting</a>.
</p>
</dd>
<dt> &lsquo;<samp>#</samp>&rsquo;</dt>
<dd><p>set to use solid marks (see <a href="#Line-styles">Line styles</a>) or solid <a href="#error">error</a> boxes;
</p>
<p>set to draw wired plot for <a href="#axial">axial</a>, <a href="#surf3">surf3</a>, <a href="#surf3a">surf3a</a>, <a href="#surf3c">surf3c</a>, <a href="#triplot">triplot</a>, <a href="#quadplot">quadplot</a>, <a href="#area">area</a>, <a href="#bars">bars</a>, <a href="#barh">barh</a>, <a href="#tube">tube</a>, <a href="#tape">tape</a>, <a href="#cone">cone</a>, <a href="#boxs">boxs</a> and draw boundary only for <a href="#circle">circle</a>, <a href="#ellipse">ellipse</a>, <a href="#rhomb">rhomb</a>;
</p>
<p>set to draw also mesh lines for <a href="#surf">surf</a>, <a href="#surfc">surfc</a>, <a href="#surfa">surfa</a>, <a href="#dens">dens</a>, <a href="#densx">densx</a>, <a href="#densy">densy</a>, <a href="#densz">densz</a>, <a href="#dens3">dens3</a>, or boundary for <a href="#chart">chart</a>, <a href="#facex">facex</a>, <a href="#facey">facey</a>, <a href="#facez">facez</a>, <a href="#rect">rect</a>;
</p>
<p>set to draw boundary and box for <a href="#legend">legend</a>, <a href="#title">title</a>, or grid lines for <a href="#table">table</a>;
</p>
<p>set to draw grid for <a href="#radar">radar</a>;
</p>
<p>set to start flow threads and pipes from edges only for <a href="#flow">flow</a>, <a href="#pipe">pipe</a>;
</p>
<p>set to use whole are for axis range in <a href="#subplot">subplot</a>, <a href="#inplot">inplot</a>;
</p>
<p>change text color inside a string (see <a href="#Font-styles">Font styles</a>);
</p>
<p>start comment in <a href="#MGL-scripts">MGL scripts</a> or in <a href="#Command-options">Command options</a>.
</p>
</dd>
<dt> &lsquo;<samp>$</samp>&rsquo;</dt>
<dd><p>denote parameter of <a href="#MGL-scripts">MGL scripts</a>.
</p>
</dd>
<dt> &lsquo;<samp>&amp;</samp>&rsquo;</dt>
<dd><p>operation in <a href="#Textual-formulas">Textual formulas</a>.
</p>
</dd>
<dt> &lsquo;<samp>&rsquo;</samp>&rsquo;</dt>
<dd><p>denote string in <a href="#MGL-scripts">MGL scripts</a> or in <a href="#Command-options">Command options</a>.
</p>
</dd>
<dt> &lsquo;<samp>*</samp>&rsquo;</dt>
<dd><p>one of marks (see <a href="#Line-styles">Line styles</a>);
</p>
<p>operation in <a href="#Textual-formulas">Textual formulas</a>.
</p>
</dd>
<dt> &lsquo;<samp>+</samp>&rsquo;</dt>
<dd><p>one of marks (see <a href="#Line-styles">Line styles</a>) or kind of <a href="#error">error</a> boxes;
</p>
<p>operation in <a href="#Textual-formulas">Textual formulas</a>.
</p>
</dd>
<dt> &lsquo;<samp>,</samp>&rsquo;</dt>
<dd><p>separator for color positions (see <a href="#Color-styles">Color styles</a>) or items in a list.
</p>
</dd>
<dt> &lsquo;<samp>-</samp>&rsquo;</dt>
<dd><p>solid line style (see <a href="#Line-styles">Line styles</a>);
</p>
<p>place entries horizontally in <a href="#legend">legend</a>;
</p>
<p>operation in <a href="#Textual-formulas">Textual formulas</a>.
</p>
</dd>
<dt> &lsquo;<samp>.</samp>&rsquo;</dt>
<dd><p>one of marks (see <a href="#Line-styles">Line styles</a>);
</p>
<p>set to draw hachures instead of arrows for <a href="#vect">vect</a>, <a href="#vect3">vect3</a>;
</p>
<p>set to use dots instead of faces for <a href="#cloud">cloud</a>, <a href="#torus">torus</a>, <a href="#axial">axial</a>, <a href="#surf3">surf3</a>, <a href="#surf3a">surf3a</a>, <a href="#surf3c">surf3c</a>, <a href="#surf">surf</a>, <a href="#surfa">surfa</a>, <a href="#surfc">surfc</a>, <a href="#dens">dens</a>, <a href="#map">map</a>;
</p>
<p>delimiter of fractional parts for numbers.
</p>
</dd>
<dt> &lsquo;<samp>/</samp>&rsquo;</dt>
<dd><p>operation in <a href="#Textual-formulas">Textual formulas</a>.
</p>
</dd>
<dt> &lsquo;<samp>:</samp>&rsquo;</dt>
<dd><p>line dashing style (see <a href="#Line-styles">Line styles</a>);
</p>
<p>stop color scheme parsing (see <a href="#Color-scheme">Color scheme</a>);
</p>
<p>range operation in <a href="#MGL-scripts">MGL scripts</a>.
</p>
</dd>
<dt> &lsquo;<samp>;</samp>&rsquo;</dt>
<dd><p>line dashing style (see <a href="#Line-styles">Line styles</a>);
</p>
<p>end of an option in <a href="#MGL-scripts">MGL scripts</a> or in <a href="#Command-options">Command options</a>.
</p>
</dd>
<dt> &lsquo;<samp>&lt;</samp>&rsquo;</dt>
<dd><p>one of marks (see <a href="#Line-styles">Line styles</a>);
</p>
<p>style of <a href="#subplot">subplot</a> and <a href="#inplot">inplot</a>;
</p>
<p>set position of <a href="#colorbar">colorbar</a>;
</p>
<p>style of <a href="#vect">vect</a>, <a href="#vect3">vect3</a>;
</p>
<p>operation in <a href="#Textual-formulas">Textual formulas</a>.
</p>

</dd>
<dt> &lsquo;<samp>&gt;</samp>&rsquo;</dt>
<dd><p>one of marks (see <a href="#Line-styles">Line styles</a>);
</p>
<p>style of <a href="#subplot">subplot</a> and <a href="#inplot">inplot</a>;
</p>
<p>set position of <a href="#colorbar">colorbar</a>;
</p>
<p>style of <a href="#vect">vect</a>, <a href="#vect3">vect3</a>;
</p>
<p>operation in <a href="#Textual-formulas">Textual formulas</a>.
</p>
</dd>
<dt> &lsquo;<samp>=</samp>&rsquo;</dt>
<dd><p>line dashing style (see <a href="#Line-styles">Line styles</a>);
</p>
<p>set to use equidistant columns for <a href="#table">table</a>;
</p>
<p>set to use color gradient for <a href="#vect">vect</a>, <a href="#vect3">vect3</a>;
</p>
<p>operation in <a href="#Textual-formulas">Textual formulas</a>.
</p>
</dd>
<dt> &lsquo;<samp>@</samp>&rsquo;</dt>
<dd><p>set to draw box around text for <a href="#text">text</a> and similar functions;
</p>
<p>set to draw boundary and fill it for <a href="#circle">circle</a>, <a href="#ellipse">ellipse</a>, <a href="#rhomb">rhomb</a>;
</p>
<p>set to fill faces for <a href="#box">box</a>;
</p>
<p>set to draw large semitransparent mark instead of error box for <a href="#error">error</a>;
</p>
<p>set to draw edges for <a href="#cone">cone</a>;
</p>
<p>set to draw filled boxes for <a href="#boxs">boxs</a>;
</p>
<p>reduce text size inside a string (see <a href="#Font-styles">Font styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>^</samp>&rsquo;</dt>
<dd><p>one of marks (see <a href="#Line-styles">Line styles</a>);
</p>
<p>style of <a href="#subplot">subplot</a> and <a href="#inplot">inplot</a>;
</p>
<p>set position of <a href="#colorbar">colorbar</a>;
</p>
<p>switch to upper index inside a string (see <a href="#Font-styles">Font styles</a>);
</p>
<p>operation in <a href="#Textual-formulas">Textual formulas</a>.
</p>
</dd>
<dt> &lsquo;<samp>_</samp>&rsquo;</dt>
<dd><p>empty arrow style (see <a href="#Line-styles">Line styles</a>);
</p>
<p>disable drawing of tick labels for <a href="#axis">axis</a>;
</p>
<p>style of <a href="#subplot">subplot</a> and <a href="#inplot">inplot</a>;
</p>
<p>set position of <a href="#colorbar">colorbar</a>;
</p>
<p>set to draw contours at bottom for <a href="#cont">cont</a>, <a href="#contf">contf</a>, <a href="#contd">contd</a>, <a href="#contv">contv</a>, <a href="#tricont">tricont</a>;
</p>
<p>switch to lower index inside a string (see <a href="#Font-styles">Font styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>[]</samp>&rsquo;</dt>
<dd><p>contain symbols excluded from color scheme parsing (see <a href="#Color-scheme">Color scheme</a>).
</p>
</dd>
<dt> &lsquo;<samp>{}</samp>&rsquo;</dt>
<dd><p>contain extended color specification (see <a href="#Color-styles">Color styles</a>);
</p>
<p>denote special operation in <a href="#MGL-scripts">MGL scripts</a>;
</p>
<p>denote &rsquo;meta-symbol&rsquo; for LaTeX like string parsing (see <a href="#Font-styles">Font styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>|</samp>&rsquo;</dt>
<dd><p>line dashing style (see <a href="#Line-styles">Line styles</a>);
</p>
<p>set to use sharp color scheme (see <a href="#Color-scheme">Color scheme</a>);
</p>
<p>set to limit width by subplot width for <a href="#table">table</a>;
</p>
<p>delimiter in <a href="#list">list</a> command;
</p>
<p>operation in <a href="#Textual-formulas">Textual formulas</a>.
</p>
</dd>
<dt> &lsquo;<samp>\</samp>&rsquo;</dt>
<dd><p>string continuation symbol on next line for <a href="#MGL-scripts">MGL scripts</a>.
</p>
</dd>
<dt> &lsquo;<samp>0,1,2,3,4,5,6,7,8,9</samp>&rsquo;</dt>
<dd><p>line width (see <a href="#Line-styles">Line styles</a>);
</p>
<p>brightness of a color (see <a href="#Color-styles">Color styles</a>);
</p>
<p>kind of smoothing (for digits 1,3,5) in <a href="#smooth">smooth</a>;
</p>
<p>digits for a value.
</p>
</dd>
<dt> &lsquo;<samp>A,B,C,D,E,F,a,b,c,d,e,f</samp>&rsquo;</dt>
<dd><p>can be hex-digit for color specification if placed inside {} (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>A</samp>&rsquo;</dt>
<dd><p>arrow style (see <a href="#Line-styles">Line styles</a>);
</p>
<p>set to use absolute position in whole picture for <a href="#text">text</a>, <a href="#colorbar">colorbar</a>, <a href="#legend">legend</a>.
</p>
</dd>
<dt> &lsquo;<samp>a</samp>&rsquo;</dt>
<dd><p>set to use absolute position in subplot for <a href="#text">text</a>;
</p>
<p>style of <a href="#bars">bars</a>, <a href="#barh">barh</a>.
</p>
</dd>
<dt> &lsquo;<samp>B</samp>&rsquo;</dt>
<dd><p>dark blue color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>b</samp>&rsquo;</dt>
<dd><p>blue color (see <a href="#Color-styles">Color styles</a>);
</p>
<p>bold font face if placed after &lsquo;<samp>:</samp>&rsquo; (see <a href="#Font-styles">Font styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>C</samp>&rsquo;</dt>
<dd><p>dark cyan color (see <a href="#Color-styles">Color styles</a>);
</p>
<p>align text to center if placed after &lsquo;<samp>:</samp>&rsquo; (see <a href="#Font-styles">Font styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>c</samp>&rsquo;</dt>
<dd><p>cyan color (see <a href="#Color-styles">Color styles</a>);
</p>
<p>name of color axis;
</p>
<p>cosine transform for <a href="#transform">transform</a>.
</p>
</dd>
<dt> &lsquo;<samp>D</samp>&rsquo;</dt>
<dd><p>arrow style (see <a href="#Line-styles">Line styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>d</samp>&rsquo;</dt>
<dd><p>one of marks (see <a href="#Line-styles">Line styles</a>) or kind of <a href="#error">error</a> boxes.
</p>
</dd>
<dt> &lsquo;<samp>E</samp>&rsquo;</dt>
<dd><p>dark green-yellow color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>e</samp>&rsquo;</dt>
<dd><p>green-yellow color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>f</samp>&rsquo;</dt>
<dd><p>style of <a href="#bars">bars</a>, <a href="#barh">barh</a>;
</p>
<p>style of <a href="#vect">vect</a>, <a href="#vect3">vect3</a>;
</p>
<p>Fourier transform for <a href="#transform">transform</a>.
</p>
</dd>
<dt> &lsquo;<samp>G</samp>&rsquo;</dt>
<dd><p>dark green color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>g</samp>&rsquo;</dt>
<dd><p>green color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>H</samp>&rsquo;</dt>
<dd><p>dark gray color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>h</samp>&rsquo;</dt>
<dd><p>gray color (see <a href="#Color-styles">Color styles</a>);
</p>
<p>Hankel transform for <a href="#transform">transform</a>.
</p>
</dd>
<dt> &lsquo;<samp>I</samp>&rsquo;</dt>
<dd><p>arrow style (see <a href="#Line-styles">Line styles</a>);
</p>
<p>set <a href="#colorbar">colorbar</a> position near boundary.
</p>
</dd>
<dt> &lsquo;<samp>i</samp>&rsquo;</dt>
<dd><p>line dashing style (see <a href="#Line-styles">Line styles</a>);
</p>
<p>italic font face if placed after &lsquo;<samp>:</samp>&rsquo; (see <a href="#Font-styles">Font styles</a>).
</p>
<p>set to use inverse values for <a href="#cloud">cloud</a>, <a href="#pipe">pipe</a>, <a href="#dew">dew</a>;
</p>
<p>set to fill only area with y1&lt;y&lt;y2 for <a href="#region">region</a>;
</p>
<p>inverse Fourier transform for <a href="#transform">transform</a>.
</p>
</dd>
<dt> &lsquo;<samp>j</samp>&rsquo;</dt>
<dd><p>line dashing style (see <a href="#Line-styles">Line styles</a>);
</p>
</dd>
<dt> &lsquo;<samp>K</samp>&rsquo;</dt>
<dd><p>arrow style (see <a href="#Line-styles">Line styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>k</samp>&rsquo;</dt>
<dd><p>black color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>L</samp>&rsquo;</dt>
<dd><p>dark green-blue color (see <a href="#Color-styles">Color styles</a>);
</p>
<p>align text to left if placed after &lsquo;<samp>:</samp>&rsquo; (see <a href="#Font-styles">Font styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>l</samp>&rsquo;</dt>
<dd><p>green-blue color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>M</samp>&rsquo;</dt>
<dd><p>dark magenta color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>m</samp>&rsquo;</dt>
<dd><p>magenta color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>N</samp>&rsquo;</dt>
<dd><p>dark sky-blue color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>n</samp>&rsquo;</dt>
<dd><p>sky-blue color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>O</samp>&rsquo;</dt>
<dd><p>arrow style (see <a href="#Line-styles">Line styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>o</samp>&rsquo;</dt>
<dd><p>one of marks (see <a href="#Line-styles">Line styles</a>) or kind of <a href="#error">error</a> boxes;
</p>
<p>over-line text if placed after &lsquo;<samp>:</samp>&rsquo; (see <a href="#Font-styles">Font styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>P</samp>&rsquo;</dt>
<dd><p>dark purple color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>p</samp>&rsquo;</dt>
<dd><p>purple color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>Q</samp>&rsquo;</dt>
<dd><p>dark orange or brown color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>q</samp>&rsquo;</dt>
<dd><p>orange color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>R</samp>&rsquo;</dt>
<dd><p>dark red color (see <a href="#Color-styles">Color styles</a>);
</p>
<p>align text to right if placed after &lsquo;<samp>:</samp>&rsquo; (see <a href="#Font-styles">Font styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>r</samp>&rsquo;</dt>
<dd><p>red color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>S</samp>&rsquo;</dt>
<dd><p>arrow style (see <a href="#Line-styles">Line styles</a>);
</p>
</dd>
<dt> &lsquo;<samp>s</samp>&rsquo;</dt>
<dd><p>one of marks (see <a href="#Line-styles">Line styles</a>) or kind of <a href="#error">error</a> boxes;
</p>
<p>sine transform for <a href="#transform">transform</a>.
</p>
</dd>
<dt> &lsquo;<samp>T</samp>&rsquo;</dt>
<dd><p>arrow style (see <a href="#Line-styles">Line styles</a>);
</p>
<p>place text under the curve for <a href="#text">text</a>, <a href="#cont">cont</a>, <a href="#cont3">cont3</a>.
</p>
</dd>
<dt> &lsquo;<samp>t</samp>&rsquo;</dt>
<dd><p>set to draw text labels for <a href="#cont">cont</a>, <a href="#cont3">cont3</a>;
</p>
<p>name of t-axis (one of ternary axis);
</p>
<p>variable in <a href="#Textual-formulas">Textual formulas</a>, which usually is varied in range [0,1].
</p>
</dd>
<dt> &lsquo;<samp>U</samp>&rsquo;</dt>
<dd><p>dark blue-violet color (see <a href="#Color-styles">Color styles</a>);
</p>
<p>disable rotation of tick labels for <a href="#axis">axis</a>.
</p>
</dd>
<dt> &lsquo;<samp>u</samp>&rsquo;</dt>
<dd><p>blue-violet color (see <a href="#Color-styles">Color styles</a>);
</p>
<p>under-line text if placed after &lsquo;<samp>:</samp>&rsquo; (see <a href="#Font-styles">Font styles</a>);
</p>
<p>name of u-axis (one of ternary axis);
</p>
<p>variable in <a href="#Textual-formulas">Textual formulas</a>, which usually denote array itself.
</p>
</dd>
<dt> &lsquo;<samp>V</samp>&rsquo;</dt>
<dd><p>arrow style (see <a href="#Line-styles">Line styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>v</samp>&rsquo;</dt>
<dd><p>one of marks (see <a href="#Line-styles">Line styles</a>);
</p>
<p>set to draw vectors on flow threads for <a href="#flow">flow</a>.
</p>
</dd>
<dt> &lsquo;<samp>W</samp>&rsquo;</dt>
<dd><p>bright gray color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>w</samp>&rsquo;</dt>
<dd><p>white color (see <a href="#Color-styles">Color styles</a>);
</p>
<p>wired text if placed after &lsquo;<samp>:</samp>&rsquo; (see <a href="#Font-styles">Font styles</a>);
</p>
<p>name of w-axis (one of ternary axis);
</p>
</dd>
<dt> &lsquo;<samp>x</samp>&rsquo;</dt>
<dd><p>one of marks (see <a href="#Line-styles">Line styles</a>) or kind of <a href="#error">error</a> boxes;
</p>
<p>name of x-axis or x-direction or 1st dimension of a data array;
</p>
<p>start hex-color described if placed inside {} (see <a href="#Color-styles">Color styles</a>);
</p>
<p>style of <a href="#tape">tape</a>.
</p>
</dd>
<dt> &lsquo;<samp>Y</samp>&rsquo;</dt>
<dd><p>dark yellow or gold color (see <a href="#Color-styles">Color styles</a>).
</p>
</dd>
<dt> &lsquo;<samp>y</samp>&rsquo;</dt>
<dd><p>yellow color (see <a href="#Color-styles">Color styles</a>);
</p>
<p>name of y-axis or y-direction or 2nd dimension of a data array.
</p>
</dd>
<dt> &lsquo;<samp>z</samp>&rsquo;</dt>
<dd>
<p>name of z-axis or z-direction or 3d dimension of a data array;
</p>
<p>style of <a href="#tape">tape</a>.
</p>
</dd>
</dl>



<hr size="6">
<a name="Hot_002dkeys-for-mglview"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Symbols-for-styles" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Hot_002dkeys-for-UDAV" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Copying-This-Manual" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Hot_002dkeys-for-mglview-1"></a>
<h2 class="section">A.2 Hot-keys for mglview</h2>

<table>
<thead><tr><th width="30%">Key</th><th width="70%">Description</th></tr></thead>
<tr><td width="30%">&lt;Ctrl-P&gt;</td><td width="70%">Open printer dialog and print graphics.</td></tr>
<tr><td width="30%">&lt;Ctrl-W&gt;</td><td width="70%">Close window.</td></tr>
<tr><td width="30%">&lt;Ctrl-T&gt;</td><td width="70%">Switch on/off transparency for the graphics.</td></tr>
<tr><td width="30%">&lt;Ctrl-L&gt;</td><td width="70%">Switch on/off additional lightning for the graphics.</td></tr>
<tr><td width="30%">&lt;Ctrl-Space&gt;</td><td width="70%">Restore default graphics rotation, zoom and perspective.</td></tr>
<tr><td width="30%">&lt;F5&gt;</td><td width="70%">Execute script and redraw graphics.</td></tr>
<tr><td width="30%">&lt;F6&gt;</td><td width="70%">Change canvas size to fill whole region.</td></tr>
<tr><td width="30%">&lt;Ctrl-F5&gt;</td><td width="70%">Run slideshow. If no parameter specified then the dialog with slideshow options will appear.</td></tr>
<tr><td width="30%">&lt;Ctrl-Comma&gt;, &lt;Ctrl-Period&gt;</td><td width="70%">Show next/previous slide. If no parameter specified then the dialog with slideshow options will appear.</td></tr>
<tr><td width="30%">&lt;Ctrl-Shift-G&gt;</td><td width="70%">Copy graphics to clipboard.</td></tr>
<tr><td width="30%">&lt;Alt-P&gt;</td><td width="70%">Export as semitransparent PNG.</td></tr>
<tr><td width="30%">&lt;Alt-F&gt;</td><td width="70%">Export as solid PNG.</td></tr>
<tr><td width="30%">&lt;Alt-J&gt;</td><td width="70%">Export as JPEG.</td></tr>
<tr><td width="30%">&lt;Alt-E&gt;</td><td width="70%">Export as vector EPS.</td></tr>
<tr><td width="30%">&lt;Alt-S&gt;</td><td width="70%">Export as vector SVG.</td></tr>
<tr><td width="30%">&lt;Alt-L&gt;</td><td width="70%">Export as LaTeX/Tikz image.</td></tr>
<tr><td width="30%">&lt;Alt-M&gt;</td><td width="70%">Export as MGLD.</td></tr>
<tr><td width="30%">&lt;Alt-D&gt;</td><td width="70%">Export as PRC/PDF.</td></tr>
<tr><td width="30%">&lt;Alt-O&gt;</td><td width="70%">Export as OBJ.</td></tr>
</table>


<hr size="6">
<a name="Hot_002dkeys-for-UDAV"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Hot_002dkeys-for-mglview" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Copying-This-Manual" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Copying-This-Manual" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Hot_002dkeys-for-UDAV-1"></a>
<h2 class="section">A.3 Hot-keys for UDAV</h2>

<table>
<thead><tr><th width="30%">Key</th><th width="70%">Description</th></tr></thead>
<tr><td width="30%">&lt;Ctrl-N&gt;</td><td width="70%">Create new window with empty script. Note, all scripts share variables. So, second window can be used to see some additional information of existed variables.</td></tr>
<tr><td width="30%">&lt;Ctrl-O&gt;</td><td width="70%">Open and execute/show script or data from file. You may switch off automatic exection in UDAV properties</td></tr>
<tr><td width="30%">&lt;Ctrl-S&gt;</td><td width="70%">Save script to a file.</td></tr>
<tr><td width="30%">&lt;Ctrl-P&gt;</td><td width="70%">Open printer dialog and print graphics.</td></tr>
<tr><td width="30%">&lt;Ctrl-Z&gt;</td><td width="70%">Undo changes in script editor.</td></tr>
<tr><td width="30%">&lt;Ctrl-Shift-Z&gt;</td><td width="70%">Redo changes in script editor.</td></tr>
<tr><td width="30%">&lt;Ctrl-X&gt;</td><td width="70%">Cut selected text into clipboard.</td></tr>
<tr><td width="30%">&lt;Ctrl-C&gt;</td><td width="70%">Copy selected text into clipboard.</td></tr>
<tr><td width="30%">&lt;Ctrl-V&gt;</td><td width="70%">Paste selected text from clipboard.</td></tr>
<tr><td width="30%">&lt;Ctrl-A&gt;</td><td width="70%">Select all text in editor.</td></tr>
<tr><td width="30%">&lt;Ctrl-F&gt;</td><td width="70%">Show dialog for text finding.</td></tr>
<tr><td width="30%">&lt;F3&gt;</td><td width="70%">Find next occurrence of the text.</td></tr>
<tr><td width="30%">&lt;Win-C&gt; or &lt;Meta-C&gt;</td><td width="70%">Show dialog for new command and put it into the script.</td></tr>
<tr><td width="30%">&lt;Win-F&gt; or &lt;Meta-F&gt;</td><td width="70%">Insert last fitted formula with found coefficients.</td></tr>
<tr><td width="30%">&lt;Win-S&gt; or &lt;Meta-S&gt;</td><td width="70%">Show dialog for styles and put it into the script. Styles define the plot view (color scheme, marks, dashing and so on).</td></tr>
<tr><td width="30%">&lt;Win-O&gt; or &lt;Meta-O&gt;</td><td width="70%">Show dialog for options and put it into the script. Options are used for additional setup the plot.</td></tr>
<tr><td width="30%">&lt;Win-N&gt; or &lt;Meta-N&gt;</td><td width="70%">Replace selected expression by its numerical value.</td></tr>
<tr><td width="30%">&lt;Win-P&gt; or &lt;Meta-P&gt;</td><td width="70%">Select file and insert its file name into the script.</td></tr>
<tr><td width="30%">&lt;Win-G&gt; or &lt;Meta-G&gt;</td><td width="70%">Show dialog for plot setup and put resulting code into the script. This dialog setup axis, labels, lighting and other general things.</td></tr>
<tr><td width="30%">&lt;Ctrl-Shift-O&gt;</td><td width="70%">Load data from file. Data will be deleted only at exit but UDAV will not ask to save it.</td></tr>
<tr><td width="30%">&lt;Ctrl-Shift-S&gt;</td><td width="70%">Save data to a file.</td></tr>
<tr><td width="30%">&lt;Ctrl-Shift-C&gt;</td><td width="70%">Copy range of numbers to clipboard.</td></tr>
<tr><td width="30%">&lt;Ctrl-Shift-V&gt;</td><td width="70%">Paste range of numbers from clipboard.</td></tr>
<tr><td width="30%">&lt;Ctrl-Shift-N&gt;</td><td width="70%">Recreate the data with new sizes and fill it by zeros.</td></tr>
<tr><td width="30%">&lt;Ctrl-Shift-R&gt;</td><td width="70%">Resize (interpolate) the data to specified sizes.</td></tr>
<tr><td width="30%">&lt;Ctrl-Shift-T&gt;</td><td width="70%">Transform data along dimension(s).</td></tr>
<tr><td width="30%">&lt;Ctrl-Shift-M&gt;</td><td width="70%">Make another data.</td></tr>
<tr><td width="30%">&lt;Ctrl-Shift-H&gt;</td><td width="70%">Find histogram of data.</td></tr>
<tr><td width="30%">&lt;Ctrl-T&gt;</td><td width="70%">Switch on/off transparency for the graphics.</td></tr>
<tr><td width="30%">&lt;Ctrl-L&gt;</td><td width="70%">Switch on/off additional lightning for the graphics.</td></tr>
<tr><td width="30%">&lt;Ctrl-G&gt;</td><td width="70%">Switch on/off grid of absolute coordinates.</td></tr>
<tr><td width="30%">&lt;Ctrl-Space&gt;</td><td width="70%">Restore default graphics rotation, zoom and perspective.</td></tr>
<tr><td width="30%">&lt;F5&gt;</td><td width="70%">Execute script and redraw graphics.</td></tr>
<tr><td width="30%">&lt;F6&gt;</td><td width="70%">Change canvas size to fill whole region.</td></tr>
<tr><td width="30%">&lt;F7&gt;</td><td width="70%">Stop script execution.</td></tr>
<tr><td width="30%">&lt;F9&gt;</td><td width="70%">Restore status for &rsquo;once&rsquo; command and reload data.</td></tr>
<tr><td width="30%">&lt;Ctrl-F5&gt;</td><td width="70%">Run slideshow. If no parameter specified then the dialog with slideshow options will appear.</td></tr>
<tr><td width="30%">&lt;Ctrl-Comma&gt;, &lt;Ctrl-Period&gt;</td><td width="70%">Show next/previous slide. If no parameter specified then the dialog with slideshow options will appear.</td></tr>
<tr><td width="30%">&lt;Ctrl-W&gt;</td><td width="70%">Open dialog with slideshow options.</td></tr>
<tr><td width="30%">&lt;Ctrl-Shift-G&gt;</td><td width="70%">Copy graphics to clipboard.</td></tr>
<tr><td width="30%">&lt;F1&gt;</td><td width="70%">Show help on MGL commands</td></tr>
<tr><td width="30%">&lt;F2&gt;</td><td width="70%">Show/hide tool window with messages and information.</td></tr>
<tr><td width="30%">&lt;F4&gt;</td><td width="70%">Show/hide calculator which evaluate and help to type textual formulas. Textual formulas may contain data variables too.</td></tr>
<tr><td width="30%">&lt;Meta-Shift-Up&gt;, &lt;Meta-Shift-Down&gt;</td><td width="70%">Change view angle <em>\theta</em>.</td></tr>
<tr><td width="30%">&lt;Meta-Shift-Left&gt;, &lt;Meta-Shift-Right&gt;</td><td width="70%">Change view angle <em>\phi</em>.</td></tr>
<tr><td width="30%">&lt;Alt-Minus&gt;, &lt;Alt-Equal&gt;</td><td width="70%">Zoom in/out whole image.</td></tr>
<tr><td width="30%">&lt;Alt-Up&gt;, &lt;Alt-Down&gt;, &lt;Alt-Right&gt;, &lt;Alt-Left&gt;</td><td width="70%">Shift whole image.</td></tr>
<tr><td width="30%">&lt;Alt-P&gt;</td><td width="70%">Export as semitransparent PNG.</td></tr>
<tr><td width="30%">&lt;Alt-F&gt;</td><td width="70%">Export as solid PNG.</td></tr>
<tr><td width="30%">&lt;Alt-J&gt;</td><td width="70%">Export as JPEG.</td></tr>
<tr><td width="30%">&lt;Alt-E&gt;</td><td width="70%">Export as vector EPS.</td></tr>
<tr><td width="30%">&lt;Alt-S&gt;</td><td width="70%">Export as vector SVG.</td></tr>
<tr><td width="30%">&lt;Alt-L&gt;</td><td width="70%">Export as LaTeX/Tikz image.</td></tr>
<tr><td width="30%">&lt;Alt-M&gt;</td><td width="70%">Export as MGLD.</td></tr>
<tr><td width="30%">&lt;Alt-D&gt;</td><td width="70%">Export as PRC/PDF.</td></tr>
<tr><td width="30%">&lt;Alt-O&gt;</td><td width="70%">Export as OBJ.</td></tr>
</table>


<hr size="6">
<a name="Copying-This-Manual"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Hot_002dkeys-for-UDAV" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Symbols-and-hot_002dkeys" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="GNU-Free-Documentation-License"></a>
<h1 class="appendix">B. GNU Free Documentation License</h1>
<p align="center"> Version 1.2, November 2002
</p>

<table><tr><td>&nbsp;</td><td><pre class="display">Copyright &copy; 2000,2001,2002 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA

Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</pre></td></tr></table>

<ol>
<li>
PREAMBLE

<p>The purpose of this License is to make a manual, textbook, or other
functional and useful document <em>free</em> in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
</p>
<p>This License is a kind of &ldquo;copyleft&rdquo;, which means that derivative
works of the document must themselves be free in the same sense.  It
complements the GNU General Public License, which is a copyleft
license designed for free software.
</p>
<p>We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does.  But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book.  We recommend this License
principally for works whose purpose is instruction or reference.
</p>
</li><li>
APPLICABILITY AND DEFINITIONS

<p>This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License.  Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein.  The &ldquo;Document&rdquo;, below,
refers to any such manual or work.  Any member of the public is a
licensee, and is addressed as &ldquo;you&rdquo;.  You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
</p>
<p>A &ldquo;Modified Version&rdquo; of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
</p>
<p>A &ldquo;Secondary Section&rdquo; is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document&rsquo;s overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject.  (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.)  The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
</p>
<p>The &ldquo;Invariant Sections&rdquo; are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.  If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant.  The Document may contain zero
Invariant Sections.  If the Document does not identify any Invariant
Sections then there are none.
</p>
<p>The &ldquo;Cover Texts&rdquo; are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.  A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
</p>
<p>A &ldquo;Transparent&rdquo; copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters.  A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text.  A copy that is not &ldquo;Transparent&rdquo; is called &ldquo;Opaque&rdquo;.
</p>
<p>Examples of suitable formats for Transparent copies include plain
<small>ASCII</small> without markup, Texinfo input format, LaTeX input
format, <acronym>SGML</acronym> or <acronym>XML</acronym> using a publicly available
<acronym>DTD</acronym>, and standard-conforming simple <acronym>HTML</acronym>,
PostScript or <acronym>PDF</acronym> designed for human modification.  Examples
of transparent image formats include <acronym>PNG</acronym>, <acronym>XCF</acronym> and
<acronym>JPG</acronym>.  Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, <acronym>SGML</acronym> or
<acronym>XML</acronym> for which the <acronym>DTD</acronym> and/or processing tools are
not generally available, and the machine-generated <acronym>HTML</acronym>,
PostScript or <acronym>PDF</acronym> produced by some word processors for
output purposes only.
</p>
<p>The &ldquo;Title Page&rdquo; means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page.  For works in
formats which do not have any title page as such, &ldquo;Title Page&rdquo; means
the text near the most prominent appearance of the work&rsquo;s title,
preceding the beginning of the body of the text.
</p>
<p>A section &ldquo;Entitled XYZ&rdquo; means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language.  (Here XYZ stands for a
specific section name mentioned below, such as &ldquo;Acknowledgements&rdquo;,
&ldquo;Dedications&rdquo;, &ldquo;Endorsements&rdquo;, or &ldquo;History&rdquo;.)  To &ldquo;Preserve the Title&rdquo;
of such a section when you modify the Document means that it remains a
section &ldquo;Entitled XYZ&rdquo; according to this definition.
</p>
<p>The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document.  These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
</p>
</li><li>
VERBATIM COPYING

<p>You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License.  You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute.  However, you may accept
compensation in exchange for copies.  If you distribute a large enough
number of copies you must also follow the conditions in section 3.
</p>
<p>You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
</p>
</li><li>
COPYING IN QUANTITY

<p>If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document&rsquo;s license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover.  Both covers must also clearly and legibly identify
you as the publisher of these copies.  The front cover must present
the full title with all words of the title equally prominent and
visible.  You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
</p>
<p>If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
</p>
<p>If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
</p>
<p>It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
</p>
</li><li>
MODIFICATIONS

<p>You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it.  In addition, you must do these things in the Modified Version:
</p>
<ol>
<li>
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document).  You may use the same title as a previous version
if the original publisher of that version gives permission.

</li><li>
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.

</li><li>
State on the Title page the name of the publisher of the
Modified Version, as the publisher.

</li><li>
Preserve all the copyright notices of the Document.

</li><li>
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.

</li><li>
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.

</li><li>
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document&rsquo;s license notice.

</li><li>
Include an unaltered copy of this License.

</li><li>
Preserve the section Entitled &ldquo;History&rdquo;, Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page.  If
there is no section Entitled &ldquo;History&rdquo; in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.

</li><li>
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on.  These may be placed in the &ldquo;History&rdquo; section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.

</li><li>
For any section Entitled &ldquo;Acknowledgements&rdquo; or &ldquo;Dedications&rdquo;, Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.

</li><li>
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles.  Section numbers
or the equivalent are not considered part of the section titles.

</li><li>
Delete any section Entitled &ldquo;Endorsements&rdquo;.  Such a section
may not be included in the Modified Version.

</li><li>
Do not retitle any existing section to be Entitled &ldquo;Endorsements&rdquo; or
to conflict in title with any Invariant Section.

</li><li>
Preserve any Warranty Disclaimers.
</li></ol>

<p>If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant.  To do this, add their titles to the
list of Invariant Sections in the Modified Version&rsquo;s license notice.
These titles must be distinct from any other section titles.
</p>
<p>You may add a section Entitled &ldquo;Endorsements&rdquo;, provided it contains
nothing but endorsements of your Modified Version by various
parties&mdash;for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
</p>
<p>You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version.  Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity.  If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
</p>
<p>The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
</p>
</li><li>
COMBINING DOCUMENTS

<p>You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
</p>
<p>The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy.  If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
</p>
<p>In the combination, you must combine any sections Entitled &ldquo;History&rdquo;
in the various original documents, forming one section Entitled
&ldquo;History&rdquo;; likewise combine any sections Entitled &ldquo;Acknowledgements&rdquo;,
and any sections Entitled &ldquo;Dedications&rdquo;.  You must delete all
sections Entitled &ldquo;Endorsements.&rdquo;
</p>
</li><li>
COLLECTIONS OF DOCUMENTS

<p>You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
</p>
<p>You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
</p>
</li><li>
AGGREGATION WITH INDEPENDENT WORKS

<p>A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an &ldquo;aggregate&rdquo; if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation&rsquo;s users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
</p>
<p>If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document&rsquo;s Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
</p>
</li><li>
TRANSLATION

<p>Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections.  You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers.  In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
</p>
<p>If a section in the Document is Entitled &ldquo;Acknowledgements&rdquo;,
&ldquo;Dedications&rdquo;, or &ldquo;History&rdquo;, the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
</p>
</li><li>
TERMINATION

<p>You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License.  Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License.  However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
</p>
</li><li>
FUTURE REVISIONS OF THIS LICENSE

<p>The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time.  Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.  See
<a href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</a>.
</p>
<p>Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License &ldquo;or any later version&rdquo; applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation.  If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
</p></li></ol>


<a name="ADDENDUM_003a-How-to-use-this-License-for-your-documents"></a>
<h2 class="heading">ADDENDUM: How to use this License for your documents</h2>

<p>To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
</p>
<table><tr><td>&nbsp;</td><td><pre class="smallexample">  Copyright (C)  <var>year</var>  <var>your name</var>.
  Permission is granted to copy, distribute and/or modify this document
  under the terms of the GNU Free Documentation License, Version 1.2
  or any later version published by the Free Software Foundation;
  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
  Texts.  A copy of the license is included in the section entitled ``GNU
  Free Documentation License''.
</pre></td></tr></table>

<p>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the &ldquo;with&hellip;Texts.&rdquo; line with this:
</p>
<table><tr><td>&nbsp;</td><td><pre class="smallexample">    with the Invariant Sections being <var>list their titles</var>, with
    the Front-Cover Texts being <var>list</var>, and with the Back-Cover Texts
    being <var>list</var>.
</pre></td></tr></table>

<p>If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
</p>
<p>If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
</p>


<hr size="6">
<a name="Index"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Copying-This-Manual" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[ &gt; ]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Copying-This-Manual" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[ &gt;&gt; ]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Index-1"></a>
<h1 class="unnumbered">Index</h1>

<table><tr><th valign="top">Jump to: &nbsp; </th><td><a href="#Index-1_cp_letter-A" class="summary-letter"><b>A</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-B" class="summary-letter"><b>B</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-C" class="summary-letter"><b>C</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-D" class="summary-letter"><b>D</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-E" class="summary-letter"><b>E</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-F" class="summary-letter"><b>F</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-G" class="summary-letter"><b>G</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-H" class="summary-letter"><b>H</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-I" class="summary-letter"><b>I</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-J" class="summary-letter"><b>J</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-L" class="summary-letter"><b>L</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-M" class="summary-letter"><b>M</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-N" class="summary-letter"><b>N</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-O" class="summary-letter"><b>O</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-P" class="summary-letter"><b>P</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-Q" class="summary-letter"><b>Q</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-R" class="summary-letter"><b>R</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-S" class="summary-letter"><b>S</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-T" class="summary-letter"><b>T</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-V" class="summary-letter"><b>V</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-W" class="summary-letter"><b>W</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-X" class="summary-letter"><b>X</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-Y" class="summary-letter"><b>Y</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-Z" class="summary-letter"><b>Z</b></a>
 &nbsp; 
</td></tr></table>
<table border="0" class="index-cp">
<tr><td></td><th align="left">Index Entry</th><th align="left"> Section</th></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-A">A</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-AddLegend">AddLegend</a></td><td valign="top"><a href="#Legend">3.9 Legend</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Adjust">Adjust</a></td><td valign="top"><a href="#Ticks">3.3.3 Ticks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-alpha">alpha</a></td><td valign="top"><a href="#Command-options">2.7 Command options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Alpha">Alpha</a></td><td valign="top"><a href="#Transparency">3.2.1 Transparency</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-alphadef">alphadef</a></td><td valign="top"><a href="#Command-options">2.7 Command options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-AlphaDef">AlphaDef</a></td><td valign="top"><a href="#Transparency">3.2.1 Transparency</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Ambient">Ambient</a></td><td valign="top"><a href="#Lighting">3.2.2 Lighting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Area">Area</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Arrows">Arrows</a></td><td valign="top"><a href="#Line-styles">2.3 Line styles</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ArrowSize">ArrowSize</a></td><td valign="top"><a href="#Default-sizes">3.2.4 Default sizes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ask">ask</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Aspect">Aspect</a></td><td valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Axial">Axial</a></td><td valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Axis">Axis</a></td><td valign="top"><a href="#Curved-coordinates">3.3.2 Curved coordinates</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Axis-1">Axis</a></td><td valign="top"><a href="#Axis-and-Colorbar">3.8 Axis and Colorbar</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-AxisStl">AxisStl</a></td><td valign="top"><a href="#Ticks">3.3.3 Ticks</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-B">B</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Ball">Ball</a></td><td valign="top"><a href="#Primitives">3.6 Primitives</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Barh">Barh</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Bars">Bars</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-BarWidth">BarWidth</a></td><td valign="top"><a href="#Default-sizes">3.2.4 Default sizes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Beam">Beam</a></td><td valign="top"><a href="#g_t3D-plotting">3.12 3D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Belt">Belt</a></td><td valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Box">Box</a></td><td valign="top"><a href="#Axis-and-Colorbar">3.8 Axis and Colorbar</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-BoxPlot">BoxPlot</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Boxs">Boxs</a></td><td valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-C">C</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-call">call</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Candle">Candle</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Chart">Chart</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-chdir">chdir</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Clean">Clean</a></td><td valign="top"><a href="#Data-resizing">4.3 Data resizing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ClearLegend">ClearLegend</a></td><td valign="top"><a href="#Legend">3.9 Legend</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Clf">Clf</a></td><td valign="top"><a href="#Primitives">3.6 Primitives</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Cloud">Cloud</a></td><td valign="top"><a href="#g_t3D-plotting">3.12 3D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Color-scheme">Color scheme</a></td><td valign="top"><a href="#Color-scheme">2.4 Color scheme</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Colorbar">Colorbar</a></td><td valign="top"><a href="#Axis-and-Colorbar">3.8 Axis and Colorbar</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Column">Column</a></td><td valign="top"><a href="#Make-another-data">4.6 Make another data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ColumnPlot">ColumnPlot</a></td><td valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Combine">Combine</a></td><td valign="top"><a href="#Make-another-data">4.6 Make another data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Cone">Cone</a></td><td valign="top"><a href="#Primitives">3.6 Primitives</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Cones">Cones</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Cont">Cont</a></td><td valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Cont3">Cont3</a></td><td valign="top"><a href="#g_t3D-plotting">3.12 3D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ContD">ContD</a></td><td valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ContF">ContF</a></td><td valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ContF3">ContF3</a></td><td valign="top"><a href="#g_t3D-plotting">3.12 3D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ContFXYZ">ContFXYZ</a></td><td valign="top"><a href="#Other-plotting">3.15 Other plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ContXYZ">ContXYZ</a></td><td valign="top"><a href="#Other-plotting">3.15 Other plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CosFFT">CosFFT</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CRange">CRange</a></td><td valign="top"><a href="#Ranges-_0028bounding-box_0029">3.3.1 Ranges (bounding box)</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Create">Create</a></td><td valign="top"><a href="#Data-resizing">4.3 Data resizing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Crop">Crop</a></td><td valign="top"><a href="#Data-resizing">4.3 Data resizing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Crust">Crust</a></td><td valign="top"><a href="#Other-plotting">3.15 Other plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CTick">CTick</a></td><td valign="top"><a href="#Ticks">3.3.3 Ticks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-CumSum">CumSum</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Curve">Curve</a></td><td valign="top"><a href="#Primitives">3.6 Primitives</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Cut">Cut</a></td><td valign="top"><a href="#Cutting">3.2.5 Cutting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-cut">cut</a></td><td valign="top"><a href="#Command-options">2.7 Command options</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-D">D</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-DataGrid">DataGrid</a></td><td valign="top"><a href="#Data-manipulation">3.17 Data manipulation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-defchr">defchr</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-define">define</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-defnum">defnum</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-defpal">defpal</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Delete">Delete</a></td><td valign="top"><a href="#Data-resizing">4.3 Data resizing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Dens">Dens</a></td><td valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Dens3">Dens3</a></td><td valign="top"><a href="#g_t3D-plotting">3.12 3D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-DensXYZ">DensXYZ</a></td><td valign="top"><a href="#Other-plotting">3.15 Other plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Dew">Dew</a></td><td valign="top"><a href="#Vector-fields">3.14 Vector fields</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Diff">Diff</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Diff2">Diff2</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Dots">Dots</a></td><td valign="top"><a href="#Other-plotting">3.15 Other plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Drop">Drop</a></td><td valign="top"><a href="#Primitives">3.6 Primitives</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-E">E</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-else">else</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-elseif">elseif</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-endif">endif</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Envelop">Envelop</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Error">Error</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Evaluate">Evaluate</a></td><td valign="top"><a href="#Make-another-data">4.6 Make another data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Export">Export</a></td><td valign="top"><a href="#File-I_002fO">4.5 File I/O</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Extend">Extend</a></td><td valign="top"><a href="#Data-resizing">4.3 Data resizing</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-F">F</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Face">Face</a></td><td valign="top"><a href="#Primitives">3.6 Primitives</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-FaceX">FaceX</a></td><td valign="top"><a href="#Primitives">3.6 Primitives</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-FaceY">FaceY</a></td><td valign="top"><a href="#Primitives">3.6 Primitives</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-FaceZ">FaceZ</a></td><td valign="top"><a href="#Primitives">3.6 Primitives</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Fall">Fall</a></td><td valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-fgets">fgets</a></td><td valign="top"><a href="#Text-printing">3.7 Text printing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Fill">Fill</a></td><td valign="top"><a href="#Data-manipulation">3.17 Data manipulation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Fill-1">Fill</a></td><td valign="top"><a href="#Data-filling">4.4 Data filling</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Fit">Fit</a></td><td valign="top"><a href="#Nonlinear-fitting">3.16 Nonlinear fitting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Fit2">Fit2</a></td><td valign="top"><a href="#Nonlinear-fitting">3.16 Nonlinear fitting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Fit3">Fit3</a></td><td valign="top"><a href="#Nonlinear-fitting">3.16 Nonlinear fitting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-FitS">FitS</a></td><td valign="top"><a href="#Nonlinear-fitting">3.16 Nonlinear fitting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Flow">Flow</a></td><td valign="top"><a href="#Vector-fields">3.14 Vector fields</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-FlowP">FlowP</a></td><td valign="top"><a href="#Vector-fields">3.14 Vector fields</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Fog">Fog</a></td><td valign="top"><a href="#Fog">3.2.3 Fog</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Font">Font</a></td><td valign="top"><a href="#Font-settings">3.2.6 Font settings</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Font-styles">Font styles</a></td><td valign="top"><a href="#Font-styles">2.5 Font styles</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-fontsize">fontsize</a></td><td valign="top"><a href="#Command-options">2.7 Command options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-for">for</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-FPlot">FPlot</a></td><td valign="top"><a href="#Other-plotting">3.15 Other plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-FSurf">FSurf</a></td><td valign="top"><a href="#Other-plotting">3.15 Other plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-func">func</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-G">G</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-GetNx">GetNx</a></td><td valign="top"><a href="#Data-information">4.9 Data information</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-GetNy">GetNy</a></td><td valign="top"><a href="#Data-information">4.9 Data information</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-GetNz">GetNz</a></td><td valign="top"><a href="#Data-information">4.9 Data information</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Glyph">Glyph</a></td><td valign="top"><a href="#Primitives">3.6 Primitives</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Grad">Grad</a></td><td valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Grid">Grid</a></td><td valign="top"><a href="#Axis-and-Colorbar">3.8 Axis and Colorbar</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Grid-1">Grid</a></td><td valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Grid3">Grid3</a></td><td valign="top"><a href="#g_t3D-plotting">3.12 3D plotting</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-H">H</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Hankel">Hankel</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Hist">Hist</a></td><td valign="top"><a href="#Data-manipulation">3.17 Data manipulation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Hist-1">Hist</a></td><td valign="top"><a href="#Make-another-data">4.6 Make another data</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-I">I</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-if">if</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Import">Import</a></td><td valign="top"><a href="#File-I_002fO">4.5 File I/O</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-InPlot">InPlot</a></td><td valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Insert">Insert</a></td><td valign="top"><a href="#Data-resizing">4.3 Data resizing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Integral">Integral</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-J">J</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Join">Join</a></td><td valign="top"><a href="#Data-resizing">4.3 Data resizing</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-L">L</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Label">Label</a></td><td valign="top"><a href="#Text-printing">3.7 Text printing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Label-1">Label</a></td><td valign="top"><a href="#Axis-and-Colorbar">3.8 Axis and Colorbar</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Label-2">Label</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Legend">Legend</a></td><td valign="top"><a href="#Legend">3.9 Legend</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-legend">legend</a></td><td valign="top"><a href="#Command-options">2.7 Command options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Light">Light</a></td><td valign="top"><a href="#Lighting">3.2.2 Lighting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Line">Line</a></td><td valign="top"><a href="#Primitives">3.6 Primitives</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Line-style">Line style</a></td><td valign="top"><a href="#Line-styles">2.3 Line styles</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-List">List</a></td><td valign="top"><a href="#Data-filling">4.4 Data filling</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-M">M</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Map">Map</a></td><td valign="top"><a href="#Dual-plotting">3.13 Dual plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Mark">Mark</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Mark-style">Mark style</a></td><td valign="top"><a href="#Line-styles">2.3 Line styles</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MarkSize">MarkSize</a></td><td valign="top"><a href="#Default-sizes">3.2.4 Default sizes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MathGL-setup">MathGL setup</a></td><td valign="top"><a href="#Graphics-setup">3.2 Graphics setup</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Max">Max</a></td><td valign="top"><a href="#Make-another-data">4.6 Make another data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Maximal">Maximal</a></td><td valign="top"><a href="#Data-information">4.9 Data information</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Mesh">Mesh</a></td><td valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MeshNum">MeshNum</a></td><td valign="top"><a href="#Default-sizes">3.2.4 Default sizes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-meshnum">meshnum</a></td><td valign="top"><a href="#Command-options">2.7 Command options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-mglData">mglData</a></td><td valign="top"><a href="#Data-constructor">4.2 Data constructor</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-mglFitPnts">mglFitPnts</a></td><td valign="top"><a href="#Nonlinear-fitting">3.16 Nonlinear fitting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-mglGraph">mglGraph</a></td><td valign="top"><a href="#MathGL-core">3. MathGL core</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Min">Min</a></td><td valign="top"><a href="#Make-another-data">4.6 Make another data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Minimal">Minimal</a></td><td valign="top"><a href="#Data-information">4.9 Data information</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Mirror">Mirror</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Modify">Modify</a></td><td valign="top"><a href="#Data-filling">4.4 Data filling</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Momentum">Momentum</a></td><td valign="top"><a href="#Make-another-data">4.6 Make another data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Momentum-1">Momentum</a></td><td valign="top"><a href="#Data-information">4.9 Data information</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-MultiPlot">MultiPlot</a></td><td valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-N">N</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-next">next</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Norm">Norm</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-NormSl">NormSl</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-O">O</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-once">once</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Origin">Origin</a></td><td valign="top"><a href="#Ranges-_0028bounding-box_0029">3.3.1 Ranges (bounding box)</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-P">P</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Palette">Palette</a></td><td valign="top"><a href="#Palette-and-colors">3.2.7 Palette and colors</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Perspective">Perspective</a></td><td valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Pipe">Pipe</a></td><td valign="top"><a href="#Vector-fields">3.14 Vector fields</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Plot">Plot</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Pop">Pop</a></td><td valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PrintInfo">PrintInfo</a></td><td valign="top"><a href="#Data-information">4.9 Data information</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Push">Push</a></td><td valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PutsFit">PutsFit</a></td><td valign="top"><a href="#Nonlinear-fitting">3.16 Nonlinear fitting</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-Q">Q</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-QuadPlot">QuadPlot</a></td><td valign="top"><a href="#Other-plotting">3.15 Other plotting</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-R">R</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Radar">Radar</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Ranges">Ranges</a></td><td valign="top"><a href="#Ranges-_0028bounding-box_0029">3.3.1 Ranges (bounding box)</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Read">Read</a></td><td valign="top"><a href="#File-I_002fO">4.5 File I/O</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ReadAll">ReadAll</a></td><td valign="top"><a href="#File-I_002fO">4.5 File I/O</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ReadHDF">ReadHDF</a></td><td valign="top"><a href="#File-I_002fO">4.5 File I/O</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ReadMat">ReadMat</a></td><td valign="top"><a href="#File-I_002fO">4.5 File I/O</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ReadRange">ReadRange</a></td><td valign="top"><a href="#File-I_002fO">4.5 File I/O</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Rearrange">Rearrange</a></td><td valign="top"><a href="#Data-resizing">4.3 Data resizing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Region">Region</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Resize">Resize</a></td><td valign="top"><a href="#Make-another-data">4.6 Make another data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-return">return</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Roll">Roll</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Roots">Roots</a></td><td valign="top"><a href="#Make-another-data">4.6 Make another data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Rotate">Rotate</a></td><td valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-RotateN">RotateN</a></td><td valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-RotateText">RotateText</a></td><td valign="top"><a href="#Font-settings">3.2.6 Font settings</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-S">S</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Save">Save</a></td><td valign="top"><a href="#File-I_002fO">4.5 File I/O</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SaveHDF">SaveHDF</a></td><td valign="top"><a href="#File-I_002fO">4.5 File I/O</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Set">Set</a></td><td valign="top"><a href="#Data-filling">4.4 Data filling</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SetLegendBox">SetLegendBox</a></td><td valign="top"><a href="#Legend">3.9 Legend</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SetLegendMarks">SetLegendMarks</a></td><td valign="top"><a href="#Legend">3.9 Legend</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SetSize">SetSize</a></td><td valign="top"><a href="#Export-picture">3.5 Export picture</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Sew">Sew</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SinFFT">SinFFT</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Smooth">Smooth</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Sort">Sort</a></td><td valign="top"><a href="#Data-resizing">4.3 Data resizing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Sphere">Sphere</a></td><td valign="top"><a href="#Primitives">3.6 Primitives</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Squeeze">Squeeze</a></td><td valign="top"><a href="#Data-resizing">4.3 Data resizing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Stem">Stem</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Step">Step</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-STFA">STFA</a></td><td valign="top"><a href="#Dual-plotting">3.13 Dual plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-StickPlot">StickPlot</a></td><td valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-stop">stop</a></td><td valign="top"><a href="#Program-flow-commands">1.2 Program flow commands</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SubData">SubData</a></td><td valign="top"><a href="#Make-another-data">4.6 Make another data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SubPlot">SubPlot</a></td><td valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Sum">Sum</a></td><td valign="top"><a href="#Make-another-data">4.6 Make another data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Surf">Surf</a></td><td valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Surf3">Surf3</a></td><td valign="top"><a href="#g_t3D-plotting">3.12 3D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Surf3A">Surf3A</a></td><td valign="top"><a href="#Dual-plotting">3.13 Dual plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Surf3C">Surf3C</a></td><td valign="top"><a href="#Dual-plotting">3.13 Dual plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SurfA">SurfA</a></td><td valign="top"><a href="#Dual-plotting">3.13 Dual plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-SurfC">SurfC</a></td><td valign="top"><a href="#Dual-plotting">3.13 Dual plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Swap">Swap</a></td><td valign="top"><a href="#Data-changing">4.7 Data changing</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-T">T</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Tape">Tape</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Tens">Tens</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Text">Text</a></td><td valign="top"><a href="#Text-printing">3.7 Text printing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-TextMark">TextMark</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Textual-formulas">Textual formulas</a></td><td valign="top"><a href="#Textual-formulas">2.6 Textual formulas</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-TickLen">TickLen</a></td><td valign="top"><a href="#Ticks">3.3.3 Ticks</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Tile">Tile</a></td><td valign="top"><a href="#g_t2D-plotting">3.11 2D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-TileS">TileS</a></td><td valign="top"><a href="#Dual-plotting">3.13 Dual plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Title">Title</a></td><td valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Torus">Torus</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Trace">Trace</a></td><td valign="top"><a href="#Make-another-data">4.6 Make another data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Traj">Traj</a></td><td valign="top"><a href="#Vector-fields">3.14 Vector fields</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Transpose">Transpose</a></td><td valign="top"><a href="#Data-resizing">4.3 Data resizing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-TranspType">TranspType</a></td><td valign="top"><a href="#Transparency">3.2.1 Transparency</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-TriCont">TriCont</a></td><td valign="top"><a href="#Other-plotting">3.15 Other plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-TriPlot">TriPlot</a></td><td valign="top"><a href="#Other-plotting">3.15 Other plotting</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Tube">Tube</a></td><td valign="top"><a href="#g_t1D-plotting">3.10 1D plotting</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-V">V</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-value">value</a></td><td valign="top"><a href="#Command-options">2.7 Command options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Var">Var</a></td><td valign="top"><a href="#Data-filling">4.4 Data filling</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Vect">Vect</a></td><td valign="top"><a href="#Vector-fields">3.14 Vector fields</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-View">View</a></td><td valign="top"><a href="#Subplots-and-rotation">3.4 Subplots and rotation</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-W">W</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Write">Write</a></td><td valign="top"><a href="#Export-to-file">3.5.1 Export to file</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-X">X</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-xrange">xrange</a></td><td valign="top"><a href="#Command-options">2.7 Command options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-XRange">XRange</a></td><td valign="top"><a href="#Ranges-_0028bounding-box_0029">3.3.1 Ranges (bounding box)</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-XTick">XTick</a></td><td valign="top"><a href="#Ticks">3.3.3 Ticks</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-Y">Y</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-YRange">YRange</a></td><td valign="top"><a href="#Ranges-_0028bounding-box_0029">3.3.1 Ranges (bounding box)</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-yrange">yrange</a></td><td valign="top"><a href="#Command-options">2.7 Command options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-YTick">YTick</a></td><td valign="top"><a href="#Ticks">3.3.3 Ticks</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Index-1_cp_letter-Z">Z</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-ZRange">ZRange</a></td><td valign="top"><a href="#Ranges-_0028bounding-box_0029">3.3.1 Ranges (bounding box)</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-zrange">zrange</a></td><td valign="top"><a href="#Command-options">2.7 Command options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ZTick">ZTick</a></td><td valign="top"><a href="#Ticks">3.3.3 Ticks</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
</table>
<table><tr><th valign="top">Jump to: &nbsp; </th><td><a href="#Index-1_cp_letter-A" class="summary-letter"><b>A</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-B" class="summary-letter"><b>B</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-C" class="summary-letter"><b>C</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-D" class="summary-letter"><b>D</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-E" class="summary-letter"><b>E</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-F" class="summary-letter"><b>F</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-G" class="summary-letter"><b>G</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-H" class="summary-letter"><b>H</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-I" class="summary-letter"><b>I</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-J" class="summary-letter"><b>J</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-L" class="summary-letter"><b>L</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-M" class="summary-letter"><b>M</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-N" class="summary-letter"><b>N</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-O" class="summary-letter"><b>O</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-P" class="summary-letter"><b>P</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-Q" class="summary-letter"><b>Q</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-R" class="summary-letter"><b>R</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-S" class="summary-letter"><b>S</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-T" class="summary-letter"><b>T</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-V" class="summary-letter"><b>V</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-W" class="summary-letter"><b>W</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-X" class="summary-letter"><b>X</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-Y" class="summary-letter"><b>Y</b></a>
 &nbsp; 
<a href="#Index-1_cp_letter-Z" class="summary-letter"><b>Z</b></a>
 &nbsp; 
</td></tr></table>

<hr size="6">
<a name="SEC_Contents"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1>Table of Contents</h1>
<div class="contents">

<ul class="toc">
  <li><a name="toc-MGL-scripts-1" href="#MGL-scripts">1. MGL scripts</a>
  <ul class="toc">
    <li><a name="toc-MGL-definition-1" href="#MGL-definition">1.1 MGL definition</a></li>
    <li><a name="toc-Program-flow-commands-1" href="#Program-flow-commands">1.2 Program flow commands</a></li>
  </ul></li>
  <li><a name="toc-General-concepts-1" href="#General-concepts">2. General concepts</a>
  <ul class="toc">
    <li><a name="toc-Coordinate-axes-1" href="#Coordinate-axes">2.1 Coordinate axes</a></li>
    <li><a name="toc-Color-styles-1" href="#Color-styles">2.2 Color styles</a></li>
    <li><a name="toc-Line-styles-1" href="#Line-styles">2.3 Line styles</a></li>
    <li><a name="toc-Color-scheme-1" href="#Color-scheme">2.4 Color scheme</a></li>
    <li><a name="toc-Font-styles-1" href="#Font-styles">2.5 Font styles</a></li>
    <li><a name="toc-Textual-formulas-1" href="#Textual-formulas">2.6 Textual formulas</a></li>
    <li><a name="toc-Command-options-1" href="#Command-options">2.7 Command options</a></li>
    <li><a name="toc-Interfaces-1" href="#Interfaces">2.8 Interfaces</a></li>
  </ul></li>
  <li><a name="toc-MathGL-core-1" href="#MathGL-core">3. MathGL core</a>
  <ul class="toc">
    <li><a name="toc-Create-and-delete-objects" href="#Constructor">3.1 Create and delete objects</a></li>
    <li><a name="toc-Graphics-setup-1" href="#Graphics-setup">3.2 Graphics setup</a>
    <ul class="toc">
      <li><a name="toc-Transparency-1" href="#Transparency">3.2.1 Transparency</a></li>
      <li><a name="toc-Lighting-1" href="#Lighting">3.2.2 Lighting</a></li>
      <li><a name="toc-Fog-1" href="#Fog">3.2.3 Fog</a></li>
      <li><a name="toc-Default-sizes-1" href="#Default-sizes">3.2.4 Default sizes</a></li>
      <li><a name="toc-Cutting-1" href="#Cutting">3.2.5 Cutting</a></li>
      <li><a name="toc-Font-settings-1" href="#Font-settings">3.2.6 Font settings</a></li>
      <li><a name="toc-Palette-and-colors-1" href="#Palette-and-colors">3.2.7 Palette and colors</a></li>
      <li><a name="toc-Error-handling-1" href="#Error-handling">3.2.8 Error handling</a></li>
    </ul></li>
    <li><a name="toc-Axis-settings-1" href="#Axis-settings">3.3 Axis settings</a>
    <ul class="toc">
      <li><a name="toc-Ranges-_0028bounding-box_0029-1" href="#Ranges-_0028bounding-box_0029">3.3.1 Ranges (bounding box)</a></li>
      <li><a name="toc-Curved-coordinates-1" href="#Curved-coordinates">3.3.2 Curved coordinates</a></li>
      <li><a name="toc-Ticks-1" href="#Ticks">3.3.3 Ticks</a></li>
    </ul></li>
    <li><a name="toc-Subplots-and-rotation-1" href="#Subplots-and-rotation">3.4 Subplots and rotation</a></li>
    <li><a name="toc-Export-picture-1" href="#Export-picture">3.5 Export picture</a>
    <ul class="toc">
      <li><a name="toc-Export-to-file-1" href="#Export-to-file">3.5.1 Export to file</a></li>
      <li><a name="toc-Frames_002fAnimation-1" href="#Frames_002fAnimation">3.5.2 Frames/Animation</a></li>
      <li><a name="toc-Bitmap-in-memory-1" href="#Bitmap-in-memory">3.5.3 Bitmap in memory</a></li>
      <li><a name="toc-Parallelization-1" href="#Parallelization">3.5.4 Parallelization</a></li>
    </ul></li>
    <li><a name="toc-Primitives-1" href="#Primitives">3.6 Primitives</a></li>
    <li><a name="toc-Text-printing-1" href="#Text-printing">3.7 Text printing</a></li>
    <li><a name="toc-Axis-and-Colorbar-1" href="#Axis-and-Colorbar">3.8 Axis and Colorbar</a></li>
    <li><a name="toc-Legend-1" href="#Legend">3.9 Legend</a></li>
    <li><a name="toc-1D-plotting-1" href="#g_t1D-plotting">3.10 1D plotting</a></li>
    <li><a name="toc-2D-plotting-1" href="#g_t2D-plotting">3.11 2D plotting</a></li>
    <li><a name="toc-3D-plotting-1" href="#g_t3D-plotting">3.12 3D plotting</a></li>
    <li><a name="toc-Dual-plotting-1" href="#Dual-plotting">3.13 Dual plotting</a></li>
    <li><a name="toc-Vector-fields-1" href="#Vector-fields">3.14 Vector fields</a></li>
    <li><a name="toc-Other-plotting-1" href="#Other-plotting">3.15 Other plotting</a></li>
    <li><a name="toc-Nonlinear-fitting-1" href="#Nonlinear-fitting">3.16 Nonlinear fitting</a></li>
    <li><a name="toc-Data-manipulation-1" href="#Data-manipulation">3.17 Data manipulation</a></li>
  </ul></li>
  <li><a name="toc-Data-processing-1" href="#Data-processing">4. Data processing</a>
  <ul class="toc">
    <li><a name="toc-Public-variables-1" href="#Public-variables">4.1 Public variables</a></li>
    <li><a name="toc-Data-constructor-1" href="#Data-constructor">4.2 Data constructor</a></li>
    <li><a name="toc-Data-resizing-1" href="#Data-resizing">4.3 Data resizing</a></li>
    <li><a name="toc-Data-filling-1" href="#Data-filling">4.4 Data filling</a></li>
    <li><a name="toc-File-I_002fO-1" href="#File-I_002fO">4.5 File I/O</a></li>
    <li><a name="toc-Make-another-data-1" href="#Make-another-data">4.6 Make another data</a></li>
    <li><a name="toc-Data-changing-1" href="#Data-changing">4.7 Data changing</a></li>
    <li><a name="toc-Interpolation-1" href="#Interpolation">4.8 Interpolation</a></li>
    <li><a name="toc-Data-information-1" href="#Data-information">4.9 Data information</a></li>
    <li><a name="toc-Operators-1" href="#Operators">4.10 Operators</a></li>
    <li><a name="toc-Global-functions-1" href="#Global-functions">4.11 Global functions</a></li>
    <li><a name="toc-Evaluate-expression-1" href="#Evaluate-expression">4.12 Evaluate expression</a></li>
    <li><a name="toc-MGL-variables-1" href="#MGL-variables">4.13 MGL variables</a></li>
  </ul></li>
  <li><a name="toc-MathGL-examples" href="#Examples">5. MathGL examples</a>
  <ul class="toc">
    <li><a name="toc-Basic-usage-1" href="#Basic-usage">5.1 Basic usage</a></li>
    <li><a name="toc-Advanced-usage-1" href="#Advanced-usage">5.2 Advanced usage</a>
    <ul class="toc">
      <li><a name="toc-Subplots-1" href="#Subplots">5.2.1 Subplots</a></li>
      <li><a name="toc-Axis-and-ticks-1" href="#Axis-and-ticks">5.2.2 Axis and ticks</a></li>
      <li><a name="toc-Curvilinear-coordinates-1" href="#Curvilinear-coordinates">5.2.3 Curvilinear coordinates</a></li>
      <li><a name="toc-Colorbars-1" href="#Colorbars">5.2.4 Colorbars</a></li>
      <li><a name="toc-Bounding-box-1" href="#Bounding-box">5.2.5 Bounding box</a></li>
      <li><a name="toc-Ternary-axis-1" href="#Ternary-axis">5.2.6 Ternary axis</a></li>
      <li><a name="toc-Text-features-1" href="#Text-features">5.2.7 Text features</a></li>
      <li><a name="toc-Legend-sample-1" href="#Legend-sample">5.2.8 Legend sample</a></li>
      <li><a name="toc-Cutting-sample-1" href="#Cutting-sample">5.2.9 Cutting sample</a></li>
    </ul></li>
    <li><a name="toc-Data-handling-1" href="#Data-handling">5.3 Data handling</a>
    <ul class="toc">
      <li><a name="toc-Array-creation-1" href="#Array-creation">5.3.1 Array creation</a></li>
      <li><a name="toc-Change-data-1" href="#Change-data">5.3.2 Change data</a></li>
    </ul></li>
    <li><a name="toc-Data-plotting-1" href="#Data-plotting">5.4 Data plotting</a></li>
    <li><a name="toc-1D-samples-1" href="#g_t1D-samples">5.5 1D samples</a>
    <ul class="toc">
      <li><a name="toc-Plot-sample-1" href="#Plot-sample">5.5.1 Plot sample</a></li>
      <li><a name="toc-Radar-sample-1" href="#Radar-sample">5.5.2 Radar sample</a></li>
      <li><a name="toc-Step-sample-1" href="#Step-sample">5.5.3 Step sample</a></li>
      <li><a name="toc-Tens-sample-1" href="#Tens-sample">5.5.4 Tens sample</a></li>
      <li><a name="toc-Area-sample-1" href="#Area-sample">5.5.5 Area sample</a></li>
      <li><a name="toc-Region-sample-1" href="#Region-sample">5.5.6 Region sample</a></li>
      <li><a name="toc-Stem-sample-1" href="#Stem-sample">5.5.7 Stem sample</a></li>
      <li><a name="toc-Bars-sample-1" href="#Bars-sample">5.5.8 Bars sample</a></li>
      <li><a name="toc-Barh-sample-1" href="#Barh-sample">5.5.9 Barh sample</a></li>
      <li><a name="toc-Cones-sample-1" href="#Cones-sample">5.5.10 Cones sample</a></li>
      <li><a name="toc-Chart-sample-1" href="#Chart-sample">5.5.11 Chart sample</a></li>
      <li><a name="toc-BoxPlot-sample-1" href="#BoxPlot-sample">5.5.12 BoxPlot sample</a></li>
      <li><a name="toc-Candle-sample-1" href="#Candle-sample">5.5.13 Candle sample</a></li>
      <li><a name="toc-Error-sample-1" href="#Error-sample">5.5.14 Error sample</a></li>
      <li><a name="toc-Mark-sample-1" href="#Mark-sample">5.5.15 Mark sample</a></li>
      <li><a name="toc-TextMark-sample-1" href="#TextMark-sample">5.5.16 TextMark sample</a></li>
      <li><a name="toc-Label-sample-1" href="#Label-sample">5.5.17 Label sample</a></li>
      <li><a name="toc-Table-sample-1" href="#Table-sample">5.5.18 Table sample</a></li>
      <li><a name="toc-Tube-sample-1" href="#Tube-sample">5.5.19 Tube sample</a></li>
      <li><a name="toc-Tape-sample-1" href="#Tape-sample">5.5.20 Tape sample</a></li>
      <li><a name="toc-Torus-sample-1" href="#Torus-sample">5.5.21 Torus sample</a></li>
    </ul></li>
    <li><a name="toc-2D-samples-1" href="#g_t2D-samples">5.6 2D samples</a>
    <ul class="toc">
      <li><a name="toc-Surf-sample-1" href="#Surf-sample">5.6.1 Surf sample</a></li>
      <li><a name="toc-SurfC-sample-1" href="#SurfC-sample">5.6.2 SurfC sample</a></li>
      <li><a name="toc-SurfA-sample-1" href="#SurfA-sample">5.6.3 SurfA sample</a></li>
      <li><a name="toc-Mesh-sample-1" href="#Mesh-sample">5.6.4 Mesh sample</a></li>
      <li><a name="toc-Fall-sample-1" href="#Fall-sample">5.6.5 Fall sample</a></li>
      <li><a name="toc-Belt-sample-1" href="#Belt-sample">5.6.6 Belt sample</a></li>
      <li><a name="toc-Boxs-sample-1" href="#Boxs-sample">5.6.7 Boxs sample</a></li>
      <li><a name="toc-Tile-sample-1" href="#Tile-sample">5.6.8 Tile sample</a></li>
      <li><a name="toc-TileS-sample-1" href="#TileS-sample">5.6.9 TileS sample</a></li>
      <li><a name="toc-Dens-sample-1" href="#Dens-sample">5.6.10 Dens sample</a></li>
      <li><a name="toc-Cont-sample-1" href="#Cont-sample">5.6.11 Cont sample</a></li>
      <li><a name="toc-ContF-sample-1" href="#ContF-sample">5.6.12 ContF sample</a></li>
      <li><a name="toc-ContD-sample-1" href="#ContD-sample">5.6.13 ContD sample</a></li>
      <li><a name="toc-ContV-sample-1" href="#ContV-sample">5.6.14 ContV sample</a></li>
      <li><a name="toc-Axial-sample-1" href="#Axial-sample">5.6.15 Axial sample</a></li>
      <li><a name="toc-Grad-sample-1" href="#Grad-sample">5.6.16 Grad sample</a></li>
    </ul></li>
    <li><a name="toc-3D-samples-1" href="#g_t3D-samples">5.7 3D samples</a>
    <ul class="toc">
      <li><a name="toc-Surf3-sample-1" href="#Surf3-sample">5.7.1 Surf3 sample</a></li>
      <li><a name="toc-Surf3C-sample-1" href="#Surf3C-sample">5.7.2 Surf3C sample</a></li>
      <li><a name="toc-Surf3A-sample-1" href="#Surf3A-sample">5.7.3 Surf3A sample</a></li>
      <li><a name="toc-Cloud-sample-1" href="#Cloud-sample">5.7.4 Cloud sample</a></li>
      <li><a name="toc-Dens3-sample-1" href="#Dens3-sample">5.7.5 Dens3 sample</a></li>
      <li><a name="toc-Cont3-sample-1" href="#Cont3-sample">5.7.6 Cont3 sample</a></li>
      <li><a name="toc-ContF3-sample-1" href="#ContF3-sample">5.7.7 ContF3 sample</a></li>
      <li><a name="toc-Dens-projection-sample-1" href="#Dens-projection-sample">5.7.8 Dens projection sample</a></li>
      <li><a name="toc-Cont-projection-sample-1" href="#Cont-projection-sample">5.7.9 Cont projection sample</a></li>
      <li><a name="toc-ContF-projection-sample-1" href="#ContF-projection-sample">5.7.10 ContF projection sample</a></li>
      <li><a name="toc-TriPlot-and-QuadPlot-1" href="#TriPlot-and-QuadPlot">5.7.11 TriPlot and QuadPlot</a></li>
      <li><a name="toc-Dots-sample-1" href="#Dots-sample">5.7.12 Dots sample</a></li>
    </ul></li>
    <li><a name="toc-Vector-field-samples-1" href="#Vector-field-samples">5.8 Vector field samples</a>
    <ul class="toc">
      <li><a name="toc-Vect-sample-1" href="#Vect-sample">5.8.1 Vect sample</a></li>
      <li><a name="toc-Vect3-sample-1" href="#Vect3-sample">5.8.2 Vect3 sample</a></li>
      <li><a name="toc-Traj-sample-1" href="#Traj-sample">5.8.3 Traj sample</a></li>
      <li><a name="toc-Flow-sample-1" href="#Flow-sample">5.8.4 Flow sample</a></li>
      <li><a name="toc-Pipe-sample-1" href="#Pipe-sample">5.8.5 Pipe sample</a></li>
      <li><a name="toc-Dew-sample-1" href="#Dew-sample">5.8.6 Dew sample</a></li>
    </ul></li>
    <li><a name="toc-Hints-1" href="#Hints">5.9 Hints</a>
    <ul class="toc">
      <li><a name="toc-_0060_0060Compound_0027_0027-graphics-1" href="#g_t_0060_0060Compound_0027_0027-graphics">5.9.1 &ldquo;Compound&rdquo; graphics</a></li>
      <li><a name="toc-Transparency-and-lighting-1" href="#Transparency-and-lighting">5.9.2 Transparency and lighting</a></li>
      <li><a name="toc-Types-of-transparency-1" href="#Types-of-transparency">5.9.3 Types of transparency</a></li>
      <li><a name="toc-Axis-projection-1" href="#Axis-projection">5.9.4 Axis projection</a></li>
      <li><a name="toc-Adding-fog-1" href="#Adding-fog">5.9.5 Adding fog</a></li>
      <li><a name="toc-Several-light-sources-1" href="#Several-light-sources">5.9.6 Several light sources</a></li>
      <li><a name="toc-Using-primitives-1" href="#Using-primitives">5.9.7 Using primitives</a></li>
      <li><a name="toc-STFA-sample-1" href="#STFA-sample">5.9.8 STFA sample</a></li>
      <li><a name="toc-Mapping-visualization-1" href="#Mapping-visualization">5.9.9 Mapping visualization</a></li>
      <li><a name="toc-Making-histogram-1" href="#Making-histogram">5.9.10 Making histogram</a></li>
      <li><a name="toc-Nonlinear-fitting-hints" href="#Nonlinear-fitting-sample">5.9.11 Nonlinear fitting hints</a></li>
      <li><a name="toc-PDE-solving-hints-1" href="#PDE-solving-hints">5.9.12 PDE solving hints</a></li>
      <li><a name="toc-MGL-parser-using-1" href="#MGL-parser-using">5.9.13 MGL parser using</a></li>
      <li><a name="toc-Using-options-1" href="#Using-options">5.9.14 Using options</a></li>
      <li><a name="toc-_0060_0060Templates_0027_0027-1" href="#g_t_0060_0060Templates_0027_0027">5.9.15 &ldquo;Templates&rdquo;</a></li>
      <li><a name="toc-Stereo-image-1" href="#Stereo-image">5.9.16 Stereo image</a></li>
      <li><a name="toc-Reduce-memory-usage-1" href="#Reduce-memory-usage">5.9.17 Reduce memory usage</a></li>
    </ul></li>
    <li><a name="toc-FAQ-1" href="#FAQ">5.10 FAQ</a></li>
  </ul></li>
  <li><a name="toc-Symbols-and-hot_002dkeys-1" href="#Symbols-and-hot_002dkeys">A. Symbols and hot-keys</a>
  <ul class="toc">
    <li><a name="toc-Symbols-for-styles-1" href="#Symbols-for-styles">A.1 Symbols for styles</a></li>
    <li><a name="toc-Hot_002dkeys-for-mglview-1" href="#Hot_002dkeys-for-mglview">A.2 Hot-keys for mglview</a></li>
    <li><a name="toc-Hot_002dkeys-for-UDAV-1" href="#Hot_002dkeys-for-UDAV">A.3 Hot-keys for UDAV</a></li>
  </ul></li>
  <li><a name="toc-GNU-Free-Documentation-License" href="#Copying-This-Manual">B. GNU Free Documentation License</a></li>
  <li><a name="toc-Index-1" href="#Index">Index</a></li>
</ul>
</div>
<hr size="1">
<a name="SEC_About"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1>About This Document</h1>
<p>
  This document was generated by <em>Build Daemon user</em> on <em>December 22, 2013</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
</p>
<p>
  The buttons in the navigation panels have the following meaning:
</p>
<table border="1">
  <tr>
    <th> Button </th>
    <th> Name </th>
    <th> Go to </th>
    <th> From 1.2.3 go to</th>
  </tr>
  <tr>
    <td align="center"> [ &lt; ] </td>
    <td align="center">Back</td>
    <td>Previous section in reading order</td>
    <td>1.2.2</td>
  </tr>
  <tr>
    <td align="center"> [ &gt; ] </td>
    <td align="center">Forward</td>
    <td>Next section in reading order</td>
    <td>1.2.4</td>
  </tr>
  <tr>
    <td align="center"> [ &lt;&lt; ] </td>
    <td align="center">FastBack</td>
    <td>Beginning of this chapter or previous chapter</td>
    <td>1</td>
  </tr>
  <tr>
    <td align="center"> [ Up ] </td>
    <td align="center">Up</td>
    <td>Up section</td>
    <td>1.2</td>
  </tr>
  <tr>
    <td align="center"> [ &gt;&gt; ] </td>
    <td align="center">FastForward</td>
    <td>Next chapter</td>
    <td>2</td>
  </tr>
  <tr>
    <td align="center"> [Top] </td>
    <td align="center">Top</td>
    <td>Cover (top) of document</td>
    <td> &nbsp; </td>
  </tr>
  <tr>
    <td align="center"> [Contents] </td>
    <td align="center">Contents</td>
    <td>Table of contents</td>
    <td> &nbsp; </td>
  </tr>
  <tr>
    <td align="center"> [Index] </td>
    <td align="center">Index</td>
    <td>Index</td>
    <td> &nbsp; </td>
  </tr>
  <tr>
    <td align="center"> [ ? ] </td>
    <td align="center">About</td>
    <td>About (help)</td>
    <td> &nbsp; </td>
  </tr>
</table>

<p>
  where the <strong> Example </strong> assumes that the current position is at <strong> Subsubsection One-Two-Three </strong> of a document of the following structure:
</p>

<ul>
  <li> 1. Section One
    <ul>
      <li>1.1 Subsection One-One
        <ul>
          <li>...</li>
        </ul>
      </li>
      <li>1.2 Subsection One-Two
        <ul>
          <li>1.2.1 Subsubsection One-Two-One</li>
          <li>1.2.2 Subsubsection One-Two-Two</li>
          <li>1.2.3 Subsubsection One-Two-Three &nbsp; &nbsp;
            <strong>&lt;== Current Position </strong></li>
          <li>1.2.4 Subsubsection One-Two-Four</li>
        </ul>
      </li>
      <li>1.3 Subsection One-Three
        <ul>
          <li>...</li>
        </ul>
      </li>
      <li>1.4 Subsection One-Four</li>
    </ul>
  </li>
</ul>

<hr size="1">
<p>
 <font size="-1">
  This document was generated by <em>Build Daemon user</em> on <em>December 22, 2013</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
 </font>
 <br>

</p>
</body>
</html>