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
|
%%
%% This is file `pstricks-add.tex',
%%
%% IMPORTANT NOTICE:
%%
%% Package `pstricks-add.tex'
%%
%% Herbert Voss <voss _at_ pstricks.de>
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%% `pstricks-add' is a PSTricks package for additionals to the standard
%% pstricks package
%%
\csname PSTricksAddLoaded\endcsname
\let\PSTricksAddLoaded\endinput
%
% Requires some packages
\ifx\PSTricksLoaded\endinput\else\input pstricks \fi
\ifx\PSTplotLoaded\endinput\else\input pst-plot \fi
\ifx\PSTnodesLoaded\endinput\else\input pst-node \fi
\ifx\MultidoLoaded\endinput\else\input multido \fi
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi
%
\def\fileversion{2.32}
\def\filedate{2005/01/16}
\message{`pstricks-add' v\fileversion, \filedate\space (hv)}
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
\SpecialCoor
\pst@addfams{pstricks-add}
%
%% prologue for postcript
\pstheader{pst-eqdf.pro}%
%
%
%-------------------------------- pstricks ------------------------------------
%
%%%%%%% \begin{pspicture} %%%%%%%%%%%%%%%%%%%
\newdimen\pst@dimm%
\newdimen\pst@dimn%
\newdimen\pst@dimo%
\newdimen\pst@dimp%
\newcount\pst@cntm%
\newcount\pst@cntn%
\newcount\pst@cnto%
\newcount\pst@cntp%
\psset{dx=0}%
\psset{dy=0}%
\newcount\@zero\@zero=0\relax
%
\def\pst@getdimdim#1 #2 #3\@nil{%
\ifx#2\pst@missing\relax%
\pssetxlength\pst@dimn{#1}%
\pst@dimm=0pt%
\else%
\pssetlength\pst@dimm{#1}%
\pssetlength\pst@dimn{#2}%
\fi%
}
\def\pst@getxdimdim#1 #2 #3\@nil{%
\ifx#2\pst@missing\relax%
\pssetxlength\pst@dimn{#1}%
\pst@dimm=0pt%
\else%
\pssetxlength\pst@dimm{#1}%
\pssetxlength\pst@dimn{#2}%
\fi%
}
\def\pst@getydimdim#1 #2 #3\@nil{%
\ifx#2\pst@missing\relax%
\pssetxlength\pst@dimn{#1}%
\pst@dimm=0pt%
\else%
\pssetylength\pst@dimm{#1}%
\pssetylength\pst@dimn{#2}%
\fi%
}
%
% A modulo macro for integer values
% \pst@mod{34}{6}\value ==> \value is 4
%
\def\pst@mod#1#2#3{%
\begingroup%
\pst@cntm=#1\pst@cntn=#2\relax%
\pst@cnto=\pst@cntm%
\divide\pst@cntm by \pst@cntn%
\multiply\pst@cntn by \pst@cntm%
\advance\pst@cnto by -\pst@cntn%
\edef\value{\endgroup\def\noexpand#3{\number\pst@cnto}}\value%
}
\def\pst@max#1#2#3{%
\begingroup%
\pst@cntm=#1\pst@cntn=#2\relax%
\ifnum\pst@cntm<\pst@cntn\pst@cntm=\pst@cntn\fi
\global#3=\the\pst@cntm%
\endgroup%
}
\def\pst@maxdim#1#2#3{%
\begingroup%
\pst@dimm=#1\pst@dimn=#2\relax%
\ifdim\pst@dimm<\pst@dimn\pst@dimm=\pst@dimn\fi
\global#3=\the\pst@dimm%
\endgroup%
}
\def\pst@abs#1#2{%
\begingroup%
\pst@cntm=#1\relax%
\ifnum\pst@cntm<\z@\pst@cntm=-\pst@cntm\fi%
\global#2=\the\pst@cntm
\endgroup%
}
\def\pst@absdim#1#2{%
\begingroup%
\pst@dimm=#1\relax%
\ifdim\pst@dimm<\z@\pst@dimm=-\pst@dimm\fi%
\global#2=\the\pst@dimm%
\endgroup%
}
%
%--------------------------------------- small stuff -------------------------------
\def\defineTColor{\@ifnextchar[{\defineTColor@i}{\defineTColor@i[]}}
\def\defineTColor@i[#1]#2#3{% transparency "Colors"
\newpsstyle{#2}{%
fillstyle=vlines,hatchcolor=#3,
hatchwidth=0.1\pslinewidth,hatchsep=1\pslinewidth,#1%
}%
}
%
\def\rmultiput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\rmultiput@i}{\rmultiput@i[]}}}
\def\rmultiput@i[#1]{\begingroup\psset{#1}\rmultiput@ii}
\def\rmultiput@ii#1{\def\@rmultiputArg{#1}%
\@ifnextchar({\rmultiput@iii}{\rmultiput@iii(\z@,\z@)}}
\def\rmultiput@iii(#1){%
\pst@killglue%
\if@star\rput*(#1){\@rmultiputArg}
\else\rput(#1){\@rmultiputArg}%
\fi
\@ifnextchar({\rmultiput@iii}{\endgroup}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Begin patch TN; Date (YY-MM-DD): 04-07-17; first part
\define@key[psset]{}{dash}{% defined in pstricks.tex
\pst@expandafter\psset@@dash{#1}\@nil% Error handling for empty argument.
}
\define@key[psset]{}{maxdashes}{\edef\psk@maxdashes{#1}}
\psset{maxdashes=11}
\def\psset@@dash#1\@nil{%
\def\psk@dash{}%
% modification 04-08-07:
\pst@cntm0
\def\next##1 ##2\relax{%
\expandafter\ifnum\psk@maxdashes>\pst@cntm\relax% 04-08-07
\edef\@tempa{##1}%
\ifx\@tempa\@empty\else% gobble leading spaces
\pssetlength\pst@dimc{##1}%
\advance\pst@cntm by 1
\edef\psk@dash{\psk@dash\space\pst@number\pst@dimc}%
\fi%
\edef\@tempa{##2}%
\ifx\@tempa\@empty\else% detect end
\ifx\@tempa\space\else% gobble trailing spaces
\next##2\relax%
\fi\fi%
\else% 04-08-07
\@pstrickserr{Number of dashes > \psk@maxdashes. Increasing
`maxdashes' might work.}\@ehpa% 04-08-07
\fi% 04-08-07
}%
\expandafter\next#1 \relax}
%% End patch TN; Date (YY-MM-DD): 04-07-17; 1st part
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\psset{dash=5pt 3pt}% black white black white
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Begin patch TN; Date (YY-MM-DD): 04-07-17; 2nd part
\def\psls@dashed{%
\ifpsdashadjust
[ \psk@dash ] \pst@linetype\space \tx@DashLine
\else
[ \psk@dash ] 0 setdash stroke
\fi}
%% End patch TN; Date (YY-MM-DD): 04-07-17; 2nd part
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-----------------------------------------------------------------------------------
\pst@def{DashLine}<{
dup 0 gt
{ /a .5 def PathLength exch div }
{ pop /a 1 def PathLength } ifelse
/b ED % pattern should fit evenly in b
dup /X ED % pattern array
0 get /y ED % length of first black segment
/z 0 X {add} forall def % length of the full pattern
%% Computation of the scaling factor as described by van Zandt:
b a .5 sub 2 mul y mul sub z Div round
z mul a .5 sub 2 mul y mul add b exch Div
%%%% scaling factor on stack.
/z ED %% now, z is the scaling factor
false % for the length test below
X { z mul } forall X astore %% modification TN 04-08-07
%%% Checking whether at least one dash in X has positive length:
{0 gt or} forall
{ X 1 a sub y mul }
{ [ 1 0 ] 0 }
ifelse
setdash stroke }>
%% TN end patch; Date (YY-MM-DD): 04-07-17;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
\define@key[psset]{}{intSeparator}{\edef\psk@intSeparator{#1}}
\psset{intSeparator={,}}
%
\def\psFormatInt{\@ifnextchar[{\psFormatInt@i}{\psFormatInt@i[]}}
\def\psFormatInt@i[#1]#2{{%
\def\ps@tempa{#1}
\ifx\ps@tempa\@empty\else\psset{#1}\fi
\count1=#2\count2=\count1
\ifnum\count1=0 0\else
\ifnum\count1>999999
\count3=\count1
\divide\count3 by 1000000
\the\count3\psk@intSeparator
\multiply\count3 by 1000000
\advance\count1 by -\count3 % modulo 1000000
\fi
\ifnum\count2>999
\count3=\count1
\divide\count3 by 1000
\ifnum\count2>99999
\ifnum\count3<100 0\fi
\ifnum\count3<10 0\fi
\fi
\the\count3\psk@intSeparator
\multiply\count3 by 1000
\advance\count1 by -\count3 %modulo 1000
\fi%
\ifnum\count2>999
\ifnum\count1<100 0\fi
\ifnum\count1<10 0\fi
\fi
\the\count1
\fi
}}
%
\newdimen\pst@braceWidth
\define@key[psset]{}{braceWidth}{\pssetlength\pst@braceWidth{#1}}
\define@key[psset]{}{bracePos}{\edef\psk@bracePos{#1}}
\psset{braceWidth=10pt,bracePos=0.5}
%
\def\@@rput@iv(#1){\pst@killglue\pst@makebox{\@@rput@v{#1}}}
\def\@@rput@v#1{%
\begingroup
\use@par
\pst@makesmall\pst@hbox
\pst@Verb{%
Alpha 90 sub \pst@number\pst@braceWidth 0 lt {180 add} if
\ifx\psk@rot\@empty\else\psk@rot add \fi
/rotAngle exch def
}%
\setbox\pst@hbox=\hbox{%
\pst@Verb{rotAngle \tx@RotBegin}%
\box\pst@hbox\pst@Verb{\tx@RotEnd}%
}%
\psput@{#1}\pst@hbox
\endgroup
\ignorespaces%
}
%
\def\psbrace{\pst@object{psbrace}}
\def\psbrace@i(#1)(#2)#3{{%
\psset{linearc=2mm,linewidth=1pt,%
nodesepA=0pt,nodesepB=0pt,bracePos=0.5}% the default
\use@par%
\pst@getcoor{#1}\pst@tempa%
\pst@getcoor{#2}\pst@tempb%
\pnode(!%
/bW2 \pst@number\pst@braceWidth \pst@number\psyunit div 2.0 div def
\pst@tempa /YA exch \pst@number\psyunit div def
/XA exch \pst@number\psxunit div def
\pst@tempb /YB exch \pst@number\psyunit div def
/XB exch \pst@number\psxunit div def
/Alpha YB YA sub XB XA sub atan def
/xMid XB XA sub \psk@bracePos\space mul XA add def
/yMid YB YA sub \psk@bracePos\space mul YA add def
/@deltaX Alpha sin bW2 mul def
/@deltaY Alpha cos bW2 mul def
/@xTemp xMid @deltaX 2 mul add def
/@yTemp yMid @deltaY 2 mul sub def
@xTemp @yTemp){@tempNode}%
\pst@getcoor{@tempNode}\pst@tempc%
\@@rput@iv(! %
\pst@tempc /Yc exch def
/Xc exch def
Xc \psk@nodesepA\space add \pst@number\psxunit div
Yc \psk@nodesepB\space add \pst@number\psxunit div ){#3}
\psline(#1)%
(! XA @deltaX add YA @deltaY sub)%
(! @xTemp @deltaX sub @yTemp @deltaY add)(@tempNode)%
\psline(@tempNode)%
(! @xTemp @deltaX sub @yTemp @deltaY add)%
(! XB @deltaX add YB @deltaY sub)(#2)%
}\ignorespaces}
%
% -------------- the arrow part -------------
% the original table
% \def\pst@arrowtable{,<->,<<->>,>-<,>>-<<,(-),[-]}
\edef\pst@arrowtable{\pst@arrowtable,)-(,]-[,|>-<|,H-H,h-h}
%
% HookLeft/RightArrow
\newdimen\pshooklength
\newdimen\pshookwidth
\define@key[psset]{}{hooklength}{\pssetlength\pshooklength{#1}}
\define@key[psset]{}{hookwidth}{\pssetlength\pshookwidth{#1}}
\psset{hooklength=3mm,hookwidth=1mm}
%
\edef\pst@arrowtable{\pst@arrowtable,H-H,h-h} % add new arrow
\def\tx@RHook{RHook } % PostScript name
\def\tx@Rhook{Rhook } % PostScript name
\@namedef{psas@H}{%
/RHook {
/x ED % hook width
/y ED % hook length
/z CLW 2 div def % save it
x y moveto % goto first point
x 0 0 0 0 y
curveto % draw Bezier
stroke
0 y moveto % define current point
} def
\pst@number\pshooklength
\pst@number\pshookwidth
\tx@RHook
}
\@namedef{psas@h}{%
/Rhook {
CLW mul
add dup 2 div
/w ED mul dup /h ED mul
/a ED { 0 h T 1 -1 scale } if
w neg h moveto 0 0 L
gsave
% \pst@number\pslinewidth 2 div SLW
stroke grestore
} def
false 0 \psk@arrowlength \psk@arrowsize \tx@Rhook
}
\@namedef{psas@<|}{%
\psk@tbarsize\space \tx@Tbar
0 CLW 2 div T
newpath
true \psk@arrowinset\space \psk@arrowlength\space \psk@arrowsize\space \tx@Arrow%
}
% ]-[ arrow
\def\tx@BracketOut{BracketOut }
\@namedef{psas@[}{%
/BracketOut {%
CLW mul add dup CLW sub 2 div
%/x ED mul CLW add
/x ED mul neg
/y ED
/z CLW 2 div def
x neg y moveto
x neg CLW 2 div L x CLW 2 div L x y L stroke 0 CLW moveto } def
\psk@bracketlength\space \psk@tbarsize\space \tx@BracketOut
}
% )-( arrow
\def\tx@RoundBracketOut{RoundBracketOut }
\@namedef{psas@(}{%
/RoundBracketOut {%
CLW mul add dup 2 div
%/x ED mul
/x ED mul neg
/y ED
/mtrx CM def
0 CLW
2 div T x y mul 0 ne { x y scale } if
1 1 moveto
.85 .5 .35 0 0 0 curveto
-.35 0 -.85 .5 -1 1 curveto
mtrx setmatrix stroke 0 CLW moveto } def
\psk@rbracketlength\space \psk@tbarsize\space \tx@RoundBracketOut
}
%
% Redefininition of \psset@arrowscale to store value of X scale factor
%\define@key[psset]{}{arrowscale}{\pst@getscale{#1}\psk@arrowscale}
%\psset{arrowscale=1}
\define@key[psset]{}{arrowscale}{%
\pst@@arrowscale@i#1 \@nil
\pst@getscale{\pst@arrowscale}\psk@arrowscale%
}
\def\pst@@arrowscale@i#1 #2\@nil{\edef\pst@arrowscale{#1}}
\psset{arrowscale=1}
% New parameter "arrowfill", with default as "true"
\newif\ifpsArrowFill
\define@key[psset]{}{ArrowFill}{\@nameuse{psArrowFill#1}}
\psset{ArrowFill=true}
% Modification of the PostScript macro Arrow to choose to fill or not the arrow
% (it require to restore the current linewidth, despite of the scaling)
\pst@def{Arrow}<{%
CLW mul add dup 2 div
/w ED mul dup
/h ED mul
/a ED { 0 h T 1 -1 scale } if
gsave
\ifpsArrowFill\else\pst@number\pslinewidth \pst@arrowscale\space div SLW \fi
w neg h moveto
0 0 L w h L w neg a neg rlineto
\ifpsArrowFill gsave fill grestore \else gsave closepath stroke grestore \fi
grestore
0 h a sub moveto
}>
%
\define@key[psset]{}{nArrowsA}{\def\psk@nArrowsA{#1}}
\define@key[psset]{}{nArrowsB}{\def\psk@nArrowsB{#1}}
\define@key[psset]{}{nArrows}{\def\psk@nArrowsA{#1}\def\psk@nArrowsB{#1}}
\psset{nArrows=2}
%
\@namedef{psas@>>}{%
\psk@nArrowsA\space 1 sub {
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow
0 h a sub T
} repeat
gsave
newpath
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow
CP
grestore
moveto
}
%
\@namedef{psas@<<}{%
true \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow
0 h neg a add T
\psk@nArrowsB\space 2 sub {
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow
0 h neg a add T
} repeat
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow
0 h a 5 mul 2 div sub moveto
}
%
% DG addition begin - Dec. 18/19, 1997 and Oct. 11, 2002
% Adapted from \psset@arrows
\define@key[psset]{}{ArrowInside}{%
\def\pst@tempa{#1}%
\ifx\pst@tempa\@empty\def\psk@ArrowInside{}%
\else%
\begingroup%
\pst@activearrows%
\xdef\pst@tempg{<#1}%
\endgroup%
\expandafter\psset@@ArrowInside\pst@tempg\@empty-\@empty\@nil%
\if@pst\else\@pstrickserr{Bad intermediate arrow specification: #1}\@ehpa\fi%
\fi%
}
% Adapted from \psset@@arrows
\def\psset@@ArrowInside#1-#2\@empty#3\@nil{%
\@psttrue
\def\next##1,#1-##2,##3\@nil{\def\pst@tempg{##2}}%
\expandafter\next\pst@arrowtable,#1-#1,\@nil
\@ifundefined{psas@#2}%
{\@pstfalse\def\psk@ArrowInside{}}%
{\def\psk@ArrowInside{#2}}%
}
% Default value empty
\psset{ArrowInside={}}
% Modified version of \pst@addarrowdef
\def\pst@addarrowdef{%
\addto@pscode{%
/ArrowA {
\ifx\psk@arrowA\@empty
\pst@oplineto
\else
\pst@arrowdef{A}
moveto
\fi
} def
/ArrowB {
\ifx\psk@arrowB\@empty \else \pst@arrowdef{B} \fi
} def
% DG addition
/ArrowInside {
\ifx\psk@ArrowInside\@empty \else \pst@arrowdefA{Inside} \fi
} def
}%
}
% Adapted from \pst@arrowdef
\def\pst@arrowdefA#1{%
\ifnum\pst@repeatarrowsflag>\z@
/Arrow#1c [ 6 2 roll ] cvx def Arrow#1c
\fi
\tx@BeginArrow
\psk@arrowscale
\@nameuse{psas@\@nameuse{psk@Arrow#1}}
\tx@EndArrow%
}
% ArrowInsidePos parameter (default value 0.5)
\define@key[psset]{}{ArrowInsidePos}{\pst@checknum{#1}\psk@ArrowInsidePos}%
\psset{ArrowInsidePos=0.5}
%
% Modified version of \begin@ClosedObj
\def\begin@ClosedObj{%
\leavevmode
\pst@killglue
\begingroup
\use@par
\solid@star
\ifpsdoubleline \pst@setdoublesep \fi
\pst@addarrowdef% DG addition
\init@pscode
}
%
% Redefinition of the PostScript /Line macro to print the intermediate
% arrow on each segment of the line
%
\define@key[psset]{}{ArrowInsideNo}{\pst@checknum{#1}\psk@ArrowInsideNo}% hv 20031001
\define@key[psset]{}{ArrowInsideOffset}{\pst@checknum{#1}\psk@ArrowInsideOffset}% hv 20031001
\psset{ArrowInsideNo=1,ArrowInsideOffset=0}
%
\pst@def{Line}<{%
NArray n 0 eq not { n 1 eq { 0 0 /n 2 def } if
(\psk@ArrowInside) length 0 gt {
2 copy /y1 ED /x1 ED ArrowA x1 y1
/n n 1 sub def
n {
4 copy
/y1 ED /x1 ED /y2 ED /x2 ED
x1 y1
\psk@ArrowInsidePos\space 1 gt {
/Alpha y2 y1 sub x2 x1 sub atan def
/ArrowPos \psk@ArrowInsideOffset\space def
/Length x2 x1 sub y2 y1 sub Pyth def
/dArrowPos \psk@ArrowInsidePos\space abs def
{
/ArrowPos ArrowPos dArrowPos add def
ArrowPos Length gt { exit } if
x1 Alpha cos ArrowPos mul add
y1 Alpha sin ArrowPos mul add
ArrowInside
pop pop
} loop
}{
/ArrowPos \psk@ArrowInsideOffset\space def
/dArrowPos \psk@ArrowInsideNo 1 gt {%
1.0 \psk@ArrowInsideNo 1.0 add div
}{\psk@ArrowInsidePos } ifelse def
\psk@ArrowInsideNo\space cvi {
/ArrowPos ArrowPos dArrowPos add def
x2 x1 sub ArrowPos mul x1 add
y2 y1 sub ArrowPos mul y1 add
ArrowInside
pop pop
} repeat
} ifelse
pop pop Lineto
} repeat
}{ ArrowA /n n 2 sub def n { Lineto } repeat } ifelse
CP 4 2 roll ArrowB L pop pop } if%
}>
%
% Redefinition of the PostScript /Polygon macro to print the intermediate
% arrow on each segment of the line
\pst@def{Polygon}<{%
NArray n 2 eq { 0 0 /n 3 def } if
n 3 lt {
n { pop pop } repeat
}{
n 3 gt { CheckClosed } if
n 2 mul
-2 roll
/y0 ED
/x0 ED
/y1 ED
/x1 ED
/xx1 x1 def
/yy1 y1 def
x1 y1
/x1 x0 x1 add 2 div def
/y1 y0 y1 add 2 div def
x1 y1 moveto
/n n 2 sub def
/drawArrows {
x11 y11
\psk@ArrowInsidePos\space 1 gt {
/Alpha y12 y11 sub x12 x11 sub atan def
/ArrowPos \psk@ArrowInsideOffset\space def
/Length x12 x11 sub y12 y11 sub Pyth def
/dArrowPos \psk@ArrowInsidePos\space abs def
{
/ArrowPos ArrowPos dArrowPos add def
ArrowPos Length gt { exit } if
x11 Alpha cos ArrowPos mul add
y11 Alpha sin ArrowPos mul add
ArrowInside
pop pop
} loop
}{
/ArrowPos \psk@ArrowInsideOffset\space def
/dArrowPos \psk@ArrowInsideNo 1 gt {%
1.0 \psk@ArrowInsideNo 1.0 add div
}{ \psk@ArrowInsidePos } ifelse def
\psk@ArrowInsideNo cvi {
/ArrowPos ArrowPos dArrowPos add def
x12 x11 sub ArrowPos mul x11 add
y12 y11 sub ArrowPos mul y11 add
ArrowInside
pop pop
} repeat
} ifelse
pop pop Lineto
} def
n {
4 copy
/y11 ED /x11 ED /y12 ED /x12 ED
drawArrows
} repeat
x1 y1 x0 y0
6 4 roll
2 copy
/y11 ED /x11 ED /y12 y0 def /x12 x0 def
drawArrows
/y11 y0 def /x11 x0 def /y12 yy1 def /x12 xx1 def
drawArrows
pop pop
closepath
} ifelse %
}>
%
%
% Redefinition of the PostScript /OpenBezier macro to print the intermediate
% arrow
\pst@def{OpenBezier}<{%
/dArrowPos \psk@ArrowInsideNo 1 gt {%
1.0 \psk@ArrowInsideNo 1.0 add div
}{ \psk@ArrowInsidePos } ifelse def
BezierNArray
n 1 eq { pop pop
}{ 2 copy
/y0 ED /x0 ED
ArrowA
n 4 sub 3 idiv { 6 2 roll 4 2 roll curveto } repeat
6 2 roll
4 2 roll
ArrowB
/y3 ED /x3 ED /y2 ED /x2 ED /y1 ED /x1 ED
/cx x1 x0 sub 3 mul def
/cy y1 y0 sub 3 mul def
/bx x2 x1 sub 3 mul cx sub def
/by y2 y1 sub 3 mul cy sub def
/ax x3 x0 sub cx sub bx sub def
/ay y3 y0 sub cy sub by sub def
/getValues {
ax t0 3 exp mul bx t0 t0 mul mul add cx t0 mul add x0 add
ay t0 3 exp mul by t0 t0 mul mul add cy t0 mul add y0 add
ax t 3 exp mul bx t t mul mul add cx t mul add x0 add
ay t 3 exp mul by t t mul mul add cy t mul add y0 add
} def
/getdL {
getValues
3 -1 roll sub 3 1 roll sub Pyth
} def
/CurveLength {
/u 0 def
/du 0.01 def
0 100 {
/t0 u def
/u u du add def
/t u def
getdL add
} repeat } def
/GetArrowPos {
/ende \psk@ArrowInsidePos\space 1 gt
{ArrowPos}
{ArrowPos CurveLength mul} ifelse def
/u 0 def
/du 0.01 def
/sum 0 def
{ /t0 u def
/u u du add def
/t u def
/sum getdL sum add def
sum ende gt {exit} if
} loop u
} def
/ArrowPos \psk@ArrowInsideOffset\space def
/loopNo \psk@ArrowInsidePos\space 1 gt {%
CurveLength \psk@ArrowInsidePos\space div cvi
}{ \psk@ArrowInsideNo } ifelse def
loopNo cvi {
/ArrowPos ArrowPos dArrowPos add def
/t GetArrowPos def
/t0 t 0.95 mul def
getValues
ArrowInside pop pop pop pop
} repeat
x1 y1 x2 y2 x3 y3 curveto
} ifelse
}>
%
% Redefinition of the PostScript /NCLine macro to print the intermediate
% arrow of the line
\pst@def{NCLine}<{%
NCCoor
tx@Dict begin
ArrowA CP 4 2 roll ArrowB
4 copy
/y2 ED /x2 ED /y1 ED /x1 ED
x1 y1
\psk@ArrowInsidePos\space 1 gt {
/Alpha y2 y1 sub x2 x1 sub atan def
/ArrowPos \psk@ArrowInsideOffset\space def
/Length x2 x1 sub y2 y1 sub Pyth def
/dArrowPos \psk@ArrowInsidePos\space abs def
{%
/ArrowPos ArrowPos dArrowPos add def
ArrowPos Length gt { exit } if
x1 Alpha cos ArrowPos mul add
y1 Alpha sin ArrowPos mul add
ArrowInside
pop pop
} loop
}{%
/ArrowPos \psk@ArrowInsideOffset\space def
/dArrowPos \psk@ArrowInsideNo 1 gt {%
1.0 \psk@ArrowInsideNo 1.0 add div
}{ \psk@ArrowInsidePos } ifelse def
\psk@ArrowInsideNo\space cvi {
/ArrowPos ArrowPos dArrowPos add def
x2 x1 sub ArrowPos mul x1 add
y2 y1 sub ArrowPos mul y1 add
ArrowInside
pop pop
} repeat
} ifelse
pop pop lineto pop pop
end%
}>
%
\pst@def{NCCurve}<{%
GetEdgeA GetEdgeB
xA1 xB1 sub yA1 yB1 sub
Pyth 2 div dup 3 -1 roll mul
/ArmA ED
mul
/ArmB ED
/ArmTypeA 0 def
/ArmTypeB 0 def
GetArmA GetArmB
xA2 yA2 xA1 yA1
2 copy
/y0 ED /x0 ED
tx@Dict begin
ArrowA
end
xB2 yB2 xB1 yB1
tx@Dict begin
ArrowB
end
/y3 ED /x3 ED /y2 ED /x2 ED /y1 ED /x1 ED
/cx x1 x0 sub 3 mul def
/cy y1 y0 sub 3 mul def
/bx x2 x1 sub 3 mul cx sub def
/by y2 y1 sub 3 mul cy sub def
/ax x3 x0 sub cx sub bx sub def
/ay y3 y0 sub cy sub by sub def
/getValues {
ax t0 3 exp mul bx t0 t0 mul mul add cx t0 mul add x0 add
ay t0 3 exp mul by t0 t0 mul mul add cy t0 mul add y0 add
ax t 3 exp mul bx t t mul mul add cx t mul add x0 add
ay t 3 exp mul by t t mul mul add cy t mul add y0 add
} def
/getdL {
getValues
3 -1 roll sub 3 1 roll sub Pyth
} def
/CurveLength {
/u 0 def
/du 0.01 def
0 100 {
/t0 u def
/u u du add def
/t u def
getdL add
} repeat } def
/GetArrowPos {
/ende \psk@ArrowInsidePos\space 1 gt {ArrowPos}{ArrowPos CurveLength mul} ifelse def
/u 0 def
/du 0.01 def
/sum 0 def
{
/t0 u def
/u u du add def
/t u def
/sum getdL sum add def
sum ende gt {exit} if
} loop u
} def
/dArrowPos \psk@ArrowInsideNo 1 gt {%
1.0 \psk@ArrowInsideNo 1.0 add div
}{ \psk@ArrowInsidePos } ifelse def
/ArrowPos \psk@ArrowInsideOffset\space def
/loopNo \psk@ArrowInsidePos\space 1 gt {%
CurveLength \psk@ArrowInsidePos\space div cvi
}{ \psk@ArrowInsideNo } ifelse def
loopNo cvi {
/ArrowPos ArrowPos dArrowPos add def
/t GetArrowPos def
/t0 t 0.95 mul def
getValues
ArrowInside pop pop pop pop
} repeat
x1 y1 x2 y2 x3 y3 curveto
/LPutVar [ xA1 yA1 xA2 yA2 xB2 yB2 xB1 yB1 ] cvx def
/LPutPos { t LPutVar BezierMidpoint } def
/HPutPos { { HPutLines } HPutCurve } def
/VPutPos { { VPutLines } HPutCurve } def
}>
%
%\def\psDashColorI{black}
%\def\psDashColorII{red}
\define@key[psset]{}{dashColorI}{\pst@getcolor{#1}\psDashColorI}
\define@key[psset]{}{dashColorII}{\pst@getcolor{#1}\psDashColorII}
\define@key[psset]{}{dashNo}{\edef\psk@dashNo{#1}}
%
\define@key[psset]{}{linecap}{\edef\psk@linecap{#1}}
%\psset{dashColorI=black,dashColorII=red,dashNo=0.2,linecap=0}
\psset{dashColorI=black,dashColorII=red,dashNo=0.2,linecap=0}
%
\pst@def{LineII}<{%
NArray
/n n 1 sub def
/y1 ED /x1 ED x1 y1 ArrowA x1 y1 moveto
\psk@linecap\space 3 gt
{\psk@linecap\space 0 lt {0 setlinecap} if }
{\psk@linecap\space setlinecap} ifelse
n {
/y2 ED /x2 ED
/y0 y1 def /x0 x1 def
/length x2 x1 sub y2 y1 sub Pyth def
\psk@dashNo\space 1.0 lt
{/cntMax 1.0 \psk@dashNo\space div .49 add cvi def}
{/cntMax length \psk@dashNo\space div .49 add cvi def} ifelse
x2 x1 sub cntMax div /dx ED
y2 y1 sub cntMax div /dy ED
/cnt 0 def
cntMax {
gsave
/x1 x1 dx add def
/y1 y1 dy add def
x1 y1
cnt 2 mod 0 eq
{ \pst@usecolor\psDashColorI }
{ \pst@usecolor\psDashColorII } ifelse
lineto stroke
/cnt cnt 1 add def
grestore
x1 y1 moveto
} repeat
/y1 y2 def /x1 x2 def
} repeat
x0 y0 x2 y2 ArrowB L pop pop
}>
%
\def\pslineII{\pst@object{pslineII}}
\def\pslineII@i{%
\pst@getarrows{%
\begin@OpenObj
\pst@getcoors[\pslineII@ii%
}%
}
\def\pslineII@ii{%
\addto@pscode{%
\pst@cp
\ifshowpoints true \else false \fi
\tx@LineII
}%
\end@OpenObj%
}
%
\newdimen\pswBegin\newdimen\pswEnd
\define@key[psset]{}{wBegin}{\pssetlength\pswBegin{#1}}
\define@key[psset]{}{wEnd}{\pssetlength\pswEnd{#1}}
\psset{wBegin=\pslinewidth, wEnd=\pslinewidth}
%
\pst@def{LineIII}<{%
NArray
/n n 1 sub def
/YA ED /XA ED
/bA2 \pst@number\pswBegin\space 2.0 div def
/bB2 \pst@number\pswEnd\space 2.0 div def
/xStep bB2 bA2 sub n div def
0 setlinecap
n {
XA YA moveto
/YB ED /XB ED
/Alpha YB YA sub XB XA sub atan def
/Alphasin Alpha sin def
/Alphacos Alpha cos def
\pst@usecolor\pslinecolor
0.01 SLW
/bB2 bA2 xStep add def
XA Alphasin bA2 mul sub
YA Alphacos bA2 mul add lineto
XB Alphasin bB2 mul sub
YB Alphacos bB2 mul add lineto
XB Alphasin bB2 mul add
YB Alphacos bB2 mul sub lineto
XA Alphasin bA2 mul add
YA Alphacos bA2 mul sub lineto
XA YA lineto fill
/XA XB def /YA YB def
/bA2 bB2 def
} repeat
}>
%
\def\pslineIII{\pst@object{pslineIII}}
\def\pslineIII@i{%
\pst@getarrows{%
\begin@OpenObj
\pst@getcoors[\pslineIII@ii%
}%
}
\def\pslineIII@ii{%
\addto@pscode{%
\pst@cp
\ifshowpoints true \else false \fi
\tx@LineIII
}%
\end@OpenObj%
}
%
\define@key[psset]{}{randomPoints}{\def\psk@randomPoints{#1}}
\newif\ifPst@randomColor
\define@key[psset]{}{color}[true]{\@nameuse{Pst@randomColor#1}}
\psset{randomPoints=1000,color=false}
%
\def\psRandom{\pst@object{psRandom}}% hv 2004-11-12
\def\psRandom@i{\@ifnextchar({\psRandom@ii}{\psRandom@iii(0,0)(1,1)}}
\def\psRandom@ii(#1){\@ifnextchar({\psRandom@iii(#1)}{\psRandom@iii(0,0)(#1)}}
\def\psRandom@iii(#1)(#2)#3{%
\def\pst@tempa{#3}%
\ifx\pst@tempa\pst@empty\psclip{\psframe(#2)}\else\psclip{#3}\fi
\pst@getcoor{#1}\pst@tempa
\pst@getcoor{#2}\pst@tempb
\begin@SpecialObj
\addto@pscode{
\pst@tempa\space /yMin exch def
/xMin exch def
\pst@tempb\space /yMax exch def
/xMax exch def
/dy yMax yMin sub def
/dx xMax xMin sub def
rrand srand % initializes the random generator
/getRandReal { rand 2147483647 div } def
\psk@dotsize % defines /DS ... def
\@nameuse{psds@\psk@dotstyle}
\psk@randomPoints {
\ifPst@randomColor getRandReal getRandReal getRandReal setrgbcolor \fi
getRandReal dx mul xMin add
getRandReal dy mul yMin add
Dot
\ifx\psk@fillstyle\psfs@solid fill \fi stroke
} repeat
}%
\end@SpecialObj
\endpsclip
\ignorespaces
}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% %%%%%%%%%%
%%%%%%%%%%% pst-node %%%%%%%%%%
%%%%%%%%%%% %%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This fixes a bug in pst-node, where the XY-direction is wrong
% the types are changed 1<->2 between X<->Y
%
\define@key[psset]{}{XnodesepA}{%
\pst@getlength{#1}\psk@nodesepA
\def\psk@nodeseptypeA{2 }%
}
\define@key[psset]{}{XnodesepB}{%
\pst@getlength{#1}\psk@nodesepB
\def\psk@nodeseptypeB{2 }%
}
\define@key[psset]{}{Xnodesep}{%
\pst@getlength{#1}\psk@nodesepA
\let\psk@nodesepB\psk@nodesepA
\def\psk@nodeseptypeA{2 }%
\def\psk@nodeseptypeB{2 }%
}
\define@key[psset]{}{YnodesepA}{%
\pst@getlength{#1}\psk@nodesepA
\def\psk@nodeseptypeA{1 }%
}
\define@key[psset]{}{YnodesepB}{%
\pst@getlength{#1}\psk@nodesepB
\def\psk@nodeseptypeB{1 }%
}
\define@key[psset]{}{Ynodesep}{%
\pst@getlength{#1}\psk@nodesepA
\let\psk@nodesepB\psk@nodesepA
\def\psk@nodeseptypeA{1 }%
\def\psk@nodeseptypeB{1 }%
}
%
\pst@def{NCLineII}<{
NCCoor
/y1 ED /x1 ED x1 y1 ArrowA x1 y1 moveto
/y2 ED /x2 ED
/y0 y1 def /x0 x1 def
/length x2 x1 sub y2 y1 sub Pyth def
\psk@dashNo\space 1.0 lt
{/cntMax 1.0 \psk@dashNo\space div .49 add cvi def}
{/cntMax length \psk@dashNo\space div .49 add cvi def} ifelse
x2 x1 sub cntMax div /dx ED
y2 y1 sub cntMax div /dy ED
/cnt 0 def
cntMax {
gsave
/x1 x1 dx add def
/y1 y1 dy add def
x1 y1
cnt 2 mod 0 eq
{ \pst@usecolor\psDashColorI }
{ \pst@usecolor\psDashColorII } ifelse
lineto stroke
/cnt cnt 1 add def
grestore
x1 y1 moveto
} repeat
x0 y0 x2 y2 ArrowB L pop pop%
}>
%
\def\nclineII{\pst@object{nclineII}}%
\def\nclineII@i{\check@arrow{\nclineII@ii}}%
\def\nclineII@ii#1#2{\nc@object{Open}{#1}{#2}{.5}%
{\tx@NCLineII /LPutPos { xB yB xA yA \tx@LPutLine } def}%
}%
\def\pclineII{\pst@object{pclineII}}%
\def\pclineII@i{\pc@object\nclineII@ii}%
%
\define@key[psset]{}{lineAngle}{\psset{armB=0.5}\edef\psk@lineAngle{#1}}%
\psset{lineAngle=0}%
%
\pst@def{NCDiag}<{
GetEdgeA GetEdgeB GetArmA GetArmB mark
\psk@lineAngle\space abs 0 gt {
/xTemp xA2 10 add def
/yTemp yA2 \psk@lineAngle\space dup sin exch cos div 10 mul add def
/dY1 yTemp yA2 sub def
/dX1 xTemp xA2 sub def
/dY2 yB2 yB1 sub def
/dX2 xB2 xB1 sub def
dX1 abs 0.01 lt {
/m2 dY2 dX2 div def
/xB2 xA2 def
/yB2 xA2 xB1 sub m2 mul yB1 add def
}{
dX2 abs 0.01 lt {
/m1 dY1 dX1 div def
/xB2 xB1 def
/yB2 xB1 xA2 sub m1 mul yA2 add def
}{%
/m1 dY1 dX1 div def
/m2 dY2 dX2 div def
/xB2 m1 xA2 mul m2 xB1 mul sub yA2 sub yB1 add m1 m2 sub div def
/yB2 xB2 xA2 sub m1 mul yA2 add def
} ifelse
} ifelse
} if
ArmB 0 ne { xB1 yB1 } if
xB2 yB2
xA2 yA2
ArmA 0 ne { xA1 yA1 } if
tx@Dict begin false Line end
/LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx def
/LPutPos { LPutLines } def
/HPutPos { HPutLines } def
/VPutPos { VPutLines } def
}>
% hv 2003-12-22
\pst@def{NCDiagg}<{
GetEdgeA GetArmA \psk@lineAngle\space abs 0 gt { \psk@lineAngle\space }
{ yB yA2 sub xB xA2 sub Atan 180 add } ifelse /AngleB ED
GetEdgeB mark
\psk@lineAngle\space abs 0 gt {
/dY2 yA2 yA1 sub def
/dX2 xA2 xA1 sub def
\psk@lineAngle\space abs 90 eq {
/m2 dY2 dX2 div def
/yA2 xB xA2 sub m2 mul yA2 add def
/xA2 xB def
}{
/m1 \psk@lineAngle\space dup sin exch cos div def % tan alpha
dX2 abs 0.01 lt {
/yA2 xA1 xB sub m1 mul yB add def
/xA2 xA1 def
}{%
/m2 dY2 dX2 div def
/xA2 m1 xB mul m2 xA2 mul sub yA2 add yB sub m1 m2 sub div def
/yA2 xA2 xB sub m1 mul yB add def
} ifelse
} ifelse
} if
xB1 yB1 xA2 yA2
ArmA 0 ne { xA1 yA1 } if
tx@Dict begin false Line end
/LPutVar [ xB1 yB1 xA2 yA2 xA1 yA1 ] cvx def
/LPutPos { LPutLines } def
/HPutPos { HPutLines } def
/VPutPos { VPutLines } def
}>
%
\def\ncbarr{\pst@object{ncbarr}}
\def\ncbarr@i#1#2{
\begingroup
\use@par%
\setLNode(#1)(#2){0.5}{barr@tempNode}%
\pst@dimm=\psk@angleA pt
\pst@dimn=180pt
% be sure, that angleA is 0 or 180. if not, we set it to 0
\ifdim\pst@dimm=\z@\else\ifdim\pst@dimm=\pst@dimn\else\psset{angleA=0}\fi\fi
\ncbar[arrows=-]{#1}{barr@tempNode}
\ifdim\psk@angleA pt=\z@\relax
\ncbar[angleA=180,angleB=180]{barr@tempNode}{#2}
\else\ncbar[angleA=0,angleB=0]{barr@tempNode}{#2}\fi%
\endgroup
}
% #1-------#4----------------#2
% where #1#4= #3 * #1#2
%
\def\setLNode(#1)(#2)#3#4{%
\pst@getcoor{#1}\pst@tempa%
\pst@getcoor{#2}\pst@tempb%
\pnode(!%
\pst@tempa /YA exch \pst@number\psyunit div def
/XA exch \pst@number\psxunit div def
\pst@tempb /YB exch \pst@number\psyunit div def
/XB exch \pst@number\psxunit div def
/dx XB XA sub def
/dy YB YA sub def
XA dx #3\space mul add YA dy #3\space mul add){#4}
}
%
% build the linear combination #2*#1+#4*#3=#5
\def\setLCNode(#1)#2(#3)#4#5{%
\pst@getcoor{#1}\pst@tempa%
\pst@getcoor{#3}\pst@tempb%
\pnode(!%
\pst@tempa /YA exch \pst@number\psyunit div def
/XA exch \pst@number\psxunit div def
\pst@tempb /YB exch \pst@number\psyunit div def
/XB exch \pst@number\psxunit div def
XA #2\space mul XB #4\space mul add
YA #2\space mul YB #4\space mul add){#5}
}
%
\newif\ifPst@trueAngle
\define@key[psset]{}{trueAngle}[true]{\@nameuse{Pst@trueAngle#1}}
\psset{trueAngle=false}
%
\def\psRelLine{\pst@object{psRelLine}}
\def\psRelLine@i{\@ifnextchar({\psRelLine@iii}{\psRelLine@ii}}
\def\psRelLine@ii#1{%
\addto@par{arrows=#1}%
\psRelLine@iii%
}
\def\psRelLine@iii(#1)(#2)#3#4{{
\pst@killglue
\use@par
\pst@getcoor{#1}\pst@tempa
\pst@getcoor{#2}\pst@tempb
\pnode(!
\pst@tempa /YA exch \pst@number\psyunit div def
/XA exch \pst@number\psxunit div def
\pst@tempb /YB exch \pst@number\psyunit div def
/XB exch \pst@number\psxunit div def
/AlphaStrich \psk@angleA\space def
/unit \pst@number\psyunit \pst@number\psxunit div def % yunit/xunit
%
/dx XB XA sub def
/dy YB YA sub \ifPst@trueAngle\space unit mul \fi\space def
/laenge dy dup mul dx dup mul add sqrt #3 mul def
/Alpha dy dx atan def
/beta Alpha AlphaStrich add def
laenge beta cos mul XA add
laenge beta sin mul \ifPst@trueAngle\space unit div \fi\space YA add ){#4}%
\psline(#1)(#4)%
}\ignorespaces}
%
% #1 options
% draw a parallel line to #2 #3
% #2---------#3
% #4----------#5(new node)
% #5 length of the line
% #6 node name
\def\psParallelLine{\pst@object{psParallelLine}}
\def\psParallelLine@i{\@ifnextchar({\psParallelLine@iii}{\psParallelLine@ii}}
\def\psParallelLine@ii#1{%
\addto@par{arrows=#1}%
\psParallelLine@iii%
}
\def\psParallelLine@iii(#1)(#2)(#3)#4#5{{
\pst@killglue
\use@par
\pst@getcoor{#1}\pst@tempa
\pst@getcoor{#2}\pst@tempb
\pst@getcoor{#3}\pst@tempc
% \pst@getlength{#4}\pst@dima
\pnode(!%
\pst@tempa /YA exch \pst@number\psyunit div def
/XA exch \pst@number\psxunit div def
\pst@tempb /YB exch \pst@number\psyunit div def
/XB exch \pst@number\psxunit div def
\pst@tempc /YC exch \pst@number\psyunit div def
/XC exch \pst@number\psxunit div def
%
/dx XB XA sub def
/dy YB YA sub def
/laenge dy dup mul dx dup mul add sqrt #4 mul def
/Alpha dy dx atan def
laenge Alpha cos mul XC add
laenge Alpha sin mul YC add ){#5}%
\psline(#3)(#5)
}\ignorespaces}
%
\def\psIntersectionPoint(#1)(#2)(#3)(#4)#5{%
\pst@getcoor{#1}\pst@tempa
\pst@getcoor{#2}\pst@tempb
\pst@getcoor{#3}\pst@tempc
\pst@getcoor{#4}\pst@tempd
\pnode(!%
\pst@tempa /YA exch \pst@number\psyunit div def
/XA exch \pst@number\psxunit div def
\pst@tempb /YB exch \pst@number\psyunit div def
/XB exch \pst@number\psxunit div def
\pst@tempc /YC exch \pst@number\psyunit div def
/XC exch \pst@number\psxunit div def
\pst@tempd /YD exch \pst@number\psyunit div def
/XD exch \pst@number\psxunit div def
/dY1 YB YA sub def
/dX1 XB XA sub def
/dY2 YD YC sub def
/dX2 XD XC sub def
dX1 abs 0.01 lt {
/m2 dY2 dX2 div def
XA dup XC sub m2 mul YC add
}{
dX2 abs 0.01 lt {
/m1 dY1 dX1 div def
XC dup XA sub m1 mul YA add
}{%
/m1 dY1 dX1 div def
/m2 dY2 dX2 div def
m1 XA mul m2 XC mul sub YA sub YC add m1 m2 sub div dup
XA sub m1 mul YA add
} ifelse
} ifelse ){#5}%
}
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% %%%%%%%%%%
%%%%%%%%%%% pst-plot %%%%%%%%%%
%%%%%%%%%%% %%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\newif\ifPst@plot@comma
\define@key[psset]{}{comma}[true]{\@nameuse{Pst@plot@comma#1}}
%
\newif\ifPst@plot@xAxis
\newif\ifPst@plot@yAxis
\newif\ifPst@plot@xyAxes
\define@key[psset]{}{xAxis}[true]{\@nameuse{Pst@plot@xAxis#1}}
\define@key[psset]{}{yAxis}[true]{\@nameuse{Pst@plot@yAxis#1}}
\define@key[psset]{}{xyAxes}[true]{\psset{xAxis=#1,yAxis=#1}}%
\psset{xyAxes=true}
%
\define@key[psset]{}{xyDecimals}{\def\psk@xDecimals{#1}\def\psk@yDecimals{#1}}
\define@key[psset]{}{xDecimals}{\def\psk@xDecimals{#1}}
\define@key[psset]{}{yDecimals}{\def\psk@yDecimals{#1}}
\psset{xyDecimals={}}%
%
\define@key[psset]{}{xyLabel}{\def\psk@xLabel{#1}\def\psk@yLabel{#1}}
\define@key[psset]{}{xLabel}{\def\psk@xLabel{#1}}
\define@key[psset]{}{yLabel}{\def\psk@yLabel{#1}}
\psset{xyLabel={}}
%
\define@key[psset]{}{xlogBase}{\edef\psk@xlogBase{#1}}
\define@key[psset]{}{ylogBase}{\edef\psk@ylogBase{#1}}
\define@key[psset]{}{xylogBase}{\edef\psk@xlogBase{#1}\edef\psk@ylogBase{#1}}%
\psset{xylogBase={}}
%
%logLines=all|x|y|none (0,1,2,3)
\define@key[psset]{}{logLines}{\pst@expandafter\psset@@logLines{#1}\@nil\psk@logLines}
\def\psset@@logLines#1#2\@nil#3{%
\ifx#1a\let#3\z@\else
\ifx#1x\let#3\@ne\else
\ifx#1y\let#3\tw@\else
\ifx#1n\let#3\thr@@\else
\@pstrickserr{Bad argument: `#1#2'}\@ehpa
\fi\fi\fi\fi}
\psset{logLines=none}
%
% Define "ticklines" parameter (ticklines=all|x|y|none with default=none)
%\def\psset@ticklines#1{\pst@expandafter\psset@@ticklines{#1}\@nil\psk@ticklines}
%\psset@ticklines{none}
\define@key[psset]{}{ylabelFactor}{\edef\psk@ylabelFactor{#1}}
\define@key[psset]{}{xlabelFactor}{\edef\psk@xlabelFactor{#1}}
\psset{xlabelFactor=\relax,ylabelFactor=\relax}
% The parameter styles for the tick lines
% (default=arrows=-,linestyle=dotted,dotsep=5pt)
%\newpsstyle{ticklinesXStyle}{arrows=-,linestyle=dotted,dotsep=5pt}
%\newpsstyle{ticklinesYStyle}{arrows=-,linestyle=dotted,dotsep=5pt}
%
%
%% #1 integer
%% #2 decimals
%% #3 dot
\def\@stripDecimals#1.#2.#3\@nil{%
\def\dummy{#1}%
\ifx\dummy\@empty\the\@zero\else#1\fi% the integer part
}
%
\def\pst@@@hlabel#1{%
\edef\@xyDecimals{\psk@xDecimals}%
\psk@xLabel%
\ifnum\psk@ticks<\tw@ % ticks=all|x
\ifx\psk@xlogBase\@empty
\ifPst@plot@comma\pshlabel{\expandafter\@LabelComma#1..\@nil\psk@xlabelFactor}%
\else\pshlabel{#1}%
\fi%
\else%
{\psk@xLabel\pshlabel{\psk@xlogBase\textsuperscript{\expandafter\@stripDecimals#1..\@nil }}}
\fi%
\fi%
}
\def\pst@@@vlabel#1{%
\edef\@xyDecimals{\psk@yDecimals}%
\psk@yLabel%
\ifodd\psk@ticks % ticks=all||y (0,2)
\else
\ifx\psk@ylogBase\@empty
\ifPst@plot@comma\psvlabel{\expandafter\@LabelComma#1..\@nil\psk@ylabelFactor}%
\else\psvlabel{#1}%
\fi%
\else%
{\psk@yLabel\psvlabel{\psk@ylogBase\textsuperscript{\expandafter\@stripDecimals#1..\@nil }}}
\fi%
\fi%
}
\newcount\@digitcounter\@digitcounter=0\relax
\def\@inc@digitcounter{\global\advance\@digitcounter by 1\relax}
\def\@get@digitcounter{\the\@digitcounter\relax}
\def\@Reset@digitcounter{\global\@digitcounter=0\relax}
\def\@zeroFill{%
\ifnum \@xyDecimals>\@get@digitcounter
\bgroup
0\@inc@digitcounter\@zeroFill
\egroup%
\fi%
}
% #1 the value, maybe empty
%
\def\@process@digits#1#2;{%
\ifx *#1\@zeroFill\else#1\@inc@digitcounter\@process@digits#2;\fi%
}
\def\@writeDecimals#1{%
\ifx\@xyDecimals\@empty% take value as is
\def\@tempa{#1}% write only if not empty
\ifx\@tempa\@empty% write nothing
\else
\ifPst@plot@comma,\else.\fi%
#1%
\fi%
\else% write only \xy@decimals
\ifnum\@xyDecimals>\@zero
\ifPst@plot@comma,\else.\fi
\@Reset@digitcounter
\@process@digits#1*;
\fi%
\fi%
}
%% #1 integer
%% #2 decimals
%% #3 dot
\def\@LabelComma#1.#2.#3\@nil{%
\def\dummy{#1}%
\ifx\dummy\@empty\the\@zero\else#1\fi% the integer part
\def\dummy{#2}%
\ifx\dummy\@empty\@writeDecimals{}\else\@writeDecimals{#2}\fi%
}
%
\def\psxs@none{%
\let\psk@arrowA\@empty%
\let\psk@arrowB\@empty%
\psxs@axes%
}
%
\def\psxs@axes{{%
\ifPst@plot@xAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{}\fi
\ifPst@plot@yAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{exch}\fi
}}
\def\psaxes{\pst@object{psaxes}}
\def\psaxes@i{\pst@getarrows\psaxes@ii}
\def\psaxes@ii(#1){\@ifnextchar({\psaxes@iii(#1)}{\psaxes@iv(0,0)(0,0)(#1)}}
\def\psaxes@iii(#1)(#2){\@ifnextchar({\psaxes@iv(#1)(#2)}{\psaxes@iv(#1)(#1)(#2)}}
%
\def\psaxes@iv(#1,#2)(#3,#4)(#5,#6){%
\pst@killglue
\begingroup
\setbox\pst@hbox=\hbox\bgroup%
\use@par%
\pssetxlength\pst@dimg{#1}% o-x
\pssetylength\pst@dimh{#2}% o-y
\pssetxlength\pst@dima{#3}% bl-x
\pssetylength\pst@dimb{#4}% bl-y
\pssetxlength\pst@dimc{#5}% ur-x
\pssetylength\pst@dimd{#6}% ur-y
% If minimum values are negative in log mode, we modify Ox
% (respectively Oy) if this was not done by the user
% X axis labels (\psk@log = 0 or 1)
\ifx\psk@xlogBase\@empty\else%
\ifx\psk@Ox\@empty\else% we do nothing ... hv
\ifdim\psk@Ox pt=\z@
\ifdim#3pt<\z@
\pssetxlength\pst@dimg{#3}% o-x
\psset@Ox{#3}%
\fi
\fi%
\fi%
\fi%
% Y axis labels (\psk@log = 0 or 2)
\ifx\psk@ylogBase\@empty\else%
\ifx\psk@Ox\@empty\else
\ifdim#4pt<\z@
\ifdim\psk@Oy pt=\z@
\pssetylength\pst@dimh{#4}% o-y
\psset@Oy{#4}%
\fi
\fi
\fi
\fi
% Whole thing will be translated to origin:
\advance\pst@dima-\pst@dimg % Dist. from bl-x to o-x
\advance\pst@dimb-\pst@dimh % Dist. from bl-y to o-y
\advance\pst@dimc-\pst@dimg % Dist. from ur-x to o-x
\advance\pst@dimd-\pst@dimh % Dist. from ur-y to o-y
% Make lines/arrows or frame:
\@nameuse{psxs@\psk@axesstyle}% \psxs@axes or \psxs@frame
\ifPst@plot@yAxis
\begingroup
\ifdim\pst@dima=\z@\else\showoriginfalse\fi
\ifnum\psk@dy=\z@
\pst@dimg=\psk@Dy\psyunit
\edef\psk@dy{\number\pst@dimg}%
\fi%
\ifPst@plot@xAxis\else\showorigintrue\fi%
\pst@vlabels{\pst@dimd}{\psk@arrowB}{#3}{#5}%
\ifPst@plot@xAxis\showoriginfalse\fi%
\pst@vlabels{\pst@dimb}{\psk@arrowA}{#3}{#5}%
\endgroup%
\fi
\ifPst@plot@xAxis
\begingroup%
\ifdim\pst@dimb=\z@\else\showoriginfalse\fi%
\ifnum\psk@dx=\z@%
\pst@dimg=\psk@Dx\psxunit%
\edef\psk@dx{\number\pst@dimg}%
\fi%
\ifPst@plot@yAxis\else\showorigintrue\fi%
\pst@hlabels{\pst@dimc}{\psk@arrowB}{#4}{#6}%
\ifPst@plot@yAxis\showoriginfalse\fi%
\pst@hlabels{\pst@dima}{\psk@arrowA}{#4}{#6}%
\endgroup%
\fi
% Now close "\pst@hbox" (which is 0-dimensional), and put it at the origin.
\egroup%
\pssetxlength\pst@dimg{#1}%
\pssetylength\pst@dimh{#2}%
\leavevmode\psput@cartesian\pst@hbox%
\ignorespaces%
\endgroup
}
%
\newdimen\psk@subticksize\psk@subticksize=\z@
\newdimen\pst@xticksizeA
\newdimen\pst@xticksizeB
\newdimen\pst@xticksizeC
\newdimen\pst@yticksizeA
\newdimen\pst@yticksizeB
\newdimen\pst@yticksizeC
%
\define@key[psset]{}{ticksize}{\psset{xticksize=#1,yticksize=#1}}
\define@key[psset]{}{xticksize}{%
\pst@expandafter\pst@getydimdim{#1} {\pst@missing} {} {}\@nil%
\pst@xticksizeA=\the\pst@dimm%
\pst@xticksizeB=\the\pst@dimn%
\edef\psk@xticksize{\pst@number\pst@xticksizeA\space \pst@number\pst@xticksizeB}%
\ifdim\pst@xticksizeA=0pt\pst@xticksizeC=\z@\else
\pst@absdim{\pst@xticksizeA}\pst@dimm%
\pst@absdim{\pst@xticksizeB}\pst@dimn%
\pst@maxdim{\pst@dimm}{\pst@dimn}\pst@dimo%
\pst@xticksizeC=\pst@dimo%
\fi%
}
\define@key[psset]{}{yticksize}{% overwrites the definition in pstricks
\pst@expandafter\pst@getxdimdim{#1} {\pst@missing} {} {}\@nil%
\pst@yticksizeA=\the\pst@dimm%
\pst@yticksizeB=\the\pst@dimn%
\edef\psk@yticksize{\pst@number\pst@yticksizeA \pst@number\pst@yticksizeB}%
\ifdim\pst@yticksizeA=0pt\pst@yticksizeC=\z@\else
\pst@absdim{\pst@yticksizeA}\pst@dimm%
\pst@absdim{\pst@yticksizeB}\pst@dimn%
\pst@maxdim{\pst@dimm}{\pst@dimn}\pst@dimo%
\pst@yticksizeC=\pst@dimo%
\fi%
}
\psset{xticksize=-4pt 4pt,yticksize=-4pt 4pt}
%
% full= 0, top=1, bottom=-1
\define@key[psset]{}{tickstyle}{%
\pst@expandafter\psset@@tickstyle{#1}\@nil%
\ifnum\psk@tickstyle>\z@%
\psset{xticksize=0 \pst@xticksizeB}%
\psset{yticksize=0 \pst@yticksizeB}%
\else\ifnum\psk@tickstyle<\z@%
% \expandafter\psset@xticksize\expandafter{\pst@xticksizeA\space 0}%
% \expandafter\psset@yticksize\expandafter{\pst@yticksizeA\space 0}%
\psset{xticksize=\pst@xticksizeA\space 0pt}%
\psset{yticksize=\pst@yticksizeA\space 0pt}%
\fi\fi%
}
\psset{tickstyle=full}
%
%
\define@key[psset]{}{subticks}{\edef\psk@xsubticks{#1}\edef\psk@ysubticks{#1}}
\define@key[psset]{}{xsubticks}{\edef\psk@xsubticks{#1}}
\define@key[psset]{}{ysubticks}{\edef\psk@ysubticks{#1}}
%
\define@key[psset]{}{subticksize}{\edef\psk@xsubticksize{#1}\edef\psk@ysubticksize{#1}}
\define@key[psset]{}{xsubticksize}{\edef\psk@xsubticksize{#1}}
\define@key[psset]{}{ysubticksize}{\edef\psk@ysubticksize{#1}}
%
\define@key[psset]{}{tickwidth}{%
\pst@getlength{#1}\psk@xtickwidth
\pst@getlength{#1}\psk@ytickwidth}
\define@key[psset]{}{xtickwidth}{\pst@getlength{#1}\psk@xtickwidth}
\define@key[psset]{}{ytickwidth}{\pst@getlength{#1}\psk@ytickwidth}
\define@key[psset]{}{subtickwidth}{%
\pst@getlength{#1}\psk@xsubtickwidth
\pst@getlength{#1}\psk@ysubtickwidth}
\define@key[psset]{}{xsubtickwidth}{\pst@getlength{#1}\psk@xsubtickwidth}
\define@key[psset]{}{ysubtickwidth}{\pst@getlength{#1}\psk@ysubtickwidth}
%
\define@key[psset]{}{tickcolor}{\edef\psk@xtickcolor{#1}\edef\psk@ytickcolor{#1}}
\define@key[psset]{}{xtickcolor}{\edef\psk@xtickcolor{#1}}
\define@key[psset]{}{ytickcolor}{\edef\psk@ytickcolor{#1}}
\define@key[psset]{}{subtickcolor}{\edef\psk@xsubtickcolor{#1}\edef\psk@ysubtickcolor{#1}}
\define@key[psset]{}{xsubtickcolor}{\edef\psk@xsubtickcolor{#1}}
\define@key[psset]{}{ysubtickcolor}{\edef\psk@ysubtickcolor{#1}}
%
\define@key[psset]{}{xticklinestyle}{%
\@ifundefined{psls@#1}%
{\@pstrickserr{Line style `#1' not defined}\@eha}%
{\edef\psxticklinestyle{#1}}%
}
\define@key[psset]{}{xsubticklinestyle}{%
\@ifundefined{psls@#1}%
{\@pstrickserr{Line style `#1' not defined}\@eha}%
{\edef\psxsubticklinestyle{#1}}%
}
\define@key[psset]{}{yticklinestyle}{%
\@ifundefined{psls@#1}%
{\@pstrickserr{Line style `#1' not defined}\@eha}%
{\edef\psyticklinestyle{#1}}%
}
\define@key[psset]{}{ysubticklinestyle}{%
\@ifundefined{psls@#1}%
{\@pstrickserr{Line style `#1' not defined}\@eha}%
{\edef\psysubticklinestyle{#1}}%
}
\define@key[psset]{}{ticklinestyle}{\psset{xticklinestyle=#1,yticklinestyle=#1}}
\define@key[psset]{}{subticklinestyle}{\psset{xsubticklinestyle=#1,ysubticklinestyle=#1}}
\psset{subticksize=0.75,subticks=1,tickcolor=black,ticklinestyle=solid,%
subticklinestyle=solid,%
subtickcolor=gray,%
tickwidth=0.5\pslinewidth,%
subtickwidth=0.25\pslinewidth}
%
\newif\ifis@yAxis%
%
\def\psxs@@axes#1#2#3#4#5{% llx,lly,urx,ury,exch,arrowA,arrowB
\begin@SpecialObj%
\def\pst@tempa{#5}%
\ifx\pst@tempa\@empty\relax
\is@yAxisfalse
\ifnum\psk@dx=\z@
\pst@dimg=\psk@Dx\psxunit
\edef\psk@dx{\number\pst@dimg}%
\fi
\else
\is@yAxistrue
\ifnum\psk@dy=\z@
\pst@dimg=\psk@Dy\psyunit
\edef\psk@dy{\number\pst@dimg}%
\fi
\fi%
\let\pst@linetype\pst@arrowtype%
\def\pst@tempa{none}%
\pst@addarrowdef%
\addto@pscode{%
\ifis@yAxis 0 \pst@number#4 \else \pst@number#3 0 \fi
\ifis@yAxis 0 \pst@number#2 \else \pst@number#1 0 \fi
ArrowA
CP 4 2 roll
ArrowB
/yEnd exch def /xEnd exch def
xEnd yEnd
\ifx\psk@axesstyle\pst@tempa
pop pop % axesstyle = none (only ticks)
\else
L % the line with arrows
\fi
/yStart exch def
/xStart exch def
\@nameuse{psls@\pslinestyle} % linestyle for the axes
stroke % draw the main line
% \psk@ticks: all=0; x=1; y=2; none=3
\number\psk@ticks\space dup 2 mod 0 eq \ifis@yAxis true \else false \fi and
exch 2 lt \ifis@yAxis false \else true \fi and or {
/viceversa
\ifis@yAxis\pst@number#2 \pst@number#4 \else\pst@number#1 \pst@number#3 \fi
gt { true }{ false } ifelse def % other way round
/epsilon 0.01 def % rounding errors
/minTickline \ifis@yAxis \pst@number#1 \else \pst@number#2 \fi def
/maxTickline \ifis@yAxis \pst@number#3 \else \pst@number#4 \fi def
/dT \ifis@yAxis\psk@dy\else\psk@dx\fi\space 65536 div viceversa {neg} if def
/subTNo \ifis@yAxis\psk@ysubticks\else\psk@xsubticks\fi \space def
subTNo 0 gt { /dsubT dT subTNo div def}{ /dsubT 0 def } ifelse % deltaSubTick
\ifis@yAxis \psk@yticksize \else \psk@xticksize \fi
/tickend exch def /tickstart exch def
/Twidth \ifis@yAxis \psk@ytickwidth \else \psk@xtickwidth \fi\space def
/subTwidth \ifis@yAxis \psk@ysubtickwidth \else \psk@xsubtickwidth \fi\space def
/STsize \ifis@yAxis \psk@ysubticksize \else \psk@xsubticksize \fi\space def
/TColor {
\ifis@yAxis\pst@usecolor\psk@ytickcolor
\else\pst@usecolor\psk@xtickcolor\fi\space } def
/subTColor {
\ifis@yAxis\pst@usecolor\psk@ysubtickcolor
\else\pst@usecolor\psk@xsubtickcolor\fi\space } def
/MinValue { \ifis@yAxis yStart \else xStart \fi
\ifx\psk@arrowA\@empty\else
\psk@arrowsize\space CLW mul add \psk@arrowlength\space mul
viceversa { sub epsilon add } { add epsilon sub } ifelse \fi } def
/MaxValue { \ifis@yAxis yEnd \else xEnd \fi
\ifx\psk@arrowB\@empty\else
\psk@arrowsize\space CLW mul add \psk@arrowlength\space mul
viceversa { add epsilon sub } { sub epsilon add } ifelse \fi } def
/logLines {
\ifnum\psk@logLines=\z@ true \else % all axes
\ifnum\psk@logLines<\tw@ % x axis
\ifis@yAxis false \else true \fi % do we have x or y axis
\else
\ifnum\psk@logLines<\thr@@ % y axis
\ifis@yAxis true \else false \fi % do we have x or y axis
\else
false % no one
\fi
\fi
\fi
} def
/LSstroke { % set linestyle and stroke
\ifis@yAxis\@nameuse{psls@\psyticklinestyle}
\else\@nameuse{psls@\psxticklinestyle}\fi } def
/subLSstroke { % set sublinestyle and stroke
\ifis@yAxis\@nameuse{psls@\psysubticklinestyle}
\else\@nameuse{psls@\psxsubticklinestyle}\fi } def
%\iffalse
% start ticks ---------------------------------------------------------
0 dT MaxValue { % the positive part of the axes
/cntTick exch def % the index
logLines { % log lines?
gsave
1 10 subTNo div 9.99 { % do not write a line for 1
/dx exch def % save index
/x cntTick dT dx log mul add def %
x abs MaxValue abs le { % out of range?
x minTickline #5\space moveto
x maxTickline #5\space lineto
} if
} for
subTwidth SLW subTColor % set line width and subtick color
subLSstroke
grestore % restore main tick status
stroke
/dsubT 0 def % no other subticks
} if
dsubT abs 0 gt { % du we have subticks?
gsave % save graphic state
% start subticks ----------------------------------------------------------
/cntsubTick cntTick dsubT add def
subTNo 1 sub {
cntsubTick abs MaxValue abs le { % out of range?
cntsubTick tickstart STsize mul #5\space moveto
cntsubTick tickend STsize mul #5\space lineto
}{ exit } ifelse
/cntsubTick cntsubTick dsubT add def
} repeat
subTwidth SLW subTColor % set line width and subtick color
subLSstroke
% end subticks ----------------------------------------------------------
grestore % restore tick status
} if
gsave
cntTick tickstart #5\space moveto % line begin main Tick
cntTick tickend #5\space lineto % lineto tick end
Twidth SLW TColor % set line width and tick color
LSstroke
grestore
} for
% end ticks ----------------------------------------------------------
%\fi
%\iffalse
% ================================================ % the other side
/dT dT neg def % the other side of the axis
/dsubT dsubT neg def
% start ticks ----------------------------------------------------------
0 dT MinValue epsilon viceversa { add }{ sub } ifelse {
/cntTick exch def
logLines { % log lines?
gsave
1 10 subTNo div 9.99 { % do not write a line for 1
/dx exch def % save index
/x cntTick dT dx log mul add def %
x abs MinValue abs le { % out of range?
x minTickline #5\space moveto
x maxTickline #5\space lineto
} if
} for
/dsubT 0 def
subTwidth SLW subTColor % set line width and subtick color
subLSstroke
grestore
}
dsubT abs 0 gt { % do we have subticks?
gsave % save main state
% start subticks ----------------------------------------------------------
/cntsubTick cntTick dsubT add def
subTNo 1 sub {
cntsubTick abs MinValue abs le { % out of range?
cntsubTick tickstart STsize mul #5\space moveto
cntsubTick tickend STsize mul #5\space lineto
}{ exit } ifelse
/cntsubTick cntsubTick dsubT add def
} repeat % for
% end subticks ----------------------------------------------------------
subTwidth SLW subTColor % set line width and subtick color
subLSstroke
grestore % restore main state
} if
gsave
cntTick tickstart #5\space moveto % line begin main Tick
cntTick tickend #5\space lineto % lineto tick end
Twidth SLW TColor % set line width and tick color
LSstroke
grestore
} for
% end ticks ----------------------------------------------------------
%\fi
} if
}%
\end@SpecialObj%
}
\def\psxs@frame{%
\begin@SpecialObj%
\addto@pscode{%
0 0 moveto \pst@number\pst@dimc 0 L
0 \pst@number\pst@dimd 2 copy rlineto L closepath}%
\pst@stroke%
\psk@fillstyle%
\end@SpecialObj%
\let\psk@arrowA\@empty%
\let\psk@arrowB\@empty%
% \pst@dima=0pt\pst@dimb=0pt%
% \psset{xticksize=0 \pst@dimd,yticksize=0 \pst@dimc}%
\pst@xticksizeC=\z@\pst@yticksizeC=\z@%
\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{}%
\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{exch}%
}
%
% #1:Max/Min in pt from origin; #2:arrow; #3:min; #4:max
\def\pst@hlabels#1#2#3#4{%
\ifdim#1=\z@\else% % start from 0 ?
\ifx#2\empty\else\advance#1\ifdim#1>\z@-\fi7\pslinewidth\fi%
\pst@cnta=#1\relax% % Distance (in sp) to end.
\divide\pst@cnta\psk@dx\relax% % Number of ticks/labels
\ifnum\pst@cnta=\z@\else%
\pst@dimb=\psk@dx sp% % Space between ticks.
% \ifPst@plot@yAxis\else\showorigintrue\fi%
\ifnum\psk@labels<\tw@ \ifPst@plot@xAxis\pst@@hlabels\fi\fi%
\showoriginfalse%
\fi%
\fi%
}
% Knows \pst@dimb and \pst@cnta
\def\pst@@hlabels{%
\pst@dimm=\pst@xticksizeC\advance\pst@dimm by \pslabelsep%
\vbox to\z@{%
\ifdim\pst@dimd>\z@\vskip\pst@dimm\else\vss\fi%
\ifnum\pst@cnta<\z@\pst@dimb=-\pst@dimb\fi%
\hbox to\z@{%
\ifshoworigin\hbox to \z@{\hss\pst@@@hlabel{\psk@Ox}\hss}\fi%
\mmultido{\n=\psk@Ox+\psk@Dx}{\pst@cnta}{%
\hskip\pst@dimb\hbox to \z@{\hss\pst@@@hlabel{\n}\hss}%
}\hss%
}%
\ifdim\pst@dimd>\z@\vss\else\vskip\pst@dimm\fi%
}}%
% #1:Max/Min in pt from origin; #2:arrow; #3:min; #4:max
% \psk@labels 0:all; 1:x; 2:y; 3:none
\def\pst@vlabels#1#2#3#4{%
\ifdim#1=\z@\else%
\ifx#2\empty\else\advance#1\ifdim#1>\z@-\fi7\pslinewidth\fi%
\pst@cnta=#1\relax % % Distance (in sp) to end.
\divide\pst@cnta\psk@dy\relax % % Number of ticks/labels
\ifnum\pst@cnta=\z@\else%
\pst@dima=\psk@dy sp% % Space between ticks.
% \ifPst@plot@xAxis\else\showorigintrue\fi%
\ifodd\number\psk@labels\else\ifPst@plot@yAxis\pst@@vlabels\fi\fi%
\showoriginfalse%
\fi%
\fi%
}
% \pst@dima: the width between two labels in pt
% \pst@dimc: the coordinate of the origin in pt
% \pst@cnta: the lowest label
\def\pst@@vlabels{%
\pst@dimm=\pst@yticksizeC%
\advance\pst@dimm by \pslabelsep%
\vbox to\z@{%
\ifnum\pst@cnta>\z@\pst@dima=-\pst@dima\fi%
\offinterlineskip%
\ifshoworigin
\vbox to \z@{\vss\hbox to\z@{%
\ifdim\pst@dimc>\z@\hss\else\hskip\pst@dimm\fi
\pst@@@vlabel{\psk@Oy}%
\ifdim\pst@dimc>\z@\hskip\pst@dimm\else\hss\fi}\vss}%
\fi%
\mmultido{\n=\psk@Oy+\psk@Dy}{\pst@cnta}{%
\vbox to\pst@dima{\vss}
\vbox to \z@{%
\vss\hbox to\z@{%
\ifdim\pst@dimc>\z@%
\hss\pst@@@vlabel{\n}\hskip\pst@dimm%
\else%
\hskip\pst@dimm\pst@@@vlabel{\n}\hss%
\fi
}\vss%
}}%
\vss%
}}
%
\define@key[psset]{}{nStep}{\edef\psk@nStep{#1}}
\define@key[psset]{}{nStart}{\edef\psk@nStart{#1}}
\define@key[psset]{}{nEnd}{\edef\psk@nEnd{#1}}
\define@key[psset]{}{xStep}{\edef\psk@xStep{#1}}
\define@key[psset]{}{yStep}{\edef\psk@yStep{#1}}
%
\define@key[psset]{}{xStart}{\edef\psk@xStart{#1}}
\define@key[psset]{}{xEnd}{\edef\psk@xEnd{#1}}
\define@key[psset]{}{yStart}{\edef\psk@yStart{#1}}
\define@key[psset]{}{yEnd}{\edef\psk@yEnd{#1}}
%
\define@key[psset]{}{plotNo}{\edef\psk@plotNo{#1}}
\define@key[psset]{}{plotNoMax}{\edef\psk@plotNoMax{#1}}
%
\psset{nStep=1, nStart=0, nEnd={},%
xStep=0, yStep=0, xStart={}, xEnd={}, yStart={}, yEnd={}, comma=false,%
plotNo=1,plotNoMax=1}
%
\def\pstScalePoints(#1,#2)#3#4{%
% xScale | yScale | xOperator | yOperator
% the operators can be any Postscript code
\pst@def{ScalePoints}<%
/y ED /x ED
counttomark dup dup cvi eq not { exch pop } if
/m exch def /n m 2 div cvi def
n {
#4\space y mul #2\space mul m 1 roll
#3\space x mul #1\space mul m 1 roll
/m m 2 sub
def } repeat>
}
%\pstScalePoints(1,1){}{}% the default -> no special operators
%
\def\listplot@ii#1{%
\@nameuse{beginplot@\psplotstyle}%
\addto@pscode{/D {} def mark}%
#1%
\addto@pscode{%
\tx@PreparePoints
\pst@number\psxunit
\pst@number\psyunit
\tx@ScalePoints%
}%
\@nameuse{endplot@\psplotstyle}%
}
%
\pst@def{PreparePoints}<{%
counttomark /m exch def
/n m \psk@plotNoMax\space 1 add div cvi def
\psk@plotNoMax\space 1 gt {% multiple data files?
n {
\psk@plotNoMax\space \psk@plotNo\space 1 sub neg roll % x yNo y y y ...
\psk@plotNoMax\space 1 sub { pop } repeat % x yNo
/m m \psk@plotNoMax\space 1 sub sub def
m 2 roll
} repeat
} if % no multiple data files
% counttomark /m exch def
% /n m 2 div cvi def
/xMax -99999 def /yMax -99999 def
/xP 0 def /yP 0 def
m copy
n {
/y exch def /x exch def
xMax x lt { /xMax x def } if
yMax y lt {/yMax y def } if
xP x gt { /xP x def } if
yP y gt { /yP y def } if
} repeat
% m 2 roll
\psk@xStep\space 0 gt \psk@yStep\space 0 gt or (\psk@xStart) length 0 gt or
(\psk@yStart) length 0 gt or (\psk@xEnd) length 0 gt or (\psk@yEnd) length 0 gt or {
%
(\psk@xStart) length 0 gt {\psk@xStart\space }{ xP } ifelse /xStart exch def
(\psk@yStart) length 0 gt {\psk@yStart\space }{ yP } ifelse /yStart exch def
(\psk@xEnd) length 0 gt { \psk@xEnd\space }{ xMax } ifelse /xEnd exch def
(\psk@yEnd) length 0 gt { \psk@yEnd\space }{ yMax } ifelse /yEnd exch def
n {
m -2 roll
2 copy /yVal exch def /xVal exch def
xVal xP ge
yVal yP ge and
xVal xEnd le and
yVal yEnd le and
xVal xStart ge and
yVal yStart ge and {
/xP xP \psk@xStep\space add def
/yP yP \psk@yStep\space add def
}{%
pop pop
/m m 2 sub def
} ifelse
} repeat
}{%
/ncount 0 def
(\psk@nEnd) length 0 gt { \psk@nEnd\space }{ m } ifelse
/nEnd exch def
n {
m -2 roll
\psk@nStep\space 1 gt {
ncount \psk@nStart\space sub \psk@nStep\space mod 0 eq }{ true } ifelse
ncount nEnd le and
ncount \psk@nStart\space ge and not {
pop pop
/m m 2 sub def
} if
/ncount ncount 1 add def
} repeat
} ifelse
}>
%
%
\define@key[psset]{}{xAxisLabel}{\edef\psk@xAxisLabel{#1}}
\define@key[psset]{}{yAxisLabel}{\edef\psk@yAxisLabel{#1}}
\psset{xAxisLabel=x,yAxisLabel=y}
\define@key[psset]{}{xAxisLabelPos}{\edef\psk@xAxisLabelPos{#1}}
\define@key[psset]{}{yAxisLabelPos}{\edef\psk@yAxisLabelPos{#1}}
\psset{yAxisLabelPos=\@empty,xAxisLabelPos=\@empty}
%
\newdimen\psk@llx
\newdimen\psk@lly
\newdimen\psk@urx
\newdimen\psk@ury
\define@key[psset]{}{llx}{\pssetxlength\psk@llx{#1}}
\define@key[psset]{}{lly}{\pssetylength\psk@lly{#1}}
\define@key[psset]{}{urx}{\pssetxlength\psk@urx{#1}}
\define@key[psset]{}{ury}{\pssetylength\psk@ury{#1}}
\psset{llx=\z@, lly=\z@, urx=\z@, ury=\z@}% prevents rounding errors
\newif\ifPst@plot@box
\define@key[psset]{}{box}[true]{\@nameuse{Pst@plot@box#1}}
\newdimen\pst@xunit
\newdimen\pst@yunit
%
%\def\psgraph*{\psgraph{*}}
\def\psgraph{\begingroup\pst@ifstar\psgraph@i}
\def\psgraph@i{%
\@ifnextchar[{\psgraph@ii}{\psgraph@ii[]}}
\def\psgraph@ii[#1](#2,#3)(#4,#5)#6#7{%
%\def\psgraph{\@ifnextchar[{\psgraph@i}{\psgraph@i[]}}
%\def\psgraph@i[#1](#2,#3)(#4,#5)#6#7{%
% options | minX | minY | maxX | maxY | Length x-axis | length y-axis%
\pst@dimo=#4\p@\advance\pst@dimo by -#2\p@ % delta x
\pst@divide{#6}{\pst@dimo}\pst@tempa
\pst@xunit=\pst@tempa\p@%
%
\pst@dimo=#5\p@\advance\pst@dimo by -#3\p@ % delta y
\pst@divide{#7}{\pst@dimo}\pst@tempa%
\pst@yunit=\pst@tempa\p@%
%
\pst@dima=#2\pst@xunit \advance\pst@dima by \psk@llx%
\pst@dimb=#3\pst@yunit \advance\pst@dimb by \psk@lly%
\pst@dimc=#4\pst@xunit \advance\pst@dimc by \psk@urx%
\pst@dimd=#5\pst@yunit \advance\pst@dimd by \psk@ury%
\if@star\pspicture*(\pst@dima,\pst@dimb)(\pst@dimc,\pst@dimd)\else
\pspicture(\pst@dima,\pst@dimb)(\pst@dimc,\pst@dimd)\fi
\psset{xunit=\pst@xunit,yunit=\pst@yunit}%
\psaxes[#1](0,0)(#2,#3)(#4,#5)%
\ifx\psk@xAxisLabel\@empty\else%
\ifx\psk@xAxisLabelPos\@empty%
\uput[0](#4,0){\psk@xAxisLabel}%
\uput[90](0,#5){\psk@yAxisLabel}%
\else%
\rput(\psk@xAxisLabelPos){\psk@xAxisLabel}%
\rput{90}(\psk@yAxisLabelPos){\psk@yAxisLabel}%
\fi%
\fi %
}
\def\endpsgraph{%
\pst@killglue
\endpspicture%
\endgroup%
}
\@namedef{psgraph*}{\psgraph*}
\@namedef{endpsgraph*}{\endpsgraph}
%
\iffalse% still on progress
\def\psIVaxes{\@ifnextchar[{\psIVaxes@i}{\psIVaxes@i[]}}
\def\psIVaxes@i[#1](#2,#3)(#4,#5){%
\edef\@psxMax{#3}
\edef\@psyMax{#5}
\psaxes[#1](#2,#3)(#4,#5)
\@ifnextchar[{\psIVaxes@ii}{\psIVaxes@ii[]}%
}
\def\psIVaxes@ii[#1](#2,#3){%
\psset{#1}
\pst@ticks{90}{#2}{5}{1}
% \pst@ticks{angle}{dx}{n}{int}
% int=1 if ticks appear on top of axes, 0 otherwise.
\ignorespaces
\@ifnextchar[{\psIVaxes@iii}{\psIVaxes@iii[]}%
}
\def\psIVaxes@iii[#1](#2,#3){{% to do ....
}}
\fi
%
%
\newcount\linecnt
\begingroup
\catcode`\,=13
\catcode`\_=13
\gdef\savedata@#1[#2]{%
\xdef\pst@tempg{#2_}%
\endgroup
\let#1\pst@tempg
\global\let\pst@tempg\relax
\ignorespaces}
\gdef\readdata@{%
\read1 to \pst@tempa
\ifnum\linecnt=\psk@nStep
\global\linecnt=0
\expandafter\readdata@@\pst@tempa_\@nil
\fi
\global\advance\linecnt by 1
\ifeof1\else\expandafter\readdata@\fi}
\gdef\pst@@readfile#1#2\@nil{\addto@pscode{,#1#2}}%
\gdef\readdata@@#1#2\@nil{\xdef\pst@tempg{\pst@tempg,#1#2}}%
\endgroup
\def\readdata{\@ifnextchar[{\readdata@i}{\readdata@i[]}}
\def\readdata@i[#1]#2#3{{%
\def\pst@tempa{#1}%
\ifx\pst@tempa\@empty\else\psset{#1}\fi
\openin1=#3
\begingroup
\edef\pst@tempg{}%
\ifeof1
\@pstrickserr{Data file `#3' not found.}\@ehpa
\else
\pst@datadelimiters
\catcode`\[=1
\catcode`\]=2
\global\linecnt=\psk@nStep
\readdata@%
\fi
\endgroup
\global\let#2\pst@tempg
\global\let\pst@tempg\relax
\ignorespaces%
}}
%
% D.G. addition - Jun. 9, 1998 - Polar plots using the \psplot macro
% Code added according the way suggested by Ulrich Dirr <udirr@das-team.com>
% For polar plots
\newif\ifpolarplot
\define@key[psset]{}{polarplot}{\@nameuse{polarplot#1}}
\psset{polarplot=false}
%
\define@key[psset]{}{method}{\edef\psk@method{#1}}%
\define@key[psset]{}{whichabs}{\edef\psk@whichabs{#1}}%
\define@key[psset]{}{whichord}{\edef\psk@whichord{#1}}%
\define@key[psset]{}{plotfuncx}{\edef\psk@plotfuncx{#1}}%
\define@key[psset]{}{plotfuncy}{\edef\psk@plotfuncy{#1}}%
\define@key[psset]{}{expression}{\edef\psk@expression{#1}}%
\define@key[psset]{}{VarStep}{\edef\psk@VarStep{#1}}%
\newif\ifPst@buildvector%
\define@key[psset]{}{buildvector}[true]{\@nameuse{Pst@buildvector#1}}%
\newif\ifPst@algebraic%
\define@key[psset]{}{algebraic}[false]{\@nameuse{Pst@algebraic#1}}%
\psset{method=default, whichabs=default, whichord=default,
plotfuncx=default, plotfuncy=default, buildvector=false, algebraic=false, VarStep=default}
\def\@rkiv{rk4}%
\def\@adams{adams}%
\psset{dimen=middle}% remark of ML
\def\@undef{undef}%
\def\@default{default}%
%
\def\psplot@i#1#2#3{%
\pst@killglue
\begingroup
\use@par
\@nameuse{beginplot@\psplotstyle}%
% D.G. modification begin - Jun. 9, 1998
\ifpolarplot
\addto@pscode{%
\psplot@init
/x #1 def
/x1 #2 def
/dx x1 x sub \psk@plotpoints div def
/F@pstplot \ifPst@algebraic (#3) tx@EqdfDict begin AlgParser end cvx
\else { #3 } \fi def
/xy {% Adapted from \parametricplot@i
F@pstplot dup x cos mul exch x sin mul
% #3 dup x cos mul exch x sin mul
\pst@number\psxunit mul exch
\pst@number\psyunit mul exch
} def}%
\else
% D.G. modification end
\addto@pscode{%
\psplot@init
/x #1 def
/x1 #2 def
/dx x1 x sub \psk@plotpoints div def
/F@pstplot \ifPst@algebraic (#3) tx@EqdfDict begin AlgParser end cvx
\else { #3 } \fi def
/xy {
x \pst@number\psxunit mul F@pstplot \pst@number\psyunit mul
% \ifPst@algebraic F@pstplot \else #3 \fi \pst@number\psyunit mul
} def}%
\fi
\gdef\psplot@init{}%
\@pstfalse
\@nameuse{testqp@\psplotstyle}%
\if@pst
\psplot@ii
\else
\psplot@iii
\fi
\endgroup
\ignorespaces}
\def\psplot@ii{%
\ifx\psk@VarStep\@default
\addto@pscode{%
xy \@nameuse{beginqp@\psplotstyle}
\psk@plotpoints 1 sub {
/x x dx add def
xy \@nameuse{doqp@\psplotstyle}
} repeat
/x x1 def
xy \@nameuse{doqp@\psplotstyle}}%
\else
\addto@pscode{%
xy \@nameuse{beginqp@\psplotstyle}
/Olddt dx def /OldOlddt dx def /Oldy F@pstplot def /y 0 def
/Ndt dx def /Ny 0 def
{ /Ndt Ndt 1.5 mul def %%new step is 50% larger
x1 x sub dup Ndt lt { /Ndt exch def } { pop } ifelse
{ /x x /Ny /x x Ndt add def tx@EqdfDict begin F@pstplot end def def
/x x /y /x x Ndt 2 div add def tx@EqdfDict begin F@pstplot end def def
/Oldy tx@EqdfDict begin F@pstplot end def
Ny y sub Ndt div y Oldy sub Ndt div dup 0 eq { pop pop exit } if div abs
dup 1 gt { 1 exch div } if \psk@VarStep\space gt%%if greater than rate OK
{ exit } { /Ndt Ndt 2 div def } ifelse
Ndt dx lt { exit } if
} loop
/x x Ndt add def xy \@nameuse{doqp@\psplotstyle}
x x1 eq { exit } if
/Olddt Ndt def
/OldOlddt Olddt def
/y Ny def} loop}%
\fi
\@nameuse{endqp@\psplotstyle}}
\def\psplot@iii{%
\ifx\psk@VarStep\@default
\addto@pscode{%
mark
/n 2 def
\psk@plotpoints {
xy
n 2 roll
/n n 2 add def
/x x dx add def
} repeat
/x x1 def
xy
n 2 roll}%
\else\pst@killglue
\addto@pscode{%
/Olddt dx def /OldOlddt dx def /Oldy F@pstplot def /y 0 def
/Ndt dx def /Ny 0 def /n 2 def
mark xy
{ /Ndt Ndt 1.5 mul def %%new step is 50% larger
x1 x sub dup Ndt lt { /Ndt exch def } { pop } ifelse
{ /x x /Ny /x x Ndt add def tx@EqdfDict begin F@pstplot end def def
/x x /y /x x Ndt 2 div add def tx@EqdfDict begin F@pstplot end def def
/Oldy tx@EqdfDict begin F@pstplot end def
Ny y sub Ndt div y Oldy sub Ndt div dup 0 eq { pop pop exit } if div abs
dup 1 gt { 1 exch div } if \psk@VarStep\space gt%%if greater than rate OK
{ exit } { /Ndt Ndt 2 div def } ifelse
Ndt dx lt { exit } if
} loop
/x x Ndt add def xy /n n 2 add def n 2 roll
x x1 eq { exit } if
/Olddt Ndt def
/OldOlddt Olddt def
/y Ny def} loop}%
\fi
\@nameuse{endplot@\psplotstyle}}
\def\parametricplot@i#1#2#3{%
\pst@killglue%
\begingroup
\use@par
\@nameuse{beginplot@\psplotstyle}%
\addto@pscode{%
\psplot@init
/t #1 def
/t1 #2 def
/dt t1 t sub \psk@plotpoints div def
\ifPst@algebraic/F@pstplot (#3) tx@EqdfDict begin AlgParser end cvx def \fi
/xy {
\ifPst@algebraic F@pstplot \else #3 \fi
\pst@number\psyunit mul exch
\pst@number\psxunit mul exch
} def}%
\gdef\psplot@init{}%
\@pstfalse
\@nameuse{testqp@\psplotstyle}%
\if@pst
\parametricplot@ii
\else
\parametricplot@iii
\fi
\endgroup
\ignorespaces}
%
\define@key[psset]{}{barwidth}{\pst@getlength{#1}\psk@barwidth}
\psset{barwidth=0.25cm}
%
\def\psbar@ii{\addto@pscode{false \tx@NArray \psbar@iii}}
\def\psbar@iii{%
newpath
n {
/Yval exch def /Xval exch def
Xval \number\psk@barwidth 0.5 mul sub 0 moveto
0 Yval rlineto \number\psk@barwidth 0 rlineto
0 Yval neg rlineto \number\psk@barwidth neg 0 rlineto
} repeat
}%
\def\beginplot@bar{\begin@SpecialObj}
\def\endplot@bar{%
\psbar@ii\psk@fillstyle\ifpsshadow\pst@closedshadow\fi%
\pst@stroke
\end@SpecialObj%
}
%
\def\resetOptions{%
\@zero=0%
\psset{%
%%%% pstricks %%%%%%%%
unit=1cm,%
swapaxes=false,%
showpoints=false,%
border=0pt, bordercolor=white,%
doubleline=false, doublesep=1.25\pslinewidth,%
doublecolor=white,%
shadow=false, shadowsize=3pt, shadowangle=-45, shadowcolor=darkgray,%
linewidth=.8pt,%
linecolor=black,%
dash=5pt 3pt, dashadjust=true,%
dotsep=3pt,%
linestyle=solid,%
fillcolor=white,%
hatchwidth=.8pt, hatchsep=4pt, hatchcolor=black, hatchangle=45,%
fillstyle=none,%
arrows=-, arrowscale=1, arrowsize=1.5pt 2, arrowlength=1.4, arrowinset=.4,%
tbarsize=2pt 5,%
bracketlength=.15, rbracketlength=.15,%
liftpen=0, linetype=0,%
gangle=0,%
curvature=1 .1 0,%
dotsize=2pt 2,%
dotangle=0, dotscale=1, dotstyle=*,%
linearc=0pt,%
framearc=0,%
cornersize=relative,%
dimen=outer,%
gridwidth=.8pt, griddots=0, gridcolor=black,%
subgridwidth=.4pt, subgridcolor=gray, subgriddots=0, subgriddiv=5,%
gridlabels=10pt, gridlabelcolor=black,%
framesep=3pt, boxsep=true,%
trimode=U,%
arcsep=0,radius=.25cm,%
ref=c,rot=0,labelsep=5pt,refangle=0,%
%%%%%%%%% pst-plot %%%%%%%%%%%%%
plotstyle=line,plotpoints=50,%
ticksize=-4pt 4pt,tickstyle=full,ticks=all,%
labels=all,Ox=0,Dx=1,dx=0,Oy=0,Dy=1,dy=0,%
showorigin=true,%
axesstyle=axes,%
intSeparator={,}%
braceWidth=0.35,bracePos=0.5,%
arrowscale=1,%
ArrowFill=true,%
ArrowInsidePos=0.5,%
ArrowInsideNo=1,ArrowInsideOffset=0,%
dashColorI=black,dashColorII=red,dashNo=0.2,linecap=0,%
wBegin=\pslinewidth, wEnd=\pslinewidth,%
lineAngle=0,%
xyAxes=true,%
xDecimals={},yDecimals={},%
xLabel={},yLabel={},%
xlogBase={},ylogBase={},%
logLines=none,%
nStep=1,nStart=0,nEnd={},%
xStep=0,yStep=0,xStart={},xEnd={},yStart={},yEnd={},comma=false,%
xAxisLabel=x,yAxisLabel=y,%
yAxisLabelPos=\@empty,xAxisLabelPos=\@empty,%
llx=\z@, lly=\z@, urx=\z@, ury=\z@,% prevents rounding errors
%%%%%%%%% pst-node %%%%%%%%%%
nodealign=false,%
href=0,%
vref=.7ex,%
framesize=10pt,%
nodesep=0pt,%
arm=10pt,%
offset=0pt,%
angle=0,%
arcangle=8,%
ncurv=.67,%
loopsize=1cm,%
boxsize=.4cm,%
nrot=0,%
npos=,%
tpos=0.5,%
shortput=none,%
colsep=1.5cm,%
rowsep=1.5cm,%
% shortput=tablr,%%
mcol=c,%
mnode=R,%
emnode=none}
}
%
%
\catcode`\@=\PstAtCode\relax
%
%% END: pstricks-add.tex
\endinput
|