File: UsersGuide.sgml

package info (click to toggle)
grace6 5.99.1%2Bdev4-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 10,492 kB
  • ctags: 13,269
  • sloc: ansic: 103,384; sh: 5,021; yacc: 617; makefile: 574; lex: 253; fortran: 56
file content (3069 lines) | stat: -rw-r--r-- 123,169 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
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
<!DOCTYPE linuxdoc SYSTEM>
<linuxdoc>

<!-- This is the User's Guide for Grace -->

<article>
 <titlepag>

  <title>Grace User's Guide (for Grace-5.99.1)</title>
  <author><name>The Grace Team</name></author>
  <date>06.05.2006</date>
  <abstract>
    This document explains the usage of
    <bf>Grace</bf>, a WYSIWYG 2D plotting tool for numerical data.
  </abstract>

 </titlepag>
 <toc>

<!-- **************************************** -->
<sect><heading>Introduction</heading>

<sect1><heading>What is Grace?</heading>
  <p>
     Grace is a WYSIWYG tool to make two-dimensional plots of scientific
     data. It runs under various (if not all) flavors of Unix with X11
     and M*tif (LessTif or Motif). It also runs under VMS, OS/2, and
     Windows (95/98/NT/XP). Its capabilities are roughly similar to
     GUI-based programs like Sigmaplot or Microcal Origin plus
     script-based tools like Gnuplot or Genplot. Its strength lies in the
     fact that it combines the convenience of a graphical user interface
     with the power of a scripting language which enables it to do
     sophisticated calculations or perform automated tasks.

     Grace is derived from Xmgr (a.k.a. ACE/gr), originally written by
     Paul Turner.

     From version number 4.00, the development was taken over by a
     team of volunteers under the coordination of Evgeny Stambulchik.
     You can get the newest information about Grace and download the
     latest version at the <url
     url="http://plasma-gate.weizmann.ac.il/Grace/" name="Grace home page">.

     When its copyright was changed to GPL, the name was changed to Grace,
     which stands for ``GRaphing, Advanced Computation and Exploration of
     data'' or ``Grace Revamps ACE/gr''. The first version of Grace available
     is named 5.0.0, while the last public version of Xmgr has the version
     number 4.1.2. Paul still maintains and develops a non-public version of
     Xmgr for internal use.

     As of now, most of the Grace codebase has been re-written from scratch.
  </p>
</sect1>

<sect1><heading>Copyright statement</heading>
  <p>

<tscreen><verb>
Copyright (&copy;) 1996-2006 Grace Development Team
Portions Copyright (&copy;) 1991-1995 Paul J Turner, Portland, OR

Maintained by Evgeny Stambulchik


                         All Rights Reserved

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</verb></tscreen>
   </p>

   <p>
     For certain libraries required to build Grace
     (which are therefore even included in a suitable version)
     there may be different Copyright/License statements. Though their
     License may by chance match the one used for Grace,
     the Grace Copyright holders can not influence or change them.
   </p>

   <p>
   <table loc="htbp">
     <tabular ca="ll">
       <hline>
       Package         |  License  @
       <hline>
       T1lib           |  LGPL     @
       Expat           |  MIT/X    @
       Xbae widget     |  BSD-like @
       Tab widget      |  BSD-like @
       ListTree widget |  LGPL     @
       <hline>
     </tabular>
     <caption>
       Third-party license terms
     </caption>
   </table>
  </p>
</sect1>
</sect>


<!-- **************************************** -->
<sect><heading>Installation guide</heading>

  <sect1><heading>Installing from sources</heading>
    <p>
      <enum>
        <item> Configuration <label id="configuration">
        <itemize>
          <item> Requirements.
                 Grace usually compiles out of the box in a regular Unix-like
                 environment. You need an ANSI C compiler (gcc is just fine),
                 the X11R5 or above libraries and headers, and an
                 implementaion of the M*tif API, version 1.2 or above (2.1 is
                 highly recommended).
                 If you want to compile your own changes to certain parts of
                 Grace, you will need a parser generator (<tt>yacc</tt> or,
                 better, <tt>bison</tt>).
          </item>
          <item> Extra libraries. Some features will be available only if
                 additional libraries are installed. Those are:
            <itemize>
              <item> Multi-level undo functionality is based on the libundo
                     library, version 0.8.0.
              </item>
              <item> All raster backends (PNG, JPEG, ...) are based on the
                     (<url name="Xmi library" url="http://www.gnu.org/software/libxmi/libxmi.html">),
                     version 1.2.
              </item>
              <item> The JPEG backend needs the IJG's
                     (<url name="JPEG library" url="ftp://ftp.uu.net/graphics/jpeg/">),
                     version 6.x.
              </item>
              <item> The PNG backend needs the <url name="libpng"
                     url="http://www.libpng.org/pub/png/libpng.html">
                     library (version 0.96 or above).
              </item>
              <item> The PDF driver requires the PDFlib library to be
                     installed, which is available
                     <url name="here" url="http://www.pdflib.com/">, version
                     6.0.0 or above.
              </item>
              <item> If your computer has the FFTW library (see the
                     <url name="FFTW Home page" url="http://www.fftw.org">)
                     installed when Grace is compiled, Grace will link itself
                     to this, and drop all conventional FFT's and DFT's. All
                     Fourier transforms will be routed through this package,
                     resulting in higher accuracy and better (much better
                     in many cases) performance. You'll need version 2.1.*,
                     since the FFTW-3 API is not supported as of yet.
              </item>
              <item> In order to read/write sets in the NetCDF data format, you
                     will also need the <url name="NetCDF libraries"
                     url="http://unidata.ucar.edu/packages/netcdf/index.html">.
              </item>
            </itemize>
          </item>
          <item> Decide whether you want to compile in a separate place (thus
                 leaving the source tree pristine). You most probably would
                 want it if compiling Grace for more than one OS and keeping
                 the sources in a central shared (e.g. via NFS) location.
                 If you don't need it, skip the rest of this paragraph and go
                 right to the next step. Otherwise, assuming the sources are
                 in <tt>/usr/local/src/grace-x.y.z</tt> and the compilation
                 will be performed in <tt>/tmp/grace-obj</tt>, do the following:
                 <verb>
  % mkdir /tmp/grace-obj
  % cd /tmp/grace-obj
  % /usr/local/src/grace-x.y.z/ac-tools/shtool mkshadow \
    /usr/local/src/grace-x.y.z .
                 </verb>
          </item>
          <item> The <tt>configure</tt> shell script attempts to guess correct
          values for various system-dependent variables used during
          compilation. It uses those values to create <tt>Make.conf</tt> in the
          top directory of the package. It also create <tt>config.h</tt> file
          containing system-dependent definitions. Finally, it creates a shell
          script <tt>config.status</tt> that you can run in the future to
          recreate the current configuration, a file <tt>config.cache</tt> that
          saves the results of its tests to speed up reconfiguring, and a file
          <tt>config.log</tt> containing compiler output (useful mainly for
          debugging <tt>configure</tt>). If at some point <tt>config.cache</tt>
          contains results you don't want to keep, you may remove or edit it.
          </item>
          <item> Run <tt>./configure --help</tt>
                 to get list of additional switches specific to Grace
          </item>
          <item> Run <tt>./configure &lt;options&gt;</tt>. Just an example:
                 <verb>
  % ./configure --enable-grace-home=/opt/grace 
    --with-extra-incpath=/usr/local/include:/opt/include \
    --with-extra-ldpath=/usr/local/lib:/opt/lib --prefix=/usr
                 </verb>
                 would use <tt>/usr/local/include</tt> and
                 <tt>/opt/include</tt> in addition to the default include path
                 and <tt>/usr/local/lib</tt> and <tt>/opt/lib</tt> in addition
                 to the default ld path. As well, all stuff would be put under
                 the /opt/grace directory and soft links made to
                 <tt>/usr/bin</tt>, <tt>/usr/lib</tt> and <tt>/usr/include</tt>.
          </item>
        </itemize>
        </item>
        <item> Compilation
         <itemize>
          <item> Issue <tt>make</tt>
              If something goes wrong, try to see if the problem has been
              described already in the <bf>Grace FAQ</bf> (in the <tt>doc</tt>
              directory).
          </item>
         </itemize>
        </item>
        <item> Testing
    
        <itemize>
          <item> <tt>make tests</tt>
              This will give you a slide show demonstrating some nice
              features of Grace.
          </item>
        </itemize>
        </item>
        <item> Installation
        <itemize>
          <item> <tt>make install</tt>
          </item>
          <item> <tt>make links</tt>
              The later (optional) step will make soft links from some files
              under the Grace home directory to the system-wide default
              locations (can be changed by the <tt>--prefix</tt> option
              during the configuration, see above).
          </item>
        </itemize>
       </item>
      </enum>
    </p>
  </sect1>

  <sect1><heading>Binary installation</heading>
    <p>
       We neither provide nor support binary builds. Please contact your
       vendor. Practically all general-purpose GNU/Linux and other Open Source
       distributions have a Grace package in either main or contributed
       sections.
    </p>
  </sect1>
</sect>

