| 1 |
% |
| 2 |
% see pstricks.tex for license and copyright |
| 3 |
% |
| 4 |
\define@key[psset]{pstricks}{gridwidth}[0.8pt]{\pst@getlength{#1}\psk@gridwidth} |
| 5 |
\psset[pstricks]{gridwidth=.8pt} |
| 6 |
\define@key[psset]{pstricks}{griddots}[0]{% |
| 7 |
\pst@cntg=#1\relax |
| 8 |
\edef\psk@griddots{\the\pst@cntg}} |
| 9 |
\psset[pstricks]{griddots=0} |
| 10 |
\define@key[psset]{pstricks}{gridcolor}[black]{\pst@getcolor{#1}\psgridcolor} |
| 11 |
\psset[pstricks]{gridcolor=black} |
| 12 |
\define@key[psset]{pstricks}{subgridwidth}[0.4pt]{\pst@getlength{#1}\psk@subgridwidth} |
| 13 |
\psset[pstricks]{subgridwidth=0.4pt} |
| 14 |
\define@key[psset]{pstricks}{subgridcolor}[gray]{\pst@getcolor{#1}\pssubgridcolor} |
| 15 |
\psset[pstricks]{subgridcolor=gray} |
| 16 |
\define@key[psset]{pstricks}{subgriddots}[0]{% |
| 17 |
\pst@cntg=#1\relax\edef\psk@subgriddots{\the\pst@cntg}} |
| 18 |
\psset[pstricks]{subgriddots=0} |
| 19 |
\define@key[psset]{pstricks}{subgriddiv}[5]{% |
| 20 |
\pst@cntg=#1\relax\edef\psk@subgriddiv{\the\pst@cntg}} |
| 21 |
\psset[pstricks]{subgriddiv=5} |
| 22 |
% |
| 23 |
\define@key[psset]{pstricks}{gridfont}[NimbusSanL-Regu]{% |
| 24 |
\ifPSTlualatex |
| 25 |
\ifx\relax#1\relax |
| 26 |
\def\psk@gridfont{\fontid\font\space .findfontid }% |
| 27 |
\else |
| 28 |
\def\psk@gridfont{/#1 findfont }% hv 2007-11-13 |
| 29 |
\fi |
| 30 |
\else |
| 31 |
\def\psk@gridfont{/#1 findfont }% hv 2007-11-13 |
| 32 |
\fi |
| 33 |
}% |
| 34 |
|
| 35 |
\ifpst@psfonts |
| 36 |
\psset[pstricks]{gridfont=Helvetica}% |
| 37 |
\else |
| 38 |
\psset[pstricks]{gridfont=NimbusSanL-Regu}% |
| 39 |
\fi |
| 40 |
% |
| 41 |
\define@key[psset]{pstricks}{gridlabels}[10pt]{\pst@getlength{#1}\psk@gridlabels} |
| 42 |
\psset[pstricks]{gridlabels=10pt} |
| 43 |
\define@key[psset]{pstricks}{gridlabelcolor}[black]{\pst@getcolor{#1}\psgridlabelcolor} |
| 44 |
\psset[pstricks]{gridlabelcolor=black} |
| 45 |
\define@key[psset]{pstricks}{griddx}[1]{\def\psk@xgridDX{#1 }} |
| 46 |
\define@key[psset]{pstricks}{griddy}[1]{\def\psk@ygridDY{#1 }} |
| 47 |
\define@key[psset]{pstricks}{xgridoffset}[0]{\pst@getlength{#1}\psk@xgridoffset} |
| 48 |
\define@key[psset]{pstricks}{ygridoffset}[0]{\pst@getlength{#1}\psk@ygridoffset} |
| 49 |
\psset[pstricks]{xgridoffset=0,ygridoffset=0,griddx=1,griddy=1} |
| 50 |
|
| 51 |
\def\tx@Grid{Grid } |
| 52 |
|
| 53 |
\def\psgrid{\pst@object{psgrid}} |
| 54 |
\def\psgrid@i{\@ifnextchar({\psgrid@ii}{\expandafter\psgrid@iv\pic@coor}} |
| 55 |
\def\psgrid@ii(#1){\@ifnextchar({\psgrid@iii(#1)}{\psgrid@iv(0,0)(0,0)(#1)}} |
| 56 |
\def\psgrid@iii(#1)(#2){\@ifnextchar({\psgrid@iv(#1)(#2)}{\psgrid@iv(#1)(#1)(#2)}} |
| 57 |
\def\psgrid@iv(#1)(#2)(#3){% |
| 58 |
\begin@SpecialObj |
| 59 |
\pst@getcoor{#1}\pst@tempA% hv 1.11 |
| 60 |
\pst@getcoor{#2}\pst@tempB% hv 1.11 |
| 61 |
\pst@@getcoor{#3}% |
| 62 |
\ifnum\psk@subgriddiv>1\relax |
| 63 |
\addto@pscode{ |
| 64 |
/xGridOffset \psk@xgridoffset\space def |
| 65 |
/yGridOffset \psk@ygridoffset\space def |
| 66 |
/GridDX \psk@xgridDX def |
| 67 |
/GridDY \psk@ygridDY def |
| 68 |
gsave |
| 69 |
\tx@setStrokeTransparency |
| 70 |
\psk@subgridwidth SLW |
| 71 |
\pst@usecolor\pssubgridcolor |
| 72 |
\pst@tempB \pst@coor \pst@tempA % hv 1.11 |
| 73 |
% \pst@number\psxunit \pst@number\psyunit % hv 1.11 |
| 74 |
\pst@number\psxunit abs \pst@number\psyunit abs % hv 1.11 |
| 75 |
\psk@subgriddiv\space \psk@subgriddots\space |
| 76 |
{} 0 |
| 77 |
\psk@gridfont 0 scalefont setfont % hv 1.16 |
| 78 |
\tx@Grid |
| 79 |
grestore |
| 80 |
}% |
| 81 |
\fi |
| 82 |
\addto@pscode{ |
| 83 |
gsave |
| 84 |
/xGridOffset \psk@xgridoffset def |
| 85 |
/yGridOffset \psk@ygridoffset def |
| 86 |
/GridDX \psk@xgridDX def |
| 87 |
/GridDY \psk@ygridDY def |
| 88 |
\tx@setStrokeTransparency |
| 89 |
\psk@gridwidth SLW |
| 90 |
\pst@usecolor\psgridcolor |
| 91 |
\pst@tempB \pst@coor \pst@tempA % hv 1.11 |
| 92 |
\pst@number\psxunit abs \pst@number\psyunit abs % hv 1.11 |
| 93 |
% \pst@number\psxunit \pst@number\psyunit % hv 1.11 |
| 94 |
1 \psk@griddots\space { \pst@usecolor\psgridlabelcolor } |
| 95 |
\psk@gridlabels |
| 96 |
\psk@gridfont \psk@gridlabels scalefont setfont % hv 1.16 |
| 97 |
\tx@Grid |
| 98 |
grestore |
| 99 |
}% |
| 100 |
\end@SpecialObj |
| 101 |
\ignorespaces} |