<!-- **************************************** -->
<sect><heading>Getting started</heading>
  <p>
    For a jump-in start, you can browse the demos ("Help/Examples" menu tree).
    These are ordinary Grace projects, so you can play with them and modify
    them.
  </p>
  <p>
    O.k. Here's a VERY quick introduction:
    <enum>
      <item> Start the GUI version: xmgrace (return).
      </item>
      <item> Load your data with Data/Import/ASCII. 'Load as': 'Single set' for
             two-column ASCII data, 'Block data' for multi-column ASCII data.
      </item>
      <item> Fire up project explorer (Edit/Explorer).
      </item>
      <item> Click on the top-level node of the project tree and select/check
             the page size.
      </item>
      <item> Adjust the scales, axis labels and tick marks in "Axis" quark
             properties.
      </item>
      <item> Adjust lines, symbols, legends in "Set" properties.
      </item>
      <item> Continue exploring the quark tree for finer tuning.
      </item>
      <item> Data can be manipulated in Data/Transformations. To shift a
             data set by 20 to the left, e.g., in 'Evaluate Expression'
             select the same set on the left and the right, and say Formula:
             y = y - 20.
             As you'll probably notice, Grace can do MUCH more than that.
             Explore at your leisure.
      </item>
      <item> When you like your plot, select 'File/Save'.
      </item>
      <item> Select 'File/Print setup' and then 'File/Print' to get a hardcopy.
             That's it!
      </item>
    </enum>
  </p>

  <sect1><heading>General concepts</heading>
      <sect2><heading>Project tree<label id="project-tree"></heading>
	<p>
          A plot in Grace is built in a tree-like manner (reflected
          1:1 in the Explorer tool) out of "Quarks". Quark is an object that
          may have its own presentation properties plus a number of children
          quarks.
	</p>
      </sect2>

      <sect2><heading>Coordinate frames <label id="coordinates"></heading>
	<p>
          Some quarks impose a coordinate transform; these are "Project",
          "Frame", and "Graph". Correspondly, there are three types of
          coordinates in Grace: the <bf>viewport</bf>, the <bf>frame</bf>, and
          the <bf>world coordinates</bf>. A child position is <it>always</it>
          defined in the coordinate frame of its parent, so e.g.   points of
          data sets are defined in the graph's world coordinates.
	</p>
          
	<p>
          The frame
          coordinates go from 0 to 1 in both X and Y dimensions of a Frame. 
	</p>
          
	<p>
          The viewport coordinates correspond to the image of the plot drawn on
          the canvas (or printed on, say, PS output page).
          Actually, there is yet another level in the hierarchy of coordinates
          - the <bf>device coordinates</bf>. However, you (as a user of Grace)
          should not worry about the latter. The mapping between the viewport
          coordinates and the device coordinates is always set in such a way
          that the origin of the viewport corresponds to the left bottom corner
          of the device page, the smallest of the device dimensions corresponds
          to one unit in the viewport coordinates. Oh, and the most important
          thing about the viewport &rarr; device transformation is that it is
          homotetic, i.e. a square is guaranteed to remain a square, not a
          rectangle, a circle remains a circle (not an ellipse) etc.
	</p>
          
	<p>
          The transformation converting the world coordinates into the frame
          and further into the viewport ones is determined by both the graph
          type and the axis scaling.
	</p>

	<p>
	</p>
      </sect2>

      <sect2><heading>Frames<label id="frame"></heading>
	<p>
          Frame is a rectangular placeholder for one or more graphs (if there
          are more than one graph in a frame, such graphs are called
          <bf>overlaid</bf>), and optional annotating objects (texts, boxes,
          etc). As well, Frame is responsible for displaying legend box holding
          legend entries for all of its children graphs.
	</p>
      </sect2>

      <sect2><heading>Graphs<label id="graph"></heading>
	<p>
          A graph may hold (every element is optional) Axes, Sets, and
          additional annotative objects.

          The graph type can be any of:<label id="graph-types">
          <itemize>
            <item> XY Graph </item>
            <item> XY Chart </item>
            <item> Polar Graph </item>
            <item> Fixed Graph </item>
            <item> Pie chart </item>
          </itemize>
	</p>
      </sect2>

      <sect2><heading>Sets<label id="sets"></heading>
	<p>
	  A set is a way of representing datasets. It consists
          of a pointer to a dataset plus a collection of parameters describing
          the visual appearance of the data (like color, line dash pattern etc).

          The set type can be any of the following:
        </p>
        
        <p>
          <table loc="htbp">
          <tabular ca="lcp{9cm}">
            <hline>
            Set type   | # of num. cols | Description @
            <hline>
            XY         | 2 | An X-Y scatter and/or line plot, plus (optionally) an annotated value @
            XYDX       | 3 | Same as XY, but with error bars (either one- or two-sided) along X axis @
            XYDY       | 3 | Same as XYDX, but error bars are along Y axis @
            XYDXDX     | 4 | Same as XYDX, but left and right error bars are defined separately @
            XYDYDY     | 4 | Same as XYDXDX, but error bars are along Y axis @
            XYDXDY     | 4 | Same as XY, but with X and Y error bars (either one- or two-sided) @
            XYDXDXDYDY | 6 | Same as XYDXDY, but left/right and upper/lower error bars are defined separately @
            BAR        | 2 | Same as XY, but vertical bars are used instead of symbols @
            BARDY      | 3 | Same as BAR, but with error bars (either one- or two-sided) along Y axis @
            BARDYDY    | 4 | Same as BARDY, but lower and upper error bars are defined separately @
            XYHILO     | 5 | Hi/Low/Open/Close plot @
            XYZ        | 3 | Same as XY; makes no sense unless the annotated value is Z @
            XYR        | 3 | X, Y,  Radius. Only allowed in Fixed graphs @
            XYSIZE     | 3 | Same as XY, but symbol size is variable @
            XYCOLOR    | 3 | X, Y, color index (of the symbol fill)@
            XYCOLPAT   | 4 | X, Y, color index, pattern index (currently used for Pie charts only) @
            XYVMAP     | 4 | Vector map @
            XYBOXPLOT  | 6 | Box plot (X, median, upper/lower limit, upper/lower whisker) @
            <hline>
          </tabular>
          <caption>
            Set types
          </caption>
          </table>
        </p>
          
        <p>
          Not all set types, however, can be plotted on any graph type. The
          following table summarizes it:
        </p>

        <p>
          <table loc="htbp">
          <tabular ca="lccccc">
            <hline>
            Set type          | XY Graph | XY Chart | Fixed | Polar | Pie @
            <hline>
            XY                |     +    |    +     |   +   |   +   |  +  @
            XYDX              |     +    |    -     |   +   |   -   |  -  @
            XYDY              |     +    |    +     |   +   |   -   |  -  @
            XYDXDX            |     +    |    -     |   +   |   -   |  -  @
            XYDYDY            |     +    |    +     |   +   |   -   |  -  @
            XYDXDY            |     +    |    -     |   +   |   -   |  -  @
            XYDXDXDYDY        |     +    |    -     |   +   |   -   |  -  @
            BAR               |     +    |    +     |   +   |   -   |  -  @
            BARDY             |     +    |    +     |   -   |   -   |  -  @
            BARDYDY           |     +    |    +     |   -   |   -   |  -  @
            XYHILO            |     +    |    -     |   -   |   -   |  -  @
            XYZ               |     +    |    -     |   +   |   +   |  -  @
            XYR               |     -    |    -     |   +   |   -   |  -  @
            XYSIZE            |     +    |    +     |   +   |   +   |  -  @
            XYCOLOR           |     +    |    +     |   +   |   +   |  +  @
            XYCOLPAT          |     -    |    -     |   -   |   -   |  +  @
            XYVMAP            |     +    |    -     |   +   |   -   |  -  @
            XYBOXPLOT         |     +    |    -     |   -   |   -   |  -  @
            <hline>
          </tabular>
          <caption>
            Graph/Set type connection
          </caption>
          </table>
	</p>
      </sect2>

      <sect2><heading>Regions<label id="regions"></heading>
	<p>
          Regions are sections of a graph defined by the interior or exterior
          of a polygon, or a half plane defined by a line. Regions are used to
          restrict data transformations to a geometric area covered by region.
          
          Regions are auxiliary objects which are not displayed in print
          outputs.
	</p>
      </sect2>


      <sect2><heading>Project files<label id="project-file"></heading>
	<p>
          A project file contains all information necessary to restore a plot
          created by Grace. Each plot is represented on a single page (this may
          change in future), but may have an unlimited number of graphs.You
          create a project file of your current plot with File/Save,Save as.
	</p>
      </sect2>

      <sect2><heading>Datasets<label id="datasets"></heading>
	<p>
          A dataset is an array of points with X and Y coordinates, up to
          four optional data values (which, depending on the set presentation
          type, can be displayed as error bars or like) and one optional
          character string.
	</p>
      </sect2>

      <sect2><heading>Input File formats <label id="files-formats"></heading>
	<p>
          Grace understands several input files formats. The most basic one is
          ASCII text files containing space and comma separated columns of
          data. The data fields can be either numeric (Fortran 'd' and 'D'
          exponent markers are supported) or alphanumeric (with or without
          quotes). Several calendar date formats are recognized automatically
          and you can specify your own reference for numeric dates formats.
          Depending on configuration, Grace can also read NetCDF files (see
          <ref id="configuration" name="configuration">).
	</p>
      </sect2>

      <sect2><heading>Real Time Input <label id="RTI"></heading>
	<p>
          Real Time Input refers to the ability Grace has to be
          fed in real time by an external program. The Grace
          process spawned by the driver program is a full-featured
          Grace instance: the user can interact using the GUI at the
          same time the program sends data and commands. The process
          will adapt itself to the incoming data rate.
	</p>
      </sect2>

      <sect2><heading>Hotlinks <label id="hotlinks"></heading>
	<p>
          Hotlinks are sources containing varying data. Grace can be
          instructed a file or a pipe is a hotlink in which case it
          will provide specific commands to refresh the data on a
          mouse click (a later version will probably allow automatic
          refresh).
	</p>
      </sect2>

      <sect2><heading>Devices<label id="devices"></heading>
	<p>
          Grace allows the user to choose between several output
          devices to produce its graphics. The current list of
          supported devices is:

          <itemize>
            <item> X11
            </item>
            <item> PostScript (level 1 and level 2), suitable for printing
            </item>
            <item> EPS (encapsulated PostScript)
            </item>
            <item> Metafile (which is Grace format, used at the moment mostly
                   for debugging purposes)
            </item>
            <item> MIF (Maker Interchange Format used by FrameMaker)
            </item>
            <item> SVG (Scalable Vector Graphics, a language for describing
                   two-dimensional vector and mixed vector/raster graphics
                   in XML)
            </item>
            <item> PDF (depends on extra libraries,
                   see <ref name="configuration" id="configuration">)
            </item>
            <item> PNM (portable anymap file format, depends on extra
                   libraries, see <ref name="configuration" id="configuration">)
            </item>
            <item> JPEG (depends on extra libraries,
                   see <ref name="configuration" id="configuration">)
            </item>
            <item> PNG (depends on extra libraries,
                   see <ref name="configuration" id="configuration">)
            </item>
          </itemize>
	</p>

        <p>
          Grace can also be instructed to launch conversion programs
          automatically based on file name. As an example you can produce many
          vector formats using pstoedit, or almost any image format using the
          netpbm suite (see also the <url name="FAQ" url="FAQ.html">).
	</p>
      </sect2>

      <sect2><heading>Magic path<label id="magic-path"></heading>
	<p>
          In many cases, when Grace needs to access a file given with a
          relative <tt>pathname</tt>, it searches for the file along the
          following path:
          <tt>./pathname:./.grace/pathname:~/.grace/pathname:$GRACE_HOME/pathname</tt>
	</p>
      </sect2>

      <sect2><heading>Dynamic modules<label id="dynamic-modules"></heading>
	<p>
          Grace can access external functions present in either system or
          third-party shared libraries or modules specially compiled for use
          with it. The term dynamic refers to the possibility Grace has to open
          the library at run time to find the code of the external function,
          there is no need to recompile Grace itself (the functions already
          compiled in Grace are "statically linked").
	</p>
      </sect2>
  </sect1>

  <sect1><heading>Invocation</heading>
    <sect2><heading>Operational mode</heading>
      <p>
        With respect to the user interface, there are three modes of
        operation that Grace can be invoked in. The full-featured GUI-based
        version is called <tt>xmgrace</tt>. A batch-printing version is
        called <tt>gracebat</tt>. A command-line interface mode is called
        <tt>grace</tt>. Usually, a single executable is called in all cases,
        with two of the three files being (symbolic) links to a "real" one.
      </p>
    </sect2>

    <sect2><heading>Command line options</heading>
      <p>
        <descrip>
        <tag> -autoscale <it>x|y|xy</it> </tag>
          <p>
              Set autoscale type
          </p>
        <tag> -barebones </tag>
          <p>
              Turn off all toolbars
          </p>
        <tag> -block <it>block_data</it> </tag>
          <p>
              Assume data file is block data
          </p>
        <tag> -datehint <it>iso|european|us|days|seconds|nohint</it> </tag>
          <p>
              Set the hint for dates analysis
          </p>
        <tag> -dpipe <it>descriptor</it> </tag>
          <p>
              Read data from descriptor (anonymous pipe) on startup
          </p>
        <tag> -fixed <it>width</it> <it>height</it> </tag>
          <p>
              Set canvas size fixed to width*height
          </p>
        <tag> -free </tag>
          <p>
              Use free page layout
          </p>
        <tag> -hardcopy </tag>
          <p>
              No interactive session, just print and quit
          </p>
        <tag> -hdevice <it>hardcopy_device_name</it> </tag>
          <p>
              Set default hardcopy device
          </p>
        <tag> -hdevice-options <it>option_string</it> </tag>
          <p>
              Set options for default hardcopy device
          </p>
        <tag> -install </tag>
          <p>
              Install private colormap
          </p>
        <tag> -noask </tag>
          <p>
              Assume the answer is yes to all requests - if the operation would
              overwrite a file, Grace will do so without prompting
          </p>
        <tag> -noinstall </tag>
          <p>
              Don't use private colormap
          </p>
        <tag> -noprint </tag>
          <p>
              In batch mode, do not print
          </p>
        <tag> -nosigcatch </tag>
          <p>
              Don't catch signals
          </p>
        <tag> -npipe <it>file</it> </tag>
          <p>
              Read data from named pipe on startup
          </p>
        <tag> -nxy <it>nxy_file</it> </tag>
          <p>
              Assume data file is in X Y1 Y2 Y3 ... format
          </p>
        <tag> -printfile <it>file</it> </tag>
          <p>
              Save print output to file
          </p>
        <tag> -results <it>results_file</it> </tag>
          <p>
              Write results of some data manipulations to results_file
          </p>
        <tag> -saveall <it>save_file</it> </tag>
          <p>
              Save all graphs to save_file
          </p>
        <tag> -seed <it>seed_value</it> </tag>
          <p>
              Integer seed for random number generator
          </p>
        <tag> -timer <it>delay</it> </tag>
          <p>
              Set allowed time slice for real time inputs to delay ms
          </p>
        <tag> -settype <it>xy|xydx|...</it> </tag>
          <p>
              Set the type of the next data file
          </p>
        <tag> -version </tag>
          <p>
              Show the program version
          </p>
        <tag> -wd <it>directory</it> </tag>
          <p>
              Set the working directory
          </p>
        <tag> -usage|-help </tag>
          <p>
              This message
          </p>
        </descrip>
      </p>
    </sect2>
  </sect1>

  <sect1><heading>Customization</heading>
    <sect2><heading>Environment variables <label id="environment-variables"></heading>
      <p>
        <descrip>
        <tag> GRACE&lowbar;HOME </tag>
               <p>
               Set the location of Grace. This will be where help files,
               auxiliary programs, and examples are located. If you are unable
               to find the location of this directory, contact your system
               administrator.
               </p>
        <tag> GRACE&lowbar;PRINT&lowbar;CMD </tag>
               <p>
               Print command. If the variable is defined but is an empty
               string, "Print to file" will be selected as default.
               </p>
        <tag> GRACE&lowbar;EDITOR </tag>
               <p>
               The editor used for manual editing of dataset values.
               </p>
        <tag> GRACE&lowbar;HELPVIEWER </tag>
               <p>
               Invocation string of an HTML viewer for on-line browsing of
               help documents. Must include "%s" to be replaced with an
               URL string.
               </p>
        <tag> GRACE&lowbar;FFTW&lowbar;WISDOM&lowbar;FILE and
               GRACE&lowbar;FFTW&lowbar;RAM&lowbar;WISDOM </tag>
               <p>
               These flags control behavior of the FFTW planner (see
               <ref id="fftw-tuning" name="FFTW tuning"> for detailed info).
               </p>
        </descrip>
      </p>
    </sect2>
    
    <sect2><heading>Default template<label id="default-template"></heading>
      <p>
        Whenever a new project is started, Grace loads the default template,
        <tt>templates/Default.xgr</tt>. The file is searched for in the magic
        path (see  <ref id="magic-path" name="magic path">); once found, the
        rest of the path is ignored.
      </p>
    </sect2>

    <sect2><heading>X resources</heading>
      <p>
        The following Grace-specific X resource settings are supported:

        <itemize>
          <item> XMgrace.invertDraw
                 <newline>
                 Use GXinvert rather than GXxor for rubber-band lines.
                 If the rubber-banding for zooms and lines, etc. doesn't
                 appear on the canvas, set this resource to yes.
          </item>

          <item> XMgrace.toolBar
                 <newline>
                 Enables button toolbar
          </item>

          <item> XMgrace.statusBar
                 <newline>
                 Enables status bar
          </item>

          <item> XMgrace.locatorBar
                 <newline>
                 Enables locator bar
          </item>

          <item> XMgrace.instantUpdate
                 <newline>
                 Enables instant update feature of Explorer
          </item>
        </itemize>


        It is also possible to customize menus by assigning key accelerators to
        any item.

        You'll need to derive the item's X resource name from the respective
        menu label, which is easily done following these rules:
        <itemize>
          <item> All non-alphanumeric characters are skipped
          </item>
          <item> Start with lower case; each new word (if any) continues from
                 the capital letter
          </item>
          <item> Add the item's type to the end - "Menu" for pulldown menus,
                 "Button" for menu buttons.
          </item>
        </itemize>
        
        For example, in order to make Grace popup the Non-linear curve fitting
        by pressing Control+F, you would add the following two lines

        <tt>
          XMgrace*transformationsMenu.nonLinearCurveFittingButton.acceleratorText: Ctrl+F
          <newline>
          XMgrace*transformationsMenu.nonLinearCurveFittingButton.accelerator: Ctrl&lt;Key&gt;f
        </tt>


        to your <tt>.Xresources</tt> file (the file which is read when an X
        session starts; it could be <tt>.Xdefaults</tt>, <tt>.Xsession</tt> or
        some other file - ask your system administrator when in doubt). 
      </p>

      <p>
          Similarly, it may be desirable to alter default filename patterns of
          file selection dialogs. The recipe for the dialog's name is like for
          menu buttons outlined above, with "Button" being replaced with "FSB".
          E.g., to list all files in the "Open project" dialog ("File/Open..."),
          set the following resource:
          
          <tt>
            XMgrace*openProjectFSB.pattern: *
          </tt>
          
      </p>
    </sect2>
  </sect1>
</sect>

<!-- **************************************** -->
<sect><heading>Guide to the graphical user interface<label id="GUI-guide"></heading>
  <sect1><heading>GUI controls</heading>
    <p>
    This section describes interface controls - basic building blocks, used in
    many popups.
    </p>
    <sect2><heading>File selection dialogs <label id="FS-dialog"></heading>
      <p>
      Whenever the user is expected to provide a filename, either for reading
      in or writing some data, a file selection dialog is popped up. In
      addition to the standard entries (the directory and file lists and the
      filter entry), there is a pulldown menu for quick directory change to
      pre-defined locations (the current working directory, user's home
      directory and the file system root). Also, a "Set as cwd" button is
      there which allows to set any directory as you navigate through the
      directory tree as the current working directory (cwd). Once defined, it
      can be used in any other file selection dialog to switch to that
      directory quickly.
      </p>
    </sect2>

    <sect2><heading>List selectors <label id="list-selector"></heading>
      <p>
      Various selectors are available in several popups. They all display
      lists of objects (graphs, sets, ...) and can be used to perform
      simple operations on these objects (copying, deleting, ...). The
      operations are available from a popup menu that appears when pressing
      mouse button 3 on them. Depending on the required functionality, they
      may allow multiple choices or not.
      
      <itemize>
        <item> hide </item>
        <item> show </item>
        <item> delete </item>
        <item> bring to front </item>
        <item> move up </item>
        <item> move down </item>
        <item> send to back </item>
        <item> selector operations
         <itemize>
           <item> select all </item>
           <item> unselect all </item>
           <item> invert selection </item>
           <item> update list </item>
         </itemize>
        </item>
      </itemize>
      
      The following shortcuts are enabled (if the result of an action would
      contradict the list's selection policy, this would be ignored):
      <itemize>
        <item> Ctrl+a select all </item>
        <item> Ctrl+u unselect all </item>
        <item> Ctrl+i invert selection </item>
      </itemize>
      </p>

      <sect3><heading> Frame selector <label id="frame-selector"></heading>
       <p>
        An extension of the <ref name="list selector" id="list-selector">.
        The additional operations that can be performed on frames through
        the frame selector's popup menu are:
        <itemize>
          <item> create new </item>
        </itemize>
       </p>
      </sect3>

      <sect3><heading> Graph selector <label id="graph-selector"></heading>
       <p>
        An extension of the <ref name="list selector" id="list-selector">.
        The additional operations that can be performed on graphs through
        the graph selector's popup menu are:
        <itemize>
          <item> create new </item>
          <item> focus to selected </item>
        </itemize>

        Double-clicking on a list entry will switch the focus to that graph.
       </p>
      </sect3>

      <sect3><heading> Set selector <label id="set-selector"></heading>
       <p>
        An extension of the <ref name="list selector" id="list-selector">.
        The additional operations that can be performed on sets through the
        set selector's popup menu are:
        <itemize>
          <item> edit
           <itemize>
            <item> in spreadsheet (see
                   <ref name="Spreadsheet data set editor" id="SSEditor">)
            </item>
            <item> in text editor
            </item>
           </itemize>
          </item>
          <item> create new
           <itemize>
            <item> by formula
            </item>
            <item> in spreadsheet (see
                   <ref name="Spreadsheet data set editor" id="SSEditor">)
            </item>
            <item> in text editor
            </item>
            <item> from block data
            </item>
           </itemize>
          </item>
        </itemize>

        Double-clicking on a list entry will open the spreadsheet editor
        (see <ref name="Spreadsheet data set editor" id="SSEditor">) on
        the set data.
       </p>
      </sect3>
    </sect2>

    <sect2><heading>Pen chooser<label id="pen-chooser"></heading>
    <p>
      Pen chooser lets you select a pen (a color+pattern combination) for
      drawing a line or filling in an object. When you click on the button,
      a dialog with color and pattern selectors will appear. When applied,
      the pen chooser will itself be painted by the pen. A faster way to
      alter pen's color is to press the right mouse button on it, which will
      invoke a color-change menu.
    </p>
    </sect2>

    <sect2><heading>Spreadsheet data set editor<label id="SSEditor"></heading>
    <p>
      The dialog presents an editable matrix of numbers, corresponding
      to the data set being edited. The set type (and hence, the number
      of data columns) can be changed using the "Type:" selector.
      Clicking on a column label pops up a dialog allowing to adjust
      the column formatting. Clicking on the row labels toggles the
      respective row state (selected/unselected). The selected rows can
      be deleted via the dialog's "Edit" menu. Another entry in this
      menu lets you add a row; the place of the new row is determined
      by the row containing a cell with the keyboard focus on. As well,
      just typing in an empty cell will add one or several rows
      (filling the intermediate rows with zeros).

      To resize columns, drag the vertical rules using Shift+Button 2.
    </p>
    </sect2> <!-- Spreadsheet data set editor -->
  </sect1>

  <sect1><heading>The main window<label id="main-window"></heading>

    <sect2><heading>The canvas<label id="canvas"></heading>

      <sect3><heading>Canvas hotkeys</heading>
        <p>

        When the pointer focus is on the canvas (where the graph is drawn),
        there are some shortcuts to activate several actions. They are:

        <itemize>
          <item> Ctrl &lt;Key&gt;A: Autoscale the current graph </item>
          <item> Ctrl &lt;Key&gt;U: Refresh hotlinks </item>
          <item> Ctrl &lt;Key&gt;Z: Zoom </item>
        </itemize>
       </p>
      </sect3>

      <sect3><heading>Clicks and double clicks<label id="clicks"></heading>
        <p>
          Mouse wheel (if you got one) scrolls the canvas vertically. With
          &lt;Ctrl&gt; pressed, the scroll direction is horizontal.
          Alternatively, simply drag the canvas with the mouse.
        </p>

        <p>
          A single click inside a graph switches focus to that graph. This is
          the default policy, but it can be changed from the "Edit/Preferences"
          popup.
        </p>

        <p>
          Double clicking on an object will invoke Explorer with the relevant
          Quark selected.
       </p>

        <p>
          Dragging an object with mouse is possible while &lt;Ctrl&gt; is
          pressed.
       </p>

        <p>
          Pressing 3-rd mouse button on an object pops up a context-sensitive
          menu.
       </p>
      </sect3>
    </sect2>

    <sect2><heading>Toolbar buttons<label id="toolbar"></heading>
      <p>
      Along the left-hand side of the canvas (if shown) is the ToolBar. It
      is armed with several buttons to provide quick and easy access to the
      more commonly used Grace functions; most of them operate on the current
      graph.

      <!--
      <itemize> 
        <item> <tt>  Draw</tt>: This will redraw the canvas and sets.
	  Useful if "Auto Redraw" has been deselected in the "Edit/Preferences"
	  dialog or after executing commands directly from the "Tools/Console"
	  dialog.
        </item>

        <item> <tt>  Lens</tt>: A zoom lens.  Click on the lens, then select the
          area of interest on the graph with the "rubber band".  The region
	  enclosed by the rubber band will fill the entire graph.
        </item>
        <item> <tt>    AS</tt>: AutoScale.  Autoscales the graph to contain all
          data points of all visible (not hidden) sets.
         </item>
        <item> <tt>   Z/z</tt>:  Zoom in/out by 5%. The zoom percentage can be
          set in the Edit/Preferences dialog.
        </item>
        <item> <tt>Arrows</tt>:  Scroll active graph by 5% in the arrow's
          direction.  The scroll percentage can be set in the
	  Edit/Preferences dialog.
        </item>
        <item> <tt>AutoT</tt>: AutoTick Axes.  This will find the optimum
          number of major and minor tick marks for both axes.
        </item>
        <item> <tt>ZX,ZY</tt>: Zoom along an axis.  These buttons work like the
          zoom lens above but are restricted to a single axis. 
        </item>
        <item> <tt>AX,AY</tt>: Autoscale one axis only.
        </item>
        <item> <tt>Exit</tt>: Pretty obvious, eh?
        </item>
      </itemize>
      -->
      </p>
    </sect2>
   </sect1>


   <sect1><heading> File menu <label id="file-menu"></heading>
   <p>
     The file menu contains all entries related to the input/output features
     of Grace.
   </p>

    <sect2><heading> New <label id="new"></heading>
     <p>
      Reset the state of Grace as if it had just started (one empty
      graph ranging from 0 to 1 along both axes). If some work has
      been done and not yet saved, a warning popup is displayed to
      allow canceling the operation.
      </p>
    </sect2>

    <sect2><heading> Open <label id="open"></heading>
     <p>
      Open an existing <ref id="project-file" name="project file">. A
      popup is displayed that allow to browse the file system.
      </p>
    </sect2>

    <sect2><heading> Save <label id="save"></heading>
     <p>
      Save the current work in a project file, using the name that was
      used for the last open or save. If no name has been set (i.e.,
      if the project has been created from scratch) act as <ref
      id="save-as" name="save as">.
      </p>
    </sect2>

    <sect2><heading> Save as <label id="save-as"></heading>
     <p>
      Save the current work in a project file with a new name. A popup allows
      to browse the file system and set the name, the format to use for saving
      data points (the default value is "%16.8g"), and a textual description of
      the project. A warning is displayed if a file with the same name already
      exists.
      </p>
    </sect2>

    <sect2><heading> Revert to saved <label id="revert-to-saved"></heading>
     <p>
      Abandon all modifications performed on the project since the
      last save. A confirmation popup is fired to allow the user
      canceling the operation.
      </p>
    </sect2>

    <sect2><heading> Print setup <label id="print-setup"></heading>
     <p>
      Set the properties of the printing device. Each device has its
      own set of specific options (see <ref name="Device-specific
      settings" id="device-settings">). According to the device, the
      output can be sent either directly to a printer or directed to a
      file. The global settings available for all devices are the
      sizing parameters. The size of the graph is fixed. Changing the 'Page'
      settings changes the size of the canvas underneath the graph.
      Switching between portrait and landscape rotates the canvas.
      Make sure the canvas size is large enough to hold your graph.
      Otherwise you get a 'Printout truncated' warning. If your canvas
      size cannot easily be changed because, for example, you want to
      print on letter size paper, you need to adjust the size of
      your graph ('Viewport' in Plot/Graph Appearance).
      </p>
    </sect2>

    <sect2><heading> Print <label id="print"></heading>
     <p>
      Print the project using the current printer settings
      </p>
    </sect2>

    <sect2><heading> Exit <label id="exit"></heading>
     <p>
      Exit from Grace. If some work has been done and not saved, a
      warning popup will be displayed to allow the user to cancel the
      operation.
      </p>
    </sect2>
   </sect1>

   <sect1><heading> Edit menu <label id="edit-menu"></heading>
       <sect2><heading>Explorer<label id="explorer"></heading>
         <p>
          This is the most complex dialog. It allows to tune presentation
          properties of any plot element.

          The left pane of the dialog shows the current project's tree
          structure. By clicking on a node, a "plugin" dialog corresponding  to
          the quark selected appears in the right pane. A few quarks of the
          same type can be selected; in this case, changes will be applied to
          all of them.
         </p>
          
          <sect3><heading>Project properties<label id="project-properties"></heading>
            <p>
              The project properties dialog lets you set page dimensions and
              the background color.
            </p>
          </sect3>

          <sect3><heading>Frame properties<label id="frame-properties"></heading>
            <p>
              The frame properties dialog governs location of the frame
              rectangle and legend properties.
            </p>
          </sect3>

          <sect3><heading>Graph properties<label id="graph-properties"></heading>
            <p>
              The main tab includes the properties you will need more often, in
              particular, properties related to the graph's coordinate frame.
              For each axis, you can define the axis range and a scale types:
              linear, logarithmic, or reciprocal, and you can invert the axis
              (which normally increases from left to right and from bottom to
              top).

              The "Locator" tab allows you to customize the display of the
              locator, mainly its type and the format and precision of the
              display.
            </p>
          </sect3>

          <sect3><heading>Set properties<label id="set-properties"></heading>
            <p>
              The main tab gathers the properties you will need more often
              (line and symbol properties or legend string for example), and
              other tabs are used to fine tune some less frequently used
              options (drop lines, fill properties, annotated values and error
              bars properties for example).

              You should note that, despite the legend string (related to
              <em>one</em> given set) is entered in the set properties popup,
              this is not sufficient to display it. Displaying <em>all</em>
              legends is a frame-level decision, so the toggle is in the main
              tab of the <ref name="frame properties" id="frame-properties">
              plugin dialog.

              If you need special characters or special formatting in your
              legend, you can use Grace escape sequences (the sequence will
              appear verbatim in the text field but will be rendered on the
              graph), see <ref name="typesetting" id="typesetting">. If you
              don't remember the mapping between alphabetic characters and the
              glyph you need in some specific fonts (mainly symbol and
              zapfdingbats), you can invoke the font tool from the text field
              by hitting CTRL-e. You can change fonts and select characters
              from there, they will be copied back in the text field when you
              press the "Accept" button.
            </p>
          </sect3>

          <sect3><heading>Axis properties<label id="axis-properties"></heading>
            <p>
              The main tab includes the properties you will need more often
              (axis label, tick spacing and format for example), and other tabs
              are used to fine tune some less frequently used options (fonts,
              sizes, colors, placements, stagger, grid lines, special ticks,
              ...).

              If you need special characters or special formatting in your
              label, you can use Grace escape sequences (the sequence will
              appear verbatim in the text field but will be rendered on the
              graph), see <ref name="typesetting" id="typesetting">. If you
              don't remember the mapping between alphabetic characters and the
              glyph you need in some specific fonts (mainly symbol and
              zapfdingbats), you can invoke the font tool from the text field
              by hitting CTRL-e. You can change fonts and select characters
              from there, they will be copied back in the text field when you
              press the "Accept" button.
            </p>
          </sect3>

          <sect3><heading>Annotated texts<label id="atext-properties"></heading>
            <p>
              Not written yet...
            </p>
          </sect3>

          <sect3><heading>Drawing objects<label id="dobject-properties"></heading>
            <p>
              Not written yet...
            </p>
          </sect3>

          <sect3><heading>Regions<label id="region-properties"></heading>
            <p>
              This dialog is incomplete as of yet.
            </p>
          </sect3>
      </sect2>

      <sect2><heading> Arrange frames <label id="arrange-frames"></heading>
      <p>
      This entry fires up a popup to lay out several graph frames in a
      regular grid given by <bf>M</bf> rows and <bf>N</bf> columns. 
      
      The frame selector at the top allows one to select a number of frames
      the arrangement will operate on. If the number of selected frames
      isn't equal to <bf>M</bf> times <bf>N</bf>,  new frames may be created
      or extra frames killed if needed. These options are  controlled by the
      respective checkboxes below the frame selector.
      
      The order in which the matrix is filled in with the frames can be
      selected (first horizontally then vertically or vise versa, with
      either of them inverted). 
      
      The rest of the controls of the dialog window deal with the matrix
      spacing: left/right/top/bottom page offsets (in the viewport
      coordinates) and <it>relative</it> inter-cell distances, vertical
      and horizontal. Next to each of the vertical/horizontal spacing
      spinboxes, a "Pack" checkbox is found. Enabling it effectively sets
      the respective inter-cell distance to zero.
      
      If you don't want the regular layout this arrangement gives you,
      you can change it afterwards.
      </p>
      </sect2>

      <sect2><heading> Autoscale graphs<label id="autoscale-graphs"></heading>
      <p>
      Using this entry, you can autoscale a graph
      according to the specified sets only. This is useful if you need
      either to have truly comparable graphs despite every one
      contains data of different ranges, or if you want to focus your
      attention on one set only while it is displayed with other data
      in a complex graph.
      </p>
      </sect2>

      <sect2><heading> Preferences <label id="preferences"></heading>
      <p>
      The preferences popup allows you to set miscellaneous properties
      of your Grace session, such as GUI behavior, cursor type, etc.
      </p>
      </sect2>
   </sect1>

   <sect1><heading> Data menu <label id="data-menu"></heading>
      <sect2><heading> Data set operations <label id="data-set-operations"></heading>
      <p>
      This popup gathers all operations that are related to the
      ordering of data points inside a set or between sets. You can
      sort according to any coordinate (X, Y, DX, ...)
      in ascending or descending order, reverse the order of the
      points, join several sets into one, split one set into several
      others of equal lengths, or drop a range of points from a
      set.
      </p>
      </sect2>

      <sect2><heading> Transformations menu <label id="transformations-menu"></heading>
      <p>
      The transformations sub-menu gives you access to all data-mining
      features of Grace.
      </p>

         <sect3><heading> Evaluate expression <label id="evaluate-expression"></heading>
         <p>
         Using evaluate expression allows you to create a set by
         applying an explicit formula to another set, or to parts of
         another set if you use regions restrictions.

         All the classical mathematical functions are available (cos,
         sin, but also lgamma, j1, erf, ...). As usual all
         trigonometric functions use radians by default but you can
         specify a unit if you prefer to say cos (x rad) or sin (3 * y
         deg). For the full list of available numerical functions and
         operators, see
         <ref name="Operators and functions" id="operators-and-functions">.

         In the formula, you can use X, Y, Y1, ..., Y4 to denote any
         coordinate you like from the source set. An implicit loop
         will be used around your formula so if you say:

         <tscreen><verb>
         x = x - 4966.5
         </verb></tscreen>

         you will shift all points of your set 4966.5 units to the left.

         You can use more than one set in the same formula, like this:

         <tscreen><verb>
         y = y - 0.653 * sin (x deg) + s2.y
         </verb></tscreen>

         which means you use both X and Y from the source set but also
         the Y coordinate of set 2. Beware that the loop is a simple
         loop over the indices, all the sets you use in such an hybrid
         expression should therefore have the same number of points
         and point i of one set should really be related to point i of
         the other set. If your sets do not follow these requirements,
         you should first homogenize them using
         <ref name="interpolation" id="interpolation">.
         </p>
         </sect3>

         <sect3><heading> Histograms <label id="histograms"></heading>
         <p>
         The histograms popup allows you to compute either standard
         or cumulative histograms from the Y coordinates of
         your data. Optionally, the histograms can be normalized to 1 (hence
         producing a PDF (Probability Distribution Function).

         The bins can be either a linear mesh defined by its min, max, and
         length values, or a mesh formed by abscissas of another set (in which
         case abscissas of the set must form a strictly monotonic array).
         </p>
         </sect3>

         <sect3><heading> Fourier transforms <label id="fourier-transforms"></heading>
         <p>
         This popup is devoted to direct and inverse Fourier
         transforms. The default is to perform a direct transform on
         unfiltered data and to produce a set with the index as
         abscissa and magnitude as ordinate. You can filter the input
         data window through triangular, Hanning, Welch, Hamming,
         Blackman and Parzen filters. You can load magnitude, phase or
         coefficients and use either index, frequency or period as
         abscissas. You can choose between direct and inverse Fourier
         transforms. If you specify real input data, X is assumed to
         be equally spaced and ignored; if you specify complex input
         data X is taken as the real part and Y as the imaginary part.

         If Grace was configured with the FFTW library (see <ref
         name="configuration" id="configuration">), then you may want to
         use FFTW <it>wisdom</it> files. Then, you should set several <ref
         name="environment variables" id="environment-variables"> to
         name them.
         </p>
         </sect3>

         <sect3><heading> Running properties <label id="running-properties"></heading>
         <p>
         The running properties popup allows you to compute some values
         on a sliding window over your data. You choose both the value
         you need (average, median, minimum, maximum, standard
         deviation) and the length of the window and perform the
         operation.
         </p>
         </sect3>

         <sect3><heading> Differences/derivatives <label id="differences"></heading>
         <p>
         The differences popup is used to compute approximations of
         the first derivative of a function with finite
         differences.
         a period to data of the preceding period (namely y[i] - y[i +
         period]). Beware that the period is entered in terms of index
         in the set and not in terms of abscissa!
         </p>
         </sect3>

         <sect3><heading> Integration <label id="integration"></heading>
         <p>
         The integration popup is used to compute the integral of a
         set and optionally to load it. The numerical value of the
         integral is shown in the text field after
         computation. Selecting "cumulative sum" in the choice item
         will create and load a new set with the integral and compute
         the end value, selecting "sum only" will only compute the end
         value.
         </p>
         </sect3>

         <sect3><heading> Interpolation/Splines <label id="interpolation"></heading>
         <p>
         This popup is used to interpolate a set on an array of alternative X
         coordinates. This is mainly used before performing some complex
         operations between two sets with the <ref name="evaluate
         expression" id="evaluate-expression"> popup.
         
         The sampling array can be either a linear mesh defined by its min,
         max, and length values, or a mesh formed by abscissas of another set. 
         
         Several interpolation methods can be used: linear, spline or Akima
         spline.
         
         Note that if the sampling mesh is not entirely within the source set
         X bounds, evaluation at the points beyond the bounds will be performed
         using interpolation parameters from the first (or the last) segment
         of the source set, which can be considered a primitive extrapolation.
         This behaviour can be disabled by checking the "Strict" option on the
         popup.
         
         The abscissas of the set being interpolated must form a strictly
         monotonic array.
         </p>
         </sect3>

         <sect3><heading> Non-linear fit <label id="non-linear-fit"></heading>
         <p>
         The non linear fit popup can be used for functions outside of
         the simple regression methods scope. With this popup you
         provide the expression yourself using a0, a1, ..., a9 to
         denote the fit parameters (as an example you can say y = a0 * cos
         (a1 * x + a2)). You specify a tolerance, starting values and
         optional bounds and run several steps before loading the
         results.

         The fit characteristics (number of parameters, formula, ...)
         can be saved in a file and retrieved as needed using the file
         menu of the popup.

         In the "Advanced" tab, you can additionally apply a restriction to
         the set(s) to be fitted (thus ignoring points not satisfying the
         criteria), use one of preset weighting schemes or define your own
         (notice that "dY" in the preset "1/dY^2" one actually refers to the
         third column of the data set; use the "Custom" function if this
         doesn't make sense for your data set), and choose whether to load
         the fitted values, the residuals or the function itself. Choosing
         to load fitted values or residuals leads to a set of the same
         length and abscissas as the initial set. Choosing to load the
         function is almost similar to load the fitted values except that
         you choose yourself the boundaries and the number of points. This
         can be used for example to draw the curve outside of the data
         sample range or to produce an evenly spaced set from an irregular
         one.
         </p>
         </sect3>

         <sect3><heading> Correlation/covariance <label id="correlation/covariance"></heading>
         <p>
         This popup can be used to compute autocorrelation
         of one set or cross correlation between two sets. You only
         select the set (or sets) and specify the maximum lag. A check
         box allows one to evaluate covariance instead of correlation.
         The result is normalized so that abs(C(0)) = 1.
         </p>
         </sect3>

         <sect3><heading> Linear convolution <label id="linear-convolution"></heading>
         <p>
         The convolution popup is used to ... convolve two sets. You
         only select the sets and apply.
         </p>
         </sect3>

         <sect3><heading> Sample points <label id="sample-points"></heading>
         <p>
         This popup provides a way to sample a set by
         selecting only the points that satisfy a boolean expression you
         specify.
         </p>
         </sect3>

         <sect3><heading> Prune data <label id="prune-data"></heading>
         <p>
         This popup is devoted to reducing huge sets (and then saving
         both computation time and disk space).

         The interpolation method can be applied only to ordered sets:
         it is based on the assumption that if a real point and an
         interpolation based on neighboring points are closer than a
         specified threshold, then the point is redundant and can be
         eliminated.

         The geometric methods (circle, ellipse, rectangle) can be
         applied to any set, they test each point in turn and keep
         only those that are not in the neighborhood of previous
         points.
         </p>
         </sect3>
      </sect2>

      <sect2><heading> Feature extraction <label id="feature-extraction"></heading>
      <p>
      Given a set of curves in a graph, extract a feature from each
      curve and use the values of the feature to provide the Y values
      for a new curve.
      </p>
      </sect2>

      <sect2><heading> Import menu <label id="read-menu"></heading>
         <sect3><heading> ASCII <label id="read-sets"></heading>
         <p>
         Read new sets of data in a graph. A <ref id="graph-selector"
         name="graph selector"> is used to specify the graph where the
         data should go (except when reading block data, which are
         copied to graphs later on).

         Reading as "Single set" means that if the source contains
         only one column of numeric data, one set will be created
         using the indices (from 1 to the total number of points) as
         abscissas and read values as ordinates and that if the source
         contains more than one column of data, the first two numeric
         columns will be used. Reading as "NXY" means that the first
         numeric column will provide the abscissas and all remaining
         columns will provide the ordinates of several sets. Reading
         as "Block data" means all column will be read and stored and
         that another popup will allow to select the abscissas and
         ordinates at will. It should be noted that block data are
         stored as long as you do not override them by a new read. You
         can still retrieve data from a block long after having closed
         all popups, using the <ref id="set-selector" name="set
         selector">.

         The set type can be one of the predefined set presentation types
         (see <ref id="sets" name="sets">).

         The data source can be selected as "Disk" or "Pipe". In the
         first case the text in the "Selection" field is considered to
         be a file name (it can be automatically set by the file
         selector at the top of the popup). In the latter case the
         text is considered to be a command which is executed and
         should produce the data on its standard output. On systems
         that allows is, the command can be a complete sequence of
         programs glued together with pipes.

         If the source contains date fields, they should be
         automatically detected. Several formats are recognized (see
         appendix <ref id="dates" name="dates in grace">). Calendar
         dates are converted to numerical dates upon reading.
         
         The "Autoscale on read" menu controls whether, upon reading in new
         sets, which axes of the graph should be autoscaled.
         </p>
         </sect3>

         <sect3><heading> NetCDF <label id="read-netCDF"></heading>
         <p>
         This entry exists only if Grace has been compiled with
         support for the NetCDF data format (see <ref
         id="configuration" name="configuration">).
         </p>
         </sect3>
      </sect2>

      <sect2><heading> Export menu <label id="write-menu"></heading>
         <sect3><heading> ASCII <label id="write-sets"></heading>
         <p>
         Save data sets in a file. A <ref id="set-selector" name="set
         selector"> is used to specify the set to be saved. The format
         to use for saving data points can be specified (the default
         value is "%16.8g"). A warning is displayed if a file with the
         same name already exists.
         </p>
         </sect3>
      </sect2>
   </sect1>


   <sect1><heading>View menu<label id="view-menu"></heading>
      <sect2><heading>Show/hide<label id="show-hide"></heading>
        <sect3><heading>Locator bar<label id="show-locator-bar"></heading>
          <p>
            This toggle item shows or hides the locator below the menu bar.
          </p>
        </sect3>

        <sect3><heading>Status bar<label id="show-status-bar"></heading>
          <p>
           This toggle item shows or hides the status string below the
           canvas.
          </p>
        </sect3>

        <sect3><heading>Tool bar<label id="show-tool-bar"></heading>
          <p>
            This toggle item shows or hides the tool bar at the left of the
            canvas.
          </p>
        </sect3>
      </sect2>

      <sect2><heading>Page zoom<label id="page-zoom"></heading>
        <sect3><heading>Smaller</heading>
          <p>
            Zoom out page.
          </p>
        </sect3>

        <sect3><heading>Larger</heading>
          <p>
            Zoom in page.
          </p>
        </sect3>

        <sect3><heading>Original size</heading>
          <p>
            Reset page zoom.
          </p>
        </sect3>
      </sect2>


      <sect2><heading>Page rendering<label id="page-rendering"></heading>
        <p>
          Set the rendering properties of the display device (font
          anti-aliasing and color transformations).
        </p>
      </sect2>
      
      <sect2><heading>Redraw<label id="redraw"></heading>
        <p>
          This menu item triggers a redrawing of the canvas.
        </p>
      </sect2>

      <sect2><heading>Update all<label id="update-all"></heading>
        <p>
          This menu item causes an update of all GUI controls. Usually,
          everything is updated automatically, unless one makes modifications
          by entering commands in the <ref name="Console" id="console"> tool.
        </p>
      </sect2>
   </sect1>

   <sect1><heading>Tools menu<label id="tools-menu"></heading>

      <sect2><heading>Font tool<label id="font-tool"></heading>
        <p>
          Not written yet...
        </p>
      </sect2>
      
      <sect2><heading>Console<label id="console"></heading>
        <p>
          The console window displays errors and results of some numerical
          operations, e.g. nonlinear fit (see <ref id="non-linear-fit"
          name="Non-linear fit">). The window is popped up automatically
          whenever an error occurs or new result messages appear. This can
          be altered by checking the "Options/Popup only on errors" option.
        </p>
        <p>
          The dialog also provides an interface to the command driven version
          of Grace. Here, commands
          can be typed in the "Command:" text item and executed when
          &lt;Return&gt; is pressed. The command will be parsed and executed,
          and the command line is placed in the history list. Items in the
          history list can be recalled by using the keyboard arrow buttons.
          Depending on the state of the "Options/Auto redraw" and
          "Options/Auto update" checkboxes, each command entered will cause
          an immediate resync of the canvas and/or the GUI, respectively.
          For a reference on the Grace command interpreter,
          see <ref id="command-interpreter" name="Command interpreter">.
        </p>
      </sect2>

      <sect2><heading>Dataset statistics<label id="dataset-statistics"></heading>
        <p>
          Using the dataset statistics popup, you can view statistical
          properties of datasets (min, max, mean, standard deviation). A
          horizontal scrollbar at the bottom allows to get the two last
          properties, they are not displayed by default. Also note that if you
          find some columns are too narrow to show all significant digits, you
          can drag the vertical rules using Shift+Button 2.
        </p>
      </sect2>
   </sect1>


   <sect1><heading>Help menu<label id="help-menu"></heading>
      <sect2><heading>On context<label id="on-context"></heading>
      <p>
        Click on any element of the interface to get context-sensitive help
        on it. Only partially implemented at the moment.
      </p>
      </sect2>
      <sect2><heading>User's guide<label id="users-guide"></heading>
      <p>
        Browse the Grace user's guide.
      </p>      
      </sect2>
      <sect2><heading>FAQ<label id="faq"></heading>
      <p>
        Frequently Asked Questions with answers.
      </p>      
      </sect2>
      <sect2><heading>Changes<label id="changes"></heading>
      <p>
        The list of changes during the Grace development.
      </p> 
      </sect2>
      <sect2><heading> Examples <label id="examples"></heading>
      <p>
        The whole tree of submenus each loading a sample plot.
      </p>      
      </sect2>
      <sect2><heading> Web support</heading>
        <sect3><heading> Home page</heading>
        <p>
          Open the official Grace home page.
        </p>        
        </sect3>
        <sect3><heading> Forums</heading>
        <p>
          Go to Grace forums, where you can participate in discussions.
        </p>        
        </sect3>
        <sect3><heading> Report an issue</heading>
        <p>
          Use this to send your suggestions or bug reports.
        </p>        
        </sect3>
      </sect2>
      <sect2><heading> License terms <label id="license-terms"></heading>
      <p>
        Grace licensing terms will be displayed (GPL version 2).
      </p>      
      </sect2>
      <sect2><heading> About <label id="about"></heading>
      <p>
        A popup with basic info on the software, including some
        configuration details. More details can be found when running Grace
        with the "-version" command line flag.
      </p>
      </sect2>
   </sect1>
</sect>

<!-- **************************************** -->
<sect><heading>Command interpreter <label id="command-interpreter"></heading>

  <sect1><heading>General notes</heading>
    <p>
      The interpreter parses its input in a line-by-line manner. There may
      be several statements per line, separated by semicolon (<tt>;</tt>).
      The maximal line length is 4 kbytes (hardcoded). The parser is
      case-insensitive and ignores lines beginning with the "<tt>#</tt>" sign.
    </p>
   </sect1>

  <sect1><heading>Definitions</heading>

    <p>
      <table loc="htbp">
      <tabular ca="lll">
        <hline>
        Name | Description | Examples @
        <hline>
        expr |
          Any numeric expression |
          1.5 + sin(2) @
        iexpr |
          Any expression that evaluates to an integer |
          25, 0.1 + 1.9, PI/asin(1) @
        nexpr |
          Non-negative iexpr |
          2 - 1 @
        indx |
          Non-negative iexpr |
          &nbsp; @
        qstr |
          Quoted string |
          "a string" @
        <hline>
      </tabular>
      <caption>
        <label id="types">
        Basic types
      </caption>
      </table>
    </p>

    <p>
      <table loc="htbp">
      <tabular ca="llll">
        <hline>
        Expression | Description | Types | Example @
        <hline>
        X |
          the first column |
          - |
          X @
        Y |
          the second column |
          - |
          Y @
        Y<it>n</it> |
          (<it>n</it> + 2)-th column |
          <it>n</it> = 0 - 4 |
          Y3 @
        <hline>
      </tabular>
      <caption>
        <label id="datacol-sel">
        Data column selections
      </caption>
      </table>
    </p>

    <p>
      Not finished yet...
    </p>
  </sect1>

  <sect1><heading>Variables</heading>
    <p>

      <table loc="htbp">
      <tabular ca="ll">
        <hline>
        Variable        | Description      @
        <hline>
        datacolumn      | data column of current set @
        set.datacolumn  | data column of set @
        <hline>
        vvar            | user-defined array @
        <hline>
      </tabular>
      <caption>
        <label id="vvariables">
        Vector variables
      </caption>
      </table>
    </p>

    <p>
      <table loc="htbp">
      <tabular ca="ll">
        <hline>
        Variable               | Description      @
        <hline>
        vvariable&lsqb;i&rsqb; | i-th element of a vector variable @
        <hline>
        var                    | user-defined variable @
        <hline>
      </tabular>
      <caption>
        <label id="svariables">
        Scalar variables
      </caption>
      </table>
    </p>
  </sect1>


  <sect1><heading>Numerical operators and functions<label id="operators-and-functions"></heading>
    <p>
      In numerical expressions, the infix format is used. Arguments of
      both operators and functions can be either scalars or vector arrays.
    </p>
      
    <p>

      <table loc="htbp">
      <tabular ca="cl">
        <hline>
        Operator | Description      @
        <hline>
        +        | addition         @
	-        | substraction     @
	*        | multiplication   @
	/        | division         @
	%        | modulus          @
	^        | raising to power @
        <hline>
      </tabular>
      <caption>
        <label id="arithmetic-operators">
        Arithmetic operators
      </caption>
      </table>
      
    </p>
      
    <p>
      
      <table loc="htbp">
      <tabular ca="cl">
        <hline>
        Operator               | Description @
        <hline>
        AND or &amp;&amp;      | logical AND @
	OR or &verbar;&verbar; | logical OR  @
	NOT or !               | logical NOT @
        <hline>
      </tabular>
      <caption>
        <label id="logical-operators">
        Logical operators
      </caption>
      </table>
      
    </p>
      
    <p>

      <table loc="htbp">
      <tabular ca="cl">
        <hline>
        Operator    | Description           @
        <hline>
	EQ or ==    | equal                 @
	NE or !=    | not equal             @
	LT or &lt;  | less than             @
	LE or &lt;= | less than or equal    @
	GT or &gt;  | greater than          @
	GE or &gt;= | greater than or equal @
        <hline>
      </tabular>
      <caption>
        <label id="comparison-operators">
        Comparison operators
      </caption>
      </table>
      
    </p>
      
    <p>

      <table loc="htbp">
      <tabular ca="ll">
        <hline>
        Function        | Description      @
        <hline>
	abs(x)          | absolute value @
	acos(x)         | arccosine @
	acosh(x)        | hyperbolic arccosine @
	asin(x)         | arcsine @
	asinh(x)        | hyperbolic arcsine @
	atan(x)         | arctangent @
	atan2(y,x)      | arc tangent of two variables @
	atanh(x)        | hyperbolic arctangent @
	ceil(x)         | greatest integer function @
	cos(x)          | cosine @
	cosh(x)         | hyperbolic cosine @
	exp(x)          | e^x @
	fac(n)          | factorial function, n! @
	floor(x)        | least integer function @
	irand(n)        | random integer less than n @
	ln(x)           | natural log  @
	log10(x)        | log base 10 @
	log2(x)         | base 2 logarithm of x @
	maxof(x,y)      | returns greater of x and y @
	mesh(n)         | mesh array (0 ... n - 1) @
	mesh(x1, x2, n) | mesh array of n equally spaced points between x1 and x2 inclusive @
	minof(x,y)      | returns lesser of x and y @
	mod(x,y)        | mod function (also x % y) @
	pi              | the PI constant @
	rand            | pseudo random number distributed uniformly on (0.0,1.0) @
	rand(n)         | array of n random numbers @
	rint(x)         | round to closest integer @
	sin(x)          | sine function @
	sinh(x)         | hyperbolic sine @
	sqr(x)          | x^2 @
	sqrt(x)         | x^0.5 @
	tan(x)          | tangent function @
	tanh(x)         | hyperbolic tangent @
        <hline>
      </tabular>
      <caption>
        <label id="functions">
        Functions
      </caption>
      </table>
    </p>
      
    <p>

      <table loc="htbp">
      <tabular ca="ll">
        <hline>
        Function        | Description      @
        <hline>
	chdtr(df, x)    | chi-square distribution @
	chdtrc(v, x)    | complemented Chi-square distribution @
	chdtri(df, y)   | inverse of complemented Chi-square distribution @
	erf(x)          | error function @
	erfc(x)         | complement of error function @
	fdtr(df1, df2, x) | F distribution function @
	fdtrc(x)        | complemented F distribution @
	fdtri(x)        | inverse of complemented F distribution @
	gdtr(a, b, x)   | gamma distribution function @
	gdtrc(a, b, x)  | complemented gamma distribution function @
	ndtr(x)         | Normal distribution function @
	ndtri(x)        | inverse of Normal distribution function @
	norm(x)         | gaussian density function @
	pdtr(k, m)      | Poisson distribution @
	pdtrc(k, m)     | complemented Poisson distribution @
	pdtri(k, y)     | inverse Poisson distribution @
	rnorm(xbar,s)   | pseudo random number distributed N(xbar,s) @
	stdtr(k, t)     | Student's t distribution @
	stdtri(k, p)    | functional inverse of Student's t distribution @
        <hline>
      </tabular>
      <caption>
        <label id="stat-functions">
        Statistical functions
      </caption>
      </table>

    </p>
      
    <p>

      <table loc="htbp">
      <tabular ca="ll">
        <hline>
        Function        | Description      @
        <hline>
	ai(x), bi(x)    | Airy functions (two independent solutions of the differential equation <tt>y''(x) = xy</tt>) @
	beta(x)         | beta function @
	chi(x)          | hyperbolic cosine integral @
	ci(x)           | cosine integral @
	dawsn(x)        | Dawson's integral @
	ellie(phi, m)   | incomplete elliptic integral of the second kind @
	ellik(phi, m)   | incomplete elliptic integral of the first kind @
	ellpe(m)        | complete elliptic integral of the second kind @
	ellpk(m)        | complete elliptic integral of the first kind @
	expn(n, x)      | exponential integral @
	fresnlc(x)      | cosine Fresnel integral @
	fresnls(x)      | sine Fresnel integral @
	gamma(x)        | gamma function @
	hyp2f1(a, b, c, x) | Gauss hyper-geometric function @
	hyperg(a, b, x) | confluent hyper-geometric function @
	i0e(x)          | modified Bessel function of order zero, exponentially  scaled @
	i1e(x)          | modified Bessel function of order one, exponentially   scaled @
	igam(a, x)      | incomplete gamma integral @
	igamc(a, x)     | complemented incomplete gamma integral @
	igami(a, p)     | inverse of complemented incomplete gamma integral @
	incbet(a, b, x) | incomplete beta integral @
	incbi(a, b, y)  | Inverse of incomplete beta integral @
	iv(v, x)        | modified Bessel function of order v @
	jv(v, x)        | Bessel function of order v @
	k0e(x)          | modified Bessel function, third kind, order zero, exponentially scaled @
	k1e(x)          | modified Bessel function, third kind, order one, exponentially scaled @
	kn(n, x)        | modified Bessel function, third kind, integer order @
	lbeta(x)        | natural log of &verbar;beta(x)&verbar; @
	lgamma(x)       | log of gamma function @
	psi(x)          | psi (digamma) function @
	rgamma(x)       | reciprocal gamma function @
	shi(x)          | hyperbolic sine integral @
	si(x)           | sine integral @
	spence(x)       | dilogarithm @
	struve(v, x)    | Struve function @
	yv(v, x)        | Bessel function of order v @
	zeta(x, q)      | Riemann zeta function of two arguments @
	zetac(x)        | Riemann zeta function   @
        <hline>
      </tabular>
      <caption>
        <label id="spec-functions">
        Special math functions
      </caption>
      </table>
    </p>
      
  </sect1>
</sect>

<!-- **************************************** -->
<sect><heading>Advanced topics</heading>

  <sect1><heading>Fonts<label id="fonts"></heading>
    <p>
    For all devices, Grace uses Type1 fonts. Both PFA (ASCII) and PFB
    (binary) formats can be used.
    </p>
    <sect2><heading>Font configuration</heading>
      <p>
      The file responsible for the font configurations of Grace is
      <tt>fonts/FontDataBase</tt>. The first line contains a positive integer
      specifying the number of fonts declared in that file. All remaining lines
      contain declarations of one font each, composed out of three fields:
      <enum>
        <item> Font name. The name will appear in the font selector controls.
               Also, backend devices that has built-in fonts, will be given the
               name as a font identifier.
        </item>
        <item> Font fall-back. Grace will try to use this in case the real
               font is not found.
        </item>
        <item> Font filename. The file with the font outline data.
        </item>
      </enum>
      </p>
      
      <p>
      Here is the default <tt>FontDataBase</tt> file:
      <tscreen><code>
14
Times-Roman             Times-Roman             n021003l.pfb
Times-Italic            Times-Italic            n021023l.pfb
Times-Bold              Times-Bold              n021004l.pfb
Times-BoldItalic        Times-BoldItalic        n021024l.pfb
Helvetica               Helvetica               n019003l.pfb
Helvetica-Oblique       Helvetica-Oblique       n019023l.pfb
Helvetica-Bold          Helvetica-Bold          n019004l.pfb
Helvetica-BoldOblique   Helvetica-BoldOblique   n019024l.pfb
Courier                 Courier                 n022003l.pfb
Courier-Oblique         Courier-Oblique         n022023l.pfb
Courier-Bold            Courier-Bold            n022004l.pfb
Courier-BoldOblique     Courier-BoldOblique     n022024l.pfb
Symbol                  Symbol                  s050000l.pfb
ZapfDingbats            ZapfDingbats            d050000l.pfb
      </code></tscreen>
    </p>
    </sect2>

    <sect2><heading>Font data files</heading>
    <p>
      For text rastering, three types of files are used.
      <enum>
        <item> <tt>.pfa</tt>-/<tt>.pfb</tt>-files: These contain the character
               outline descriptions. The files are assumed to be in the
               <tt>fonts/type1</tt> directory; these are the filenames
               specified in the <tt>FontDataBase</tt> configuration file.
        </item>
        <item> <tt>.afm</tt>-files: These contain high-precision font metric
               descriptions as well as some extra information, such as kerning
               and ligature information for a particular font. It is assumed
               that the filename of a font metric file has same basename as the
               respective font outline file, but with the <tt>.afm</tt>
               extension; the metric files are expected to be found in the
               <tt>fonts/type1</tt> directory, too.
        </item>
        <item> <tt>.enc</tt>-files: These contain encoding arrays in a special
               but simple form. They are only needed if someone wants to load
               a special encoding to re-encode a font. Their place is
               <tt>fonts/enc</tt>
        </item>
      </enum>
    </p>
    </sect2>
      
    <sect2><heading>Custom fonts</heading>
      <p>
      It is possible to use custom fonts with Grace. One mostly needs to use
      extra fonts for the purpose of localization. For many European
      languages, the standard fonts supplied with Grace should contain all the
      characters needed, but encoding may have to be adjusted. This is done by
      putting a <tt>Default.enc</tt> file with proper encoding scheme into the
      <tt>fonts/enc</tt> directory. Grace comes with a few encoding files in
      the directory; more can be easily found on the Internet. (If the
      <tt>Default.enc</tt> file doesn't exist, the IsoLatin1 encoding will be
      used). Notice that for fonts having an encoding scheme in themselves
      (such as the Symbol font, and many nationalized fonts) the default
      encoding is ignored.
      </p>
      <p>
      If you do need to use extra fonts, you should modify the
      <tt>FontDataBase</tt> file accordingly, obeying its format. However,
      if you are going to exchange Grace project files with other people who
      do not have the extra fonts configured, an important thing is to define
      reasonable fall-back font names.
      </p>
      <p>
      For example, let us assume I use Hebrew fonts, and the configuration file
      has lines like these:
      <tscreen><code>
    ...
Courier-Hebrew              Courier                 courh___.pfa
Courier-Hebrew-Oblique      Courier-Oblique         courho__.pfa
    ...
      </code></tscreen>
      My colleague, who lives in Russia, uses Cyrillic fonts with Grace
      configured like this:
      <tscreen><code>
    ...
Cronix-Courier              Courier                 croxc.pfb
Cronix-Courier-Oblique      Courier-Oblique         croxco.pfb
    ...
      </code></tscreen>
      The font mapping information (Font name &lt;-&gt; Font fall-back) is
      stored in the Grace project files. Provided that all the localized fonts
      have English characters in the lower part of the ASCII table unmodified,
      I can send my friend files (with no Hebrew characters, of course) and be
      sure they render correctly on his computer.
      </p>
      <p>
      Thus, with properly configured national fonts, you can make localized
      annotations for plots intended for internal use of your institution,
      while being able to exchange files with colleagues from abroad. People
      who ever tried to do this with MS Office applications should appreciate
      the flexibility :-).
      </p>
    </sect2>
  </sect1>

  <sect1><heading>Interaction with other applications</heading>

    <sect2><heading>Using pipes</heading>
    </sect2>
  </sect1>

  <sect1><heading>FFTW tuning<label id="fftw-tuning"></heading>
    <p>
     When the FFTW capabilities are compiled in, Grace looks at two environment
     variables to decide what to do with the FFTW 'wisdom' capabilities. 
     First, a quick summary of what this is. The FFTW package is capable of
     adaptively determining the most efficient factorization of a set to give
     the fastest computation.  It can store these factorizations as 'wisdom',
     so that if a transform of a given size is to be repeated, it is does not
     have to re-adapt.  The good news is that this seems to work very well. 
     The bad news is that, the first time a transform of a given size is
     computed, if it is not a sub-multiple of one already known, it takes a LONG
     time (seconds to minutes).
    </p>
    <p>
     The first environment variable is GRACE_FFTW_WISDOM_FILE. If this is set
     to the name of a file which can be read and written (e.g.,
     $HOME/.grace_fftw_wisdom) then Grace will automatically create this file
     (if needed) and maintain it. If the file is read-only, it will be read,
     but not updated with new wisdom. If the symbol GRACE_FFTW_WISDOM_FILE
     either doesn't exist, or evaluates to an empty string, Grace will drop the
     use of wisdom, and will use the fftw estimator (FFTW_ESTIMATE flag sent to
     the planner) to guess a good factorization, instead of adaptively
     determining it.
    </p>
    <p>
     The second variable is GRACE_FFTW_RAM_WISDOM. If this variable is defined
     to be non-zero, and GRACE_FFTW_WISDOM_FILE variable is not defined (or is
     an empty string), Grace will use wisdom internally, but maintain no
     persistent cache of it. This will result in very slow execution times the
     first time a transform is executed after Grace is started, but very fast
     repeats. I am not sure why anyone would want to use wisdom without
     writing it to disk, but if you do, you can use this flag to enable it.
    </p>
  </sect1>

  <sect1><heading>DL modules <label id="dl-modules"></heading>
    <p>
    Grace can access external functions present
    in either system or third-party shared libraries or modules
    specially compiled for use with Grace.
    </p>

    <sect2><heading>Function types</heading>
    <p>
    One must make sure, however, that the external function is of one
    of supported by Grace types:
      <table loc="htbp">
      <tabular ca="ll">
              <hline>
      Grace type | Description   @
              <hline>
f&lowbar;of&lowbar;i    | a function of 1 <tt>int</tt> variable                                 @
f&lowbar;of&lowbar;d    | a function of 1 <tt>double</tt> variable                              @
f&lowbar;of&lowbar;nn   | a function of 2 <tt>int</tt> parameters                               @
f&lowbar;of&lowbar;nd   | a function of 1 <tt>int</tt> parameter and 1 <tt>double</tt> variable     @
f&lowbar;of&lowbar;dd   | a function of 2 <tt>double</tt> variables                             @
f&lowbar;of&lowbar;nnd  | a function of 2 <tt>int</tt> parameters and 1 <tt>double</tt> variable    @
f&lowbar;of&lowbar;ppd  | a function of 2 <tt>double</tt> parameters and 1 <tt>double</tt> variable @
f&lowbar;of&lowbar;pppd | a function of 3 <tt>double</tt> parameters and 1 <tt>double</tt> variable @
              <hline>
      </tabular>
      <caption>
              <label id="grace-types">
              Grace types for external functions
      </caption>
      </table>

      The return values of functions are assumed to be of the
      <tt>double</tt> type.

       Note, that there is no difference from the point of view of
       function prototype between parameters and variables; the
       difference is in the way Grace treats them - an attempt to use
       a vector expression as a parameter argument will result in a
       parse error.

       Let us consider few examples.
       </p>
       </sect2>

       <sect2><heading>Examples</heading>
       <p>
       Caution: the examples provided below (paths and compiler flags)
       are valid for Linux/ELF with gcc. On other operating systems,
       you may need to refer to compiler/linker manuals or ask a guru.
       </p>

       <sect3><heading>Example 1</heading>
       <p>
       Suppose I want to use function <tt>pow(x,y)</tt> from the Un*x math
       library (libm). Of course, you can use the "^" operator defined
       in the Grace language, but here, for the sake of example, we
       want to access the function directly.

       The command to make it accessible by Grace is
       <tscreen>
       USE "pow" TYPE f_of_dd FROM "/usr/lib/libm.so"
       </tscreen>

       Try to plot y = pow(x,2) and y = x^2 graphs (using, for
       example, "create new -&gt; Formula" from any <ref name="set
       selector" id="set-selector">) and compare.
       </p>
       </sect3>

       <sect3><heading>Example 2</heading>
       <p>
       Now, let us try to write a function ourselves. We will define
       function <tt>my_function</tt> which simply returns its (second)
       argument multiplied by integer parameter transferred as the
       first argument.

       In a text editor, type in the following C code and save it as
       "my_func.c":

       <tscreen><code>
       double my_function (int n, double x)
       {
           double retval;
           retval = (double) n * x;
           return (retval);
       }
       </code></tscreen>

       OK, now compile it:

       <tscreen><code>
       $gcc -c -fPIC my_func.c
       $gcc -shared my_func.o -o /tmp/my_func.so
       </code></tscreen>

       (You may strip it to save some disk space):

       <tscreen><code>
       $strip /tmp/my_func.so
       </code></tscreen>

       That's all! Ready to make it visible to Grace as "myf" - we are
       too lazy to type the very long string "my_function" many times.

       <tscreen>
       USE "my_function" TYPE f_of_nd FROM "/tmp/my_func.so" ALIAS "myf"
       </tscreen>
       </p>
       </sect3>


       <sect3><heading>Example 3</heading>
       <p>
       A more serious example. There is a special third-party library
       available on your system which includes a very important for
       you yet very difficult-to-program from the scratch function
       that you want to use with Grace.  But, the function prototype
       is NOT one of any predefined <ref name="types"
       id="grace-types">.  The solution is to write a simple function
       wrapper. Here is how:

       Suppose, the name of the library is "special_lib" and the
       function you are interested in is called "special_func" and
       according to the library manual, should be accessed as <tt>void
       special_func(double *input, double *output, int parameter)</tt>.
       The wrapper would look like this:

       <tscreen><code>
       double my_wrapper(int n, double x)
       {
           extern void special_func(double *x, double *y, int n);
           double retval;
           (void) special_func(&amp;x, &amp;retval, n);
           return (retval);
       }
       </code></tscreen>

       Compile it:

       <tscreen><code>
       $gcc -c -fPIC my_wrap.c
       $gcc -shared my_wrap.o -o /tmp/my_wrap.so -lspecial_lib -lblas
       $strip /tmp/my_wrap.so
       </code></tscreen>

       Note that I added <tt/-lblas/ assuming that the special_lib
       library uses some functions from the BLAS. Generally, you have
       to add <it>all</it> libraries which your module depends on (and
       all libraries those libraries rely upon etc.), as if you wanted
       to compile a plain executable.

       Fine, make Grace aware of the new function

       <tscreen>
       USE "my_wrapper" TYPE f_of_nd FROM "/tmp/my_wrap.so" ALIAS "special_func"
       </tscreen>

       so we can use it with its original name.
       </p>
       </sect3>

       <sect3><heading>Example 4</heading>
       <p>
       An example of using Fortran modules.

       Here we will try to achieve the same functionality as in
       Example 2, but with the help of F77.

       <tscreen><code>
       DOUBLE PRECISION FUNCTION MYFUNC (N, X)
       IMPLICIT NONE
       INTEGER N
       DOUBLE PRECISION X
C
       MYFUNC = N * X
C
       RETURN
       END
       </code></tscreen>

       As opposite to C, there is no way to call such a function from
       Grace directly - the problem is that in Fortran all arguments
       to a function (or subroutine) are passed by reference. So, we
       need a wrapper:

       <tscreen><code>
       double myfunc_wrapper(int n, double x)
       {
           extern double myfunc_(int *, double *);
           double retval;
           retval = myfunc_(&amp;n, &amp;x);
           return (retval);
       }
       </code></tscreen>

       Note that most of f77 compilers by default add underscore to
       the function names and convert all names to the lower case,
       hence I refer to the Fortran function <tt/MYFUNC/ from my C
       wrapper as <tt/myfunc_/, but in your case it can be different!

       Let us compile the whole stuff:

       <tscreen><code>
       $g77 -c -fPIC myfunc.f
       $gcc -c -fPIC myfunc_wrap.c
       $gcc -shared myfunc.o myfunc_wrap.o -o /tmp/myfunc.so -lf2c -lm
       $strip /tmp/myfunc.so
       </code></tscreen>

       And finally, inform Grace about this new function:

       <tscreen>
       USE "myfunc_wrapper" TYPE f_of_nd FROM "/tmp/myfunc.so" ALIAS "myfunc"
       </tscreen>
       </p>
       </sect3>
       </sect2>

       <sect2><heading>Operating system issues</heading>
         <sect3><heading>OS/2</heading>
          <p>
         In general the method outlined in the examples above can be
	 used on OS/2, too. However you have to create a DLL (Dynamic Link Library)
	 which is a bit more tricky on OS/2 than on most Un*x systems.
         Since Grace was ported by using EMX we also use it to create
	 the examples; however other development environments should work
	 as well (ensure to use the _System calling convention!).
         We refer to Example 2 only. Example 1 might demonstrate
	 that DLLs can have their entry points (i.e. exported functions)
         callable via ordinals only, so you might not know how to access a
         specific function without some research.
         First compile the source from Example 2 to "my_func.obj"

         <tscreen>
         gcc -Zomf -Zmt -c my_func.c -o my_func.obj
         </tscreen>

         Then you need to create a linker definition file "my_func.def"
	 which contains some basic info about the DLL and declares
	 the exported functions.

         <tscreen><code>
         LIBRARY my_func INITINSTANCE TERMINSTANCE
         CODE LOADONCALL
         DATA LOADONCALL MULTIPLE NONSHARED
         DESCRIPTION 'This is a test DLL: my_func.dll'
         EXPORTS
         my_function
         </code></tscreen>

         (don't forget about the 8 characters limit on the DLL name!).
         Finally link the DLL:

         <tscreen>
         gcc my_func.obj my_func.def -o my_func.dll -Zdll -Zno-rte -Zmt -Zomf
         </tscreen>

         (check out the EMX documentation about the compiler/linker flags
	  used here!)
         To use this new library function within Grace you may either
	 put the DLL in the LIBPATH and use the short form:

         <tscreen>
         USE "my_function" TYPE f_of_nd FROM "my_func" ALIAS "myf"
         </tscreen>

         or put it in an arbitrary path which you need to specify explicitly
         then:

         <tscreen>
         USE "my_function" TYPE f_of_nd FROM "e:/foo/my_func.dll" ALIAS "myf"
         </tscreen>
	 
	 (as for most system-APIs you may use the Un*x-like forward
 	 slashs within the path!)
       </p>
       </sect3>
     </sect2>
  </sect1>
</sect>

<!-- ****** Appendices/references ************ -->
<sect><heading> References</heading>
  
  <sect1><heading>Typesetting<label id="typesetting"></heading>
    <p>
      Grace permits quite complex typesetting on a per string basis.
      Any string displayed (titles, legends, tick marks,...) may contain
      special control codes to display subscripts, change fonts within the
      string etc.
    </p>
    <p>

      <table loc="htbp">
      <tabular ca="ll">
              <hline>
              Control code | Description   @
              <hline>
              &bsol;f{x}   | switch to font named "x"   @
              &bsol;f{n}   | switch to font number n    @
              &bsol;f{}    | return to original font    @
              &bsol;R{x}   | switch to color named "x"  @
              &bsol;R{n}   | switch to color number n   @
              &bsol;R{}    | return to original color   @
              &bsol;#{x}   | treat "x" (must be of even length) as list of hexadecimal char codes @
              &bsol;t{xx xy yx yy} | apply transformation matrix   @
              &bsol;t{}    | reset transformation matrix   @
              &bsol;z{x}   | zoom x times   @
              &bsol;z{}    | return to original zoom   @
              &bsol;r{x}   | rotate by x degrees   @
              &bsol;l{x}   | slant by factor x   @
              &bsol;v{x}   | shift vertically by x   @
              &bsol;v{}    | return to unshifted baseline   @
              &bsol;V{x}   | shift baseline by x   @
              &bsol;V{}    | reset baseline   @
              &bsol;h{x}   | horizontal shift by x   @
              &bsol;n      | new line   @
              &bsol;u      | begin underline   @
              &bsol;U      | stop underline   @
              &bsol;o      | begin overline   @
              &bsol;O      | stop overline   @
              &bsol;Fk     | enable kerning   @
              &bsol;FK     | disable kerning   @
              &bsol;Fl     | enable ligatures   @
              &bsol;FL     | disable ligatures   @
              &bsol;m{n}   | mark current position as n   @
              &bsol;M{n}   | return to saved position n   @
              &bsol;dl     | LtoR substring direction   @
              &bsol;dr     | RtoL substring direction   @
              &bsol;dL     | LtoR text advancing   @
              &bsol;dR     | RtoL text advancing   @
              &bsol;${x}   | macro x   @
              <hline>
              &bsol;x      | switch to Symbol font (same as &bsol;f{Symbol})   @
              &bsol;+      | increase size (same as &bsol;z{1.19} ; 1.19 = sqrt(sqrt(2)))   @
              &bsol;-      | decrease size (same as &bsol;z{0.84} ; 0.84 = 1/sqrt(sqrt(2)))   @
              &bsol;s      | begin subscripting (same as &bsol;v{-0.4}&bsol;z{0.71})   @
              &bsol;S      | begin superscripting (same as &bsol;v{0.6}&bsol;z{0.71})   @
              &bsol;T{xx xy yx yy} | same as &bsol;t{}&bsol;t{xx xy yx yy}   @
              &bsol;Z{x}   | absolute zoom x times (same as &bsol;z{}&bsol;z{x})  @
              &bsol;q      | make font oblique (same as &bsol;l{0.25})   @
              &bsol;Q      | undo oblique (same as &bsol;l{-0.25})   @
              &bsol;N      | return to normal style (same as &bsol;v{}&bsol;t{})   @
              <hline>
              &bsol;&bsol; | print &bsol;   @
              <hline>
              &bsol;n      | switch to font number n (0-9) (deprecated) @
              &bsol;c      | begin using upper 128 characters of set (deprecated)  @
              &bsol;C      | stop using upper 128 characters of set (deprecated)  @
              <hline>
      </tabular>
      <caption>
              <label id="control-codes">
              Control codes.
      </caption>
      </table>
      </p>

      <p>
       Example:
      </p>
      <p>
       F&bsol;sX&bsol;N(&bsol;xe&bsol;f{}) =
       sin(&bsol;xe&bsol;f{})&bsol;#{b7}e&bsol;S-X&bsol;N&bsol;#{b7}cos(&bsol;xe&bsol;f{}) 
      </p>
      <p>
       prints roughly
       <tscreen><verb>
                       -x
       F (e) = sin(e)&middot;e  &middot;cos(e)
        x
       </verb></tscreen>
      </p>
      <p>
       using string's initial font and e prints as epsilon from the Symbol font.
      </p>
      <p>
       NOTE:
       Characters from the upper half of the char table can be entered directly
       from the keyboard, using appropriate <tt>xmodmap/xkb</tt> settings, or
       with the help of the font tool ("Tools/Font tool").
      </p>
  </sect1>

  <sect1><heading>Device-specific limitations<label id="device-limitations"></heading>
    <p>
      
      Grace can output plots using several device backends. The list of
      available devices can be seen (among other stuff) by specifying the
      "-version" command line switch.
      <itemize>
        <item> X11, PostScript, EPS and all raster drivers (PNM/JPEG/PNG)
               are full-featured devices
        </item>
        <item> PDF driver:
               <itemize>
                 <item> bitmapped text strings are not transparent </item>
                 <item> kerning is not implemented </item>
               </itemize>
        </item>
        <item> MIF driver:
               the driver is a brand new one and still in beta test
               <itemize>
                 <item> some of patterned fills not implemented </item>
                 <item> bitmapped text strings not implemented </item>
                 <item> kerning is not implemented </item>
               </itemize>
        </item>
        <item> SVG driver:
               the driver is a brand new one and still in beta test 
               <itemize>
                 <item> patterned fills not implemented </item>
                 <item> bitmapped text strings not implemented </item>
                 <item> kerning is not implemented </item>
               </itemize>
        </item>
      </itemize>
      
      </p>
  </sect1>

  <sect1><heading>Device-specific settings<label id="device-settings"></heading>
    <p>
      Some of the output devices accept several configuration options.
      A few options can be passed in one command, separated by commas.
    </p>

    <p>
      
      <table loc="htbp">
      <tabular ca="ll">
          <hline>
          Command              | Description                            @
          <hline>
          level1               | use only PS Level 1 subset of commands @
          level2               | use also PS Level 2 commands if needed @
          colorspace:grayscale | set grayscale colorspace               @
          colorspace:rgb       | set RGB colorspace                     @
          colorspace:cmyk      | set CMYK colorspace (PS Level2 only)   @
          docdata:7bit         | the document data is 7bit clean        @
          docdata:8bit         | the document data is 8bit clean        @
          docdata:binary       | the document data may be binary        @
          embedfonts:none      | don't embed fonts                      @
          embedfonts:but13     | embed all but the 13 standard fonts    @
          embedfonts:but35     | embed all but the 35 standard fonts    @
          embedfonts:all       | embed all fonts                        @
          xoffset:<it>x</it>   | set page offset in X direction <it>x</it> pp  @
          yoffset:<it>y</it>   | set page offset in Y direction <it>y</it> pp  @
          mediafeed:auto       | default input tray                     @
          mediafeed:match      | select input with media matching page dimensions @
          mediafeed:manual     | manual media feed                      @
          hwresolution:on      | set hardware resolution                @
          hwresolution:off     | do not set hardware resolution         @
          <hline>
      </tabular>
      <caption>
          PostScript driver options
      </caption>
      </table>
    </p>

    <p>
      
      <table loc="htbp">
      <tabular ca="ll">
          <hline>
          Command              | Description                            @
          <hline>
          level1               | use only PS Level 1 subset of commands @
          level2               | use also PS Level 2 commands if needed @
          colorspace:grayscale | set grayscale colorspace               @
          colorspace:rgb       | set RGB colorspace                     @
          colorspace:cmyk      | set CMYK colorspace (PS Level2 only)   @
          docdata:7bit         | the document data is 7bit clean        @
          docdata:8bit         | the document data is 8bit clean        @
          docdata:binary       | the document data may be binary        @
          embedfonts:none      | don't embed fonts                      @
          embedfonts:but13     | embed all but the 13 standard fonts    @
          embedfonts:but35     | embed all but the 35 standard fonts    @
          embedfonts:all       | embed all fonts                        @
          <hline>
      </tabular>
      <caption>
          EPS driver options
      </caption>
      </table>
    </p>

    <p>

      <table loc="htbp">
      <tabular ca="ll">
          <hline>
          Command               | Description                                  @
          <hline>
          compatibility:PDF-1.3 | set compatibility mode to PDF-1.3 (Acrobat4) @
          compatibility:PDF-1.4 | set compatibility mode to PDF-1.4 (Acrobat5) @
          compatibility:PDF-1.5 | set compatibility mode to PDF-1.5 (Acrobat6) @
          compression:value     | set compression level (0 - 9)                @
          fpprecision:value     | set floating point precision (4 - 6)         @
          <hline>
      </tabular>
      <caption>
          PDF driver options
      </caption>
      </table>
    </p>

    <p>

      <table loc="htbp">
      <tabular ca="ll">
          <hline>
          Command           | Description               @
          <hline>
          format:pbm        | output in PBM format      @
          format:pgm        | output in PGM format      @
          format:ppm        | output in PPM format      @          
          rawbits:on        | "rawbits" (binary) output @          
          rawbits:off       | ASCII output              @          
          <hline>
      </tabular>
      <caption>
          PNM driver options
      </caption>
      </table>
    </p>

    <p>

      <table loc="htbp">
      <tabular ca="ll">
          <hline>
          Command               | Description                           @
          <hline>
          grayscale             | set grayscale output                  @
          color                 | set color output                      @
          optimize:on/off       | enable/disable optimization           @
          quality:value         | set compression quality (0 - 100)     @
          smoothing:value       | set smoothing (0 - 100)               @
          baseline:on/off       | do/don't force baseline output        @
          progressive:on/off    | do/don't output in progressive format @
          dct:ifast             | use fast integer DCT method           @
          dct:islow             | use slow integer DCT method           @
          dct:float             | use floating-point DCT method         @
          <hline>
      </tabular>
      <caption>
          JPEG driver options
      </caption>
      </table>
    </p>

    <p>

      <table loc="htbp">
      <tabular ca="ll">
          <hline>
          Command           | Description                       @
          <hline>
          interlaced:on     | make interlaced image             @
          interlaced:off    | don't make interlaced image       @
          transparent:on    | produce transparent image         @
          transparent:off   | don't produce transparent image   @
          compression:value | set compression level (0 - 9)     @
          <hline>
      </tabular>
      <caption>
          PNG driver options
      </caption>
      </table>
    </p>
    </sect1>

    <sect1><heading>Dates in Grace <label id="dates"></heading>
    
    <p>
      We use two calendars in Grace: the one that was established in
      532 by Denys and lasted until 1582, and the one that was created
      by Luigi Lilio (Alyosius Lilius) and Christoph Klau
      (Christophorus Clavius) for pope Gregorius XIII. Both use the
      same months (they were introduced under emperor Augustus, a few
      years after Julian calendar introduction, both Julius and
      Augustus were honored by a month being named after each one).
      
      The leap years occurred regularly in Denys's calendar: once
      every four years, there is no year 0 in this calendar (the leap
      year -1 was just before year 1). This calendar was not compliant
      with earth motion and the dates were slowly shifting with regard
      to astronomical events.
      
      This was corrected in 1582 by introducing Gregorian
      calendar. First a ten days shift was introduced to reset correct
      dates (Thursday October the 4th was followed by Friday October
      the 15th). The rules for leap years were also changed: three
      leap years are removed every four centuries. These years are
      those that are multiple of 100 but not multiple of 400: 1700,
      1800, and 1900 were not leap years, but 1600 and 2000 were leap
      years.
      
      We still use Gregorian calendar today, but we now have several
      time scales for increased accuracy. The International Atomic
      Time (TAI) is a linear scale: the best scale to use for
      scientific reference. The Coordinated Universal Time (UTC, often
      confused with Greenwich Mean Time) is a legal time that is
      almost synchronized with earth motion. However, since the earth
      is slightly slowing down, leap seconds are introduced from time
      to time in UTC (about one second every 18 months). UTC is not a
      continuous scale ! When a leap second is introduced by
      International Earth Rotation Service, this is published in
      advance and the legal time sequence is as follows: 23:59:59
      followed one second later by 23:59:60 followed one second later
      by 00:00:00. At the time of this writing (1999-01-05) the
      difference between TAI and UTC was 32 seconds, and the last leap
      second was introduced in 1998-12-31.
      
      These calendars allow to represent any date from the mist of the
      past to the fog of the future, but they are not convenient for
      computation. Another time scale is possible: counting only the
      days from a reference. Such a time scale was introduced by
      Joseph-Juste Scaliger (Josephus Justus Scaliger) in 1583. He
      decided to use "-4713-01-01T12:00:00" as a reference date
      because it was at the same time a Monday, first of January of a
      leap year, there was an exact number of 19 years Meton cycle
      between this date and year 1 (for Easter computation), and it
      was at the beginning of a 15 years <it>Roman indiction</it>
      cycle. The day number counted from this reference is
      traditionally called <it>Julian day</it>, but it has really
      nothing to do with the Julian calendar.

      Grace stores dates internally as reals numbers counted from a
      reference date. The default reference date is the one chosen by
      Scaliger, it is a classical reference for astronomical
      events. It can modified for a single session using the <ref
      name="Edit-&gt;Preferences" id="preferences"> popup of the GUI. If
      you often work with a specific reference date you can set it for
      every sessions with a REFERENCE DATE command in your
      configuration file (see <ref name="Default template"
      id="default-template">).
      
      The following date formats are supported (hour, minutes and
      seconds are always optional):
      
      <enum>
      <item>iso8601  : 1999-12-31T23:59:59.999</item>
      <item>european : 31/12/1999 23:59:59.999 or 31/12/99 23:59:59.999</item>
      <item>us       : 12/31/1999 23:59:59.999 or 12/31/99 23:59:59.999</item>
      <item>Julian   : 123456.789</item>
      </enum>
      
      One should be aware that Grace does not allow to put a space in
      one data column as spaces are used to separate fields. You
      should always use another separator (:/.- or better T) between
      date and time in data files. The GUI, the batch language and the
      command line flags do not have this limitation, you can use
      spaces there without any problem. The T separator comes from the
      ISO8601 standard. Grace support its use also in european and us
      formats.

      You can also provide a hint about the format ("ISO8601",
      "european", "us") using the -datehint command line flag or the
      <ref name="Edit->Preferences" id="preferences"> popup of the GUI.
      The formats are tried in the following order: first the hint
      given by the user, then iso, european and us (there is no
      ambiguity between calendar formats and numerical formats and
      therefore no order is specified for them). The separators
      between various fields can be any characters in the set: " :/.-T"
      (one or more spaces act as one separator, other characters can
      not be repeated, the T separator is allowed only between date and time,
      mainly for iso8601), so the string "1999-12 31:23/59" is allowed
      (but not recommended).  The '-' character is used both as a
      separator (it is traditionally used in iso8601 format) and as
      the unary minus (for dates in the far past or for numerical
      dates). By default years are left untouched, so 99 is a date far
      away in the past. This behavior can be changed with the <ref
      name="Edit->preferences" id="preferences"> popup, or with the
      <tt>DATE WRAP on</tt> and <tt>DATE WRAP YEAR year</tt>
      commands. Suppose for example that the wrap year is chosen as
      1950, if the year is between 0 and 99 and is written with two or
      less digits, it is mapped to the present era as follows:

       range [00 ; 49] is mapped to [2000 ; 2049]

       range [50 ; 99] is mapped to [1950 ; 1999]

      with a wrap year set to 1970, the mapping would have been:

       range [00 ; 69] is mapped to [2000 ; 2069]

       range [70 ; 99] is mapped to [1970 ; 1999]

      this is reasonably Y2K compliant and is consistent with current
      use.  Specifying year 1 is still possible using more than two
      digits as follows: "0001-03-04" is unambiguously March the 4th,
      year 1. The inverse transform is applied for dates written by
      Grace, for example as tick labels. Using two digits only for
      years is not recommended, we introduce a <it>wrap year +
      100</it> bug here so this feature should be removed at some
      point in the future ...
      
      The date scanner can be used either for Denys's and Gregorian
      calendars. Inexistent dates are detected, they include year 0,
      dates between 1582-10-05 and 1582-10-14, February 29th of non
      leap years, months below 1 or above 12, ...  the scanner does
      not take into account leap seconds: you can think it works only
      in International Atomic Time (TAI) and not in Coordinated
      Unified Time (UTC). If you find yourself in a situation were you
      need UTC, a very precise scale, and should take into account
      leap seconds ... you should convert your data yourself (for
      example using International Atomic Time). But if you bother with
      that you probably already know what to do.
    </p>
    </sect1>

    <sect1><heading>Xmgr to Grace migration guide</heading>
    
    <p>
      
      This is a very brief guide describing problems and workarounds for
      reading in project files saved with Xmgr. You should read the docs or
      just play with Grace to test new features and controls.
 
      <enum>
      <item> Grace must be explicitly told the version number of the software
             used to create a file. You can manually put "@version VERSIONID"
             string at the beginning of the file. The VERSIONID is built as
             MAJOR_REV*10000 + MINOR_REV*100 + PATCHLEVEL; so 40101 corresponds
             to Xmgr-4.1.1. Projects saved with Xmgr-4.1.2 do NOT need the above,
             since they already have the version string in them. If you have no
             idea what version of Xmgr your file was created with, try some.
             In most cases, 40102 would do the trick.
      </item>

      <item> The above relates to the ASCII projects only. The old binary
             projects (saved with xmgr-4.0.*) are not automatically converted
             anymore. You can use the "grconvert" utility that comes with
             Grace to convert such files to Xmgr-4.1.2-style projects. 
      </item>
 
      <item> Grace is WYSIWYG. Xmgr was not. Many changes required to achieve the
             WYSIWYG'ness led to the situation when graphs with objects carefully
             aligned under Xmgr may not look so under Grace. Grace tries its best
             to compensate for the differences, but sometimes you may have to
             adjust such graphs manually.
      </item>
 
      <item> A lot of symbol types (all except *real* symbols) are removed.
             "Location *" types can be replaced (with much higher comfort) by
             A(nnotating)values. "Impulse *", "Histogram *" and "Stair steps *"
             effects can be achieved using the connecting line parameters (Type,
             Drop lines). "Dot" symbol is removed as well; use the filled circle
             symbol of the zero size with no outline to get the same effect.
      </item>
 
      <item> Default page layout switched from free (allowing to resize canvas
             with mouse) to fixed. For the old behavior, put "PAGE LAYOUT FREE"
             in the Grace resource file or use the "-free" command line switch.
             <bf>The use of the "free" page layout is in general deprecated,
             though.</bf>
      </item>
 
      <item> System (shell) variables GR_* renamed to GRACE_*
      </item>

      <item> Smith plots don't work now. They'll be put back soon.
      </item>
 
      </enum>
  </p>
  </sect1>
</sect>

</article>

</linuxdoc>
<!-- End of UsersGuide.sgml -->