diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r-- | Master/texmf-dist/tex/generic/pstricks-add/pst-fp.tex | 701 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex | 2423 |
2 files changed, 61 insertions, 3063 deletions
diff --git a/Master/texmf-dist/tex/generic/pstricks-add/pst-fp.tex b/Master/texmf-dist/tex/generic/pstricks-add/pst-fp.tex deleted file mode 100644 index 1ad488864df..00000000000 --- a/Master/texmf-dist/tex/generic/pstricks-add/pst-fp.tex +++ /dev/null @@ -1,701 +0,0 @@ -%% $Id: pst-fp.tex 155 2009-11-30 07:58:45Z herbert $ -%% -%% -%% This is file `pst-fp.tex', -%% -%% IMPORTANT NOTICE: -%% -%% Package `pst-fp.tex' -%% -%% Herbert Voss <Herbert.Voss _at_ pstricks.de> -%% stolen from the fp package by Michael Mehlich -%% -%% 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: -%% `pst-fp' is a PSTricks related package for a division, -%% multiplication and addition -%% -\csname PSTFPloaded\endcsname -\let\PSTFPloaded\endinput -% -% Requires some packages -\ifx\PSTricksLoaded\endinput\else\input pstricks \fi -% -\def\fileversion{0.04} -\def\filedate{2009/11/24} -\message{`pst-fp' v\fileversion, \filedate\space (hv)} -% -\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax - -%fixed point arithmetic with values between (including) -% -999999999999999999.999999999999999999 -% and +999999999999999999.999999999999999999 - -\def\pstFPadd#1#2#3{\pstFP@callc\pstFP@add#1{#2}{#3}+\relax} % #1 := #2+#3 -\def\pstFPmul#1#2#3{\pstFP@callc\pstFP@mul#1{#2}{#3}} % #1 := #2*#3 -\def\pstFPdiv#1#2#3{\pstFP@callc\pstFP@div#1{#2}{#3}} % #1 := #2/#3 - -\countdef\pstFP@actcounter=10 % register 0 for counter -\ifnum\pstFP@actcounter<60\relax \pstFP@actcounter=60\fi - -\newcount\pstFP@xs %sign of 1st value -\newcount\pstFP@xia%integer part of 1st value -\newcount\pstFP@xib%integer part of 1st value -\newcount\pstFP@xfa%fractional part of 1st value -\newcount\pstFP@xfb%fractional part of 1st value - -\countdef\pstFP@ys=5 %sign of 2nd value -\countdef\pstFP@yia=6%integer part of 2nd value -\countdef\pstFP@yib=7%integer part of 2nd value -\countdef\pstFP@yfa=8%fractional part of 2nd value -\countdef\pstFP@yfb=9%fractional part of 2nd value - -\countdef\pstFP@xk=10 %registers for splitting 1st value -\countdef\pstFP@xl=11 -\countdef\pstFP@xm=12 -\countdef\pstFP@xn=13 -\countdef\pstFP@xo=14 -\countdef\pstFP@xp=15 -\countdef\pstFP@xq=16 -\countdef\pstFP@xr=17 -\countdef\pstFP@xz=18 -\countdef\pstFP@xt=19 -\countdef\pstFP@xu=20 -\countdef\pstFP@xv=21 - -\countdef\pstFP@yk=22 %registers for splitting 2nd value -\countdef\pstFP@yl=23 -\countdef\pstFP@ym=24 -\countdef\pstFP@yn=25 -\countdef\pstFP@yo=26 -\countdef\pstFP@yp=27 -\countdef\pstFP@yq=28 -\countdef\pstFP@yr=29 -\countdef\pstFP@yz=30 -\countdef\pstFP@yt=31 -\countdef\pstFP@yu=32 -\countdef\pstFP@yv=33 - -\newcount\pstFP@rega %auxiliary registers -\newcount\pstFP@regb -\countdef\pstFP@regc=36 -\countdef\pstFP@regd=37 -\countdef\pstFP@rege=38 - -\countdef\pstFP@rs=39 %result registers -\countdef\pstFP@ria=40 -\countdef\pstFP@rib=41 -\countdef\pstFP@rfa=42 -\countdef\pstFP@rfb=43 - -\newcount\pstFP@regs %local auxiliary registers -\countdef\pstFP@count=45 -\countdef\pstFP@res=46 -\countdef\pstFP@shift=47 -\newcount\pstFP@times -\countdef\pstFP@prod=49 - -%auxiliary macros which may be used in all of the following macros -\newif\ifpstFP@test - -\def\pstFP@ignorenext#1{} -\def\pstFP@first#1#2\relax{#1} -\def\pstFP@swallow#1\relax{} -% -\def\ifpstFP@zero#1{% - \ifnum% - \expandafter\ifnum\csname pstFP@#1ia\endcsname=0 0\else1\fi% - \expandafter\ifnum\csname pstFP@#1ib\endcsname=0 0\else1\fi% - \expandafter\ifnum\csname pstFP@#1fa\endcsname=0 0\else1\fi% - \expandafter\ifnum\csname pstFP@#1fb\endcsname=0 0\else1\fi% - =0\relax% -} -% -%read value -% -\def\pstFP@correctintcounter#1\relax{% - {\edef\pstFP@tmp{#1}% - \pstFP@count=0\relax% - \loop% - \edef\pstFP@tmpa{\expandafter\pstFP@first\pstFP@tmp\noexpand\relax}% - \expandafter\ifx\pstFP@tmpa0\relax% - \advance\pstFP@count1\relax% - \edef\pstFP@tmp{\expandafter\pstFP@ignorenext\pstFP@tmp}% - \repeat% - \ifnum\pstFP@count>18\relax% - \typeout{>>>> Overflow}% - \fi% - \expandafter\if!\pstFP@tmp!% - \advance\pstFP@count-18\relax% - \pstFP@count=-\pstFP@count% - \loop% - \ifnum\pstFP@count>0\relax% - \pstFP@regc=\pstFP@rega% - \divide\pstFP@rega10\relax\multiply\pstFP@rega10\relax% - \advance\pstFP@regc-\pstFP@rega\multiply\pstFP@regc100000000\relax% - \divide\pstFP@rega10\relax% - \divide\pstFP@regb10\relax\advance\pstFP@regb\pstFP@regc% - \advance\pstFP@count-1\relax% - \repeat% - \global\pstFP@rega=\pstFP@rega% - \global\pstFP@regb=\pstFP@regb% - \else% - \typeout{>>>>Number too big}% - \fi% - }% -} -\def\pstFP@@setintcounter#1#2#3#4#5#6#7#8#9{% - \pstFP@regb=#1#2#3#4#5#6#7#8#9\relax% - \pstFP@correctintcounter% -} -\def\pstFP@setintcounter#1#2#3#4#5#6#7#8#9{% - \pstFP@rega=#1#2#3#4#5#6#7#8#9\relax% - \pstFP@@setintcounter% -} - -\def\pstFP@@setfractcounter#1#2#3#4#5#6#7#8#9{% - \pstFP@regb=#1#2#3#4#5#6#7#8#9\relax% - \pstFP@swallow% -} -\def\pstFP@setfractcounter#1#2#3#4#5#6#7#8#9{% - \pstFP@rega=#1#2#3#4#5#6#7#8#9\relax% - \pstFP@@setfractcounter% -} - -\def\pstFP@getsign#1\relax{% - {\pstFP@regs=1\relax% - \edef\pstFP@tmp{#1}% - \loop% - \edef\pstFP@tmpa{\expandafter\pstFP@first\pstFP@tmp\noexpand\relax}% - \expandafter\ifx\pstFP@tmpa-\relax% - \multiply\pstFP@regs-1\relax% - \fi% - \ifnum\expandafter\ifx\pstFP@tmpa-1\else0\fi\expandafter\ifx\pstFP@tmpa+1\else0\fi>0% - \edef\pstFP@tmp{\expandafter\pstFP@ignorenext\pstFP@tmp}% - \repeat% - \global\let\pstFP@tmp\pstFP@tmp% - \global\pstFP@regs=\pstFP@regs% - }% -} - -\def\pstFP@removeleadingzeros#1\relax{% - {\edef\pstFP@tmp{#1}% - \loop% - \edef\pstFP@tmpa{\expandafter\pstFP@first\pstFP@tmp\noexpand\relax}% - \expandafter\ifx\pstFP@tmpa0\relax% - \edef\pstFP@tmp{\expandafter\pstFP@ignorenext\pstFP@tmp}% - \repeat% - \global\let\pstFP@tmp\pstFP@tmp% - }% -} - -\newif\ifpstFP@nonstop -\def\pstFP@strip#1{% - {\edef\pstFP@tmp{#1}% - \edef\pstFP@tmpb{}% - \ifx\pstFP@tmp\@empty\else% - \pstFP@nonstoptrue% - \loop% - \edef\pstFP@tmpa{\expandafter\pstFP@first\pstFP@tmp\noexpand\relax}% - \expandafter\ifx\pstFP@tmpa-\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% - \expandafter\ifx\pstFP@tmpa+\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% - \expandafter\ifx\pstFP@tmpa0\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% - \expandafter\ifx\pstFP@tmpa1\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% - \expandafter\ifx\pstFP@tmpa2\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% - \expandafter\ifx\pstFP@tmpa3\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% - \expandafter\ifx\pstFP@tmpa4\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% - \expandafter\ifx\pstFP@tmpa5\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% - \expandafter\ifx\pstFP@tmpa6\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% - \expandafter\ifx\pstFP@tmpa7\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% - \expandafter\ifx\pstFP@tmpa8\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% - \expandafter\ifx\pstFP@tmpa9\relax\edef\pstFP@tmpb{\pstFP@tmpb\pstFP@tmpa}\else% - \ifx\pstFP@tmpa\@empty\pstFP@nonstopfalse\else% - \ifx\pstFP@tmpa\space\pstFP@nonstopfalse\else% - \typeout{>>> Illegal character \pstFP@tmpa\space found in float number}% - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi% - \edef\pstFP@tmp{\expandafter\pstFP@ignorenext\pstFP@tmp}% - \ifx\pstFP@tmp\@empty\pstFP@nonstopfalse\fi% - \ifpstFP@nonstop% - \repeat% - \fi% - \global\let\pstFP@tmp\pstFP@tmpb% - }% -} - -\def\pstFP@readvalue#1#2#3{% - % #1 macro family to catch the value - % #2.#3 value - % - % regular expression [+|-]*[d]_0^18.[d]* - % - \pstFP@strip{#2}% - %sign - \expandafter\pstFP@getsign\pstFP@tmp\relax% - \csname pstFP@#1s\endcsname=\pstFP@regs% - % - %integer part - \pstFP@removeleadingzeros\pstFP@tmp\relax% - \expandafter\pstFP@setintcounter\pstFP@tmp000000000000000000\relax% - \csname pstFP@#1ia\endcsname=\pstFP@rega% - \csname pstFP@#1ib\endcsname=\pstFP@regb% - % - %fractional part - \pstFP@strip{#3}% - \expandafter\pstFP@setfractcounter\pstFP@tmp000000000000000000\relax% - \csname pstFP@#1fa\endcsname=\pstFP@rega% - \csname pstFP@#1fb\endcsname=\pstFP@regb% - % - %correct sign - \ifnum\pstFP@rega=0\relax% - \ifnum\pstFP@regb=0\relax% - \expandafter\ifnum\csname pstFP@#1ib\endcsname=0\relax% - \expandafter\ifnum\csname pstFP@#1ia\endcsname=0\relax% - \csname pstFP@#1s\endcsname=1\relax% - \fi% - \fi% - \fi% - \fi% -} -% -%store value in macro -% -\def\pstFP@store#1#2{% - % #1 macro - % #2 macro family (value) to store - % - \ifpstFP@zero{#2}% - \csname pstFP@#2s\endcsname=1\relax% - \fi% - \expandafter\ifnum\csname pstFP@#2s\endcsname<0\relax% - \edef#1{-}% - \else% - \edef#1{}% - \fi% - \expandafter\ifnum\csname pstFP@#2ia\endcsname=0\relax% - \expandafter\ifnum\csname pstFP@#2ib\endcsname=0\relax% - \edef#1{#10}% - \else% - \edef#1{#1\expandafter\the\csname pstFP@#2ib\endcsname}% - \fi% - \else% - \expandafter\advance\csname pstFP@#2ib\endcsname1000000000\relax% - \edef#1{#1\expandafter\the\csname pstFP@#2ia\endcsname\expandafter\pstFP@ignorenext\the\csname pstFP@#2ib\endcsname}% - \fi% - \expandafter\advance\csname pstFP@#2fa\endcsname1000000000\relax% - \expandafter\advance\csname pstFP@#2fb\endcsname1000000000\relax% - \edef#1{#1\noexpand.\expandafter\pstFP@ignorenext\the\csname pstFP@#2fa\endcsname\expandafter\pstFP@ignorenext\the\csname pstFP@#2fb\endcsname}% -} -%macros to expand some arguments -% -\def\pstFP@callc#1#2#3#4{% - % #1 macro to call - % #2 macro, which gets the result - % #3 1st value - % #4 2nd value - % expand the values and split them into the integer and the fractional parts - \edef\next{\noexpand#1\noexpand#2#3..\noexpand\relax#4..\noexpand\relax}% - \next% -} -% -\def\pstFP@divten#1{% - \expandafter\pstFP@regc\csname pstFP@#1ia\endcsname% - \expandafter\divide\csname pstFP@#1ia\endcsname10\relax% - \expandafter\pstFP@regb\csname pstFP@#1ia\endcsname% - \multiply\pstFP@regb10\relax% - \advance\pstFP@regc-\pstFP@regb% - \multiply\pstFP@regc100000000\relax% - % - \expandafter\pstFP@rega\csname pstFP@#1ib\endcsname% - \expandafter\divide\csname pstFP@#1ib\endcsname10\relax% - \expandafter\pstFP@regb\csname pstFP@#1ib\endcsname% - \multiply\pstFP@regb10\relax% - \advance\pstFP@rega-\pstFP@regb% - \multiply\pstFP@rega100000000\relax% - \expandafter\advance\csname pstFP@#1ib\endcsname\pstFP@regc% - % - \expandafter\pstFP@regc\csname pstFP@#1fa\endcsname% - \expandafter\divide\csname pstFP@#1fa\endcsname10\relax% - \expandafter\pstFP@regb\csname pstFP@#1fa\endcsname% - \multiply\pstFP@regb10\relax% - \advance\pstFP@regc-\pstFP@regb% - \multiply\pstFP@regc100000000\relax% - \expandafter\advance\csname pstFP@#1fa\endcsname\pstFP@rega% - % - \expandafter\divide\csname pstFP@#1fb\endcsname10\relax% - \expandafter\advance\csname pstFP@#1fb\endcsname\pstFP@regc% -} -% -\def\pstFP@multen#1{% - \expandafter\multiply\csname pstFP@#1ia\endcsname10\relax% - \expandafter\ifnum\csname pstFP@#1ib\endcsname<100000000\relax% - \else% - \expandafter\pstFP@regc\csname pstFP@#1ib\endcsname% - \divide\pstFP@regc100000000% - \expandafter\advance\csname pstFP@#1ia\endcsname\pstFP@regc% - \multiply\pstFP@regc100000000% - \expandafter\advance\csname pstFP@#1ib\endcsname-\pstFP@regc% - \fi% - \expandafter\multiply\csname pstFP@#1ib\endcsname10\relax% - \expandafter\ifnum\csname pstFP@#1fa\endcsname<100000000\relax% - \else% - \expandafter\pstFP@regc\csname pstFP@#1fa\endcsname% - \divide\pstFP@regc100000000% - \expandafter\advance\csname pstFP@#1ib\endcsname\pstFP@regc% - \multiply\pstFP@regc100000000% - \expandafter\advance\csname pstFP@#1fa\endcsname-\pstFP@regc% - \fi% - \expandafter\multiply\csname pstFP@#1fa\endcsname10\relax% - \expandafter\ifnum\csname pstFP@#1fb\endcsname<100000000\relax% - \else% - \expandafter\pstFP@regc\csname pstFP@#1fb\endcsname% - \divide\pstFP@regc100000000% - \expandafter\advance\csname pstFP@#1fa\endcsname\pstFP@regc% - \multiply\pstFP@regc100000000% - \expandafter\advance\csname pstFP@#1fb\endcsname-\pstFP@regc% - \fi% - \expandafter\multiply\csname pstFP@#1fb\endcsname10\relax% -} -% -\def\pstFP@counttimes{% - {\global\pstFP@times=0\relax% - \loop% - \ifnum% - \ifnum\pstFP@xia>\pstFP@yia1% - \else\ifnum\pstFP@xia<\pstFP@yia0% - \else% - \ifnum\pstFP@xib>\pstFP@yib1% - \else\ifnum\pstFP@xib<\pstFP@yib0% - \else% - \ifnum\pstFP@xfa>\pstFP@yfa1% - \else\ifnum\pstFP@xfa<\pstFP@yfa0% - \else% - \ifnum\pstFP@xfb>\pstFP@yfb1% - \else\ifnum\pstFP@xfb<\pstFP@yfb0% - \else% - 1% - \fi\fi% - \fi\fi% - \fi\fi% - \fi\fi% - =1\relax% - \global\advance\pstFP@times1\relax% - \global\advance\pstFP@xfb-\pstFP@yfb% - \ifnum\pstFP@xfb<0\relax% - \global\advance\pstFP@xfb1000000000\relax% - \global\advance\pstFP@xfa-1\relax% - \fi% - \global\advance\pstFP@xfa-\pstFP@yfa% - \ifnum\pstFP@xfa<0\relax% - \global\advance\pstFP@xfa1000000000\relax% - \global\advance\pstFP@xib-1\relax% - \fi% - \global\advance\pstFP@xib-\pstFP@yib% - \ifnum\pstFP@xib<0\relax% - \global\advance\pstFP@xib1000000000\relax% - \global\advance\pstFP@xia-1\relax% - \fi% - \global\advance\pstFP@xia-\pstFP@yia% - \repeat% - }% -} -% -%add two values -\def\pstFP@add#1#2.#3.#4\relax#5.#6.#7\relax#8\relax{% - % #1 macro, which gets the result - % #2 integer part of 1st value - % #3 fractional part of 1st value - % #4 dummy to swallow everthing after the 2nd '.' - % #5 integer part of 2nd value - % #6 fractional part of 2nd value - % #7 dummy to swallow everthing after the 2nd '.' - % - {\ifx#8+\relax% - \pstFP@readvalue{x}{#2}{#3}% - \pstFP@readvalue{y}{#5}{#6}% - \ifnum\pstFP@xs=\pstFP@ys% - \advance\pstFP@xfb\pstFP@yfb% - \advance\pstFP@xfa\pstFP@yfa% - \ifnum\pstFP@xfb<1000000000\relax\else% - \advance\pstFP@xfb-1000000000\relax% - \advance\pstFP@xfa1\relax% - \fi% - \advance\pstFP@xib\pstFP@yib% - \ifnum\pstFP@xfa<1000000000\relax\else% - \advance\pstFP@xfa-1000000000\relax% - \advance\pstFP@xib1\relax% - \fi% - \advance\pstFP@xia\pstFP@yia% - \ifnum\pstFP@xib<1000000000\relax\else% - \advance\pstFP@xib-1000000000\relax% - \advance\pstFP@xia1\relax% - \fi% - \ifnum\pstFP@xia<1000000000\relax\else% - \pstFP@errmessage{Overflow}% - \fi% - \pstFP@store\pstFP@tmp{x}% - \else% - \advance\pstFP@xfb-\pstFP@yfb% - \ifnum\pstFP@xfb<0\relax% - \advance\pstFP@yfa1\relax% - \advance\pstFP@xfb1000000000\relax% - \fi% - \advance\pstFP@xfa-\pstFP@yfa% - \ifnum\pstFP@xfa<0\relax% - \advance\pstFP@yib1\relax% - \advance\pstFP@xfa1000000000\relax% - \fi% - \advance\pstFP@xib-\pstFP@yib% - \ifnum\pstFP@xib<0\relax% - \advance\pstFP@yia1\relax% - \advance\pstFP@xib1000000000\relax% - \fi% - \advance\pstFP@xia-\pstFP@yia% - \ifnum\pstFP@xia<0\relax% - \pstFP@xs=-\pstFP@xs% - \ifnum\pstFP@xfb=0\relax\else% - \advance\pstFP@xfb-1000000000\relax\pstFP@xfb=-\pstFP@xfb% - \advance\pstFP@xfa1\relax% - \fi% - \ifnum\pstFP@xfa=0\relax\else% - \advance\pstFP@xfa-1000000000\relax\pstFP@xfa=-\pstFP@xfa% - \advance\pstFP@xib1\relax% - \fi% - \ifnum\pstFP@xib=0\relax\else% - \advance\pstFP@xib-1000000000\relax\pstFP@xib=-\pstFP@xib% - \advance\pstFP@xia1\relax% - \fi% - \relax\pstFP@xia=-\pstFP@xia% - \fi% - \pstFP@store\pstFP@tmp{x}% - \fi% - \global\let\pstFP@tmp\pstFP@tmp% - }% - \let#1\pstFP@tmp% -} - -\def\pstFP@div#1#2.#3.#4\relax#5.#6.#7\relax{% - % #1 macro, which gets the result - % #2 integer part of 1st value - % #3 fractional part of 1st value - % #4 dummy to swallow everthing after the 2nd '.' - % #5 integer part of 2nd value - % #6 fractional part of 2nd value - % #7 dummy to swallow everthing after the 2nd '.' - % - % algorithmic idea (for x>0, y>0) - % - %determine \pstFP@shift such that y*10^\pstFP@shift <100000000<=y*10^(\pstFP@shift+1) - % - %determine \pstFP@shift' such that x*10^\pstFP@shift'<100000000<=x*10^(\pstFP@shift+1) - % - x=x*\pstFP@shift' - % - y=y*\pstFP@shift - % - \pstFP@shift=\pstFP@shift-\pstFP@shift' - % - res=0 - % - while y>0 %fixed-point representation! - % - \pstFP@times=0 - % - while x>y - % - \pstFP@times=\pstFP@times+1 - % - x=x-y - % - end - % - y=y/10 - % - res=10*res+\pstFP@times/1000000000 - % - end - % - %shift the result according to \pstFP@shift - % - {\pstFP@readvalue{x}{#2}{#3}% - \pstFP@readvalue{y}{#5}{#6}% - % - %sign - \multiply\pstFP@xs\pstFP@ys% - \pstFP@rs=\pstFP@xs% - % - %compute division - \ifpstFP@zero{y}% - \typeout{>>>>Division by zero}% - \else% - \ifpstFP@zero{x}\def\next##1{\edef\pstFP@tmp{0}}\else\def\next##1{##1}\fi% - \next% - {\pstFP@shift=0\relax% - \loop% - \ifnum\pstFP@yia<100000000\relax% - \pstFP@multen{y}% - \advance\pstFP@shift1\relax% - \repeat% - \loop% - \ifnum\pstFP@xia<100000000\relax% - \pstFP@multen{x}% - \advance\pstFP@shift-1\relax% - \repeat% - \pstFP@ria=0\pstFP@rib=0\pstFP@rfa=0\pstFP@rfb=0\relax% - \loop% - \ifpstFP@zero{y}\else% - \pstFP@counttimes%divides x by \pstFP@times*y - \pstFP@divten{y}% - \pstFP@multen{r}% - \advance\pstFP@rfb\pstFP@times% - \ifnum\pstFP@rfb<1000000000\relax\else% - \advance\pstFP@rfa1\advance\pstFP@rfb-1000000000\relax% - \ifnum\pstFP@rfa<1000000000\relax\else% - \advance\pstFP@rib1\advance\pstFP@rfa-1000000000\relax% - \ifnum\pstFP@rib<1000000000\relax\else% - \advance\pstFP@ria1\advance\pstFP@rib-1000000000\relax% - \fi% - \fi% - \fi% - \repeat% - \loop% - \ifnum\pstFP@shift>17% - \advance\pstFP@shift-1\relax% - \ifnum\pstFP@ria<100000000\else\pstFP@ria=-1\fi% - \ifnum\pstFP@ria<0\pstFP@ria=-1\fi% - \pstFP@multen{r}% - \repeat% - \ifnum\pstFP@ria<1000000000\else\pstFP@ria=-1\fi% - \loop% - \ifnum\pstFP@shift<17% - \advance\pstFP@shift1\relax% - \pstFP@divten{r}% - \repeat% - \ifnum\pstFP@ria<0\relax% - \typeout{>>>>Overflow}% - \else% - \pstFP@store\pstFP@tmp{r}% - \fi% - }% - \fi% - % - \global\let\pstFP@tmp=\pstFP@tmp% - % - }% - \let#1\pstFP@tmp% -} -%multiply two values - -\def\pstFP@firstnine#1#2#3#4#5#6#7#8#9{% - \pstFP@res=#1#2#3#4#5#6#7#8#9\relax% -} -\def\pstFP@@ninesplit#1\relax#2\end#3{% - #1% - \edef#3{#2}% -} -\def\pstFP@ninesplit#1{% - \edef#1{\expandafter\pstFP@firstnine\pstFP@rd}% - \expandafter\pstFP@@ninesplit#1\end#1\relax% -} - -\def\pstFP@split#1#2#3#4{% - % #1 highest three digits - % #2 medium three digits - % #3 least three digits - % #4 counter - \pstFP@regc=#4% - \divide\pstFP@regc1000000\relax% - #1=\pstFP@regc% - \multiply\pstFP@regc-1000000\relax\advance\pstFP@regc#4% - #3=\pstFP@regc% - \divide\pstFP@regc1000\relax% - #2=\pstFP@regc% - \multiply\pstFP@regc-1000\relax\advance\pstFP@regc#3% - #3=\pstFP@regc% -} - -\def\pstFP@@mul#1#2#3{% - \pstFP@regc=\csname pstFP@x#1\endcsname% - \multiply\pstFP@regc\csname pstFP@y#2\endcsname% - \advance\pstFP@prod\pstFP@regc% - % - \ifx#3\relax% - \let\next=\relax% - \else% - \let\next=\pstFP@@mul% - \fi% - \next#3% -} - -\def\pstFP@saveshift{% - % save rightmost three digits - \pstFP@regc=\pstFP@prod% - \divide\pstFP@prod1000\relax% - \multiply\pstFP@prod1000\relax% - \advance\pstFP@regc-\pstFP@prod% - \advance\pstFP@regc1000\relax% - \edef\pstFP@rd{\expandafter\pstFP@ignorenext\the\pstFP@regc\pstFP@rd}% - % - \divide\pstFP@prod1000\relax% -} - -\def\pstFP@mul#1#2.#3.#4\relax#5.#6.#7\relax{% - % #1 macro, which gets the result - % #2 integer part of 1st value - % #3 fractional part of 1st value - % #4 dummy to swallow everthing after the 2nd '.' - % #5 integer part of 2nd value - % #6 fractional part of 2nd value - % #7 dummy to swallow everthing after the 2nd '.' - % - % split value in various parts - % x y = 123 456 789 123 456 789 . 123 456 789 123 456 789 - % -> xk xl xm xn xo xp xq xr xs xt xu xv - % -> yk yl ym yn yo yp yq yr ys yt yu yv - % multiply these parts and save the result wrt the necessary shifts - % - {\pstFP@readvalue{x}{#2}{#3}% - \pstFP@readvalue{y}{#5}{#6}% - % - %sign - \multiply\pstFP@xs\pstFP@ys% - \pstFP@rs=\pstFP@xs% - % - % split parts - \pstFP@split\pstFP@xk\pstFP@xl\pstFP@xm\pstFP@xia\pstFP@split\pstFP@xn\pstFP@xo\pstFP@xp\pstFP@xib% - \pstFP@split\pstFP@xq\pstFP@xr\pstFP@xz\pstFP@xfa\pstFP@split\pstFP@xt\pstFP@xu\pstFP@xv\pstFP@xfb% - \pstFP@split\pstFP@yk\pstFP@yl\pstFP@ym\pstFP@yia\pstFP@split\pstFP@yn\pstFP@yo\pstFP@yp\pstFP@yib% - \pstFP@split\pstFP@yq\pstFP@yr\pstFP@yz\pstFP@yfa\pstFP@split\pstFP@yt\pstFP@yu\pstFP@yv\pstFP@yfb% - % - \pstFP@prod=0\relax% - \edef\pstFP@rd{}% - % - %compute result - \pstFP@@mul vv \relax\pstFP@saveshift% - \pstFP@@mul vu uv \relax\pstFP@saveshift% - \pstFP@@mul uu vt tv \relax\pstFP@saveshift% - \pstFP@@mul ut tu vz zv \relax\pstFP@saveshift% - \pstFP@@mul tt zu uz rv vr \relax\pstFP@saveshift% - \pstFP@@mul zt tz ur ru vq qv \relax\pstFP@saveshift% - \pstFP@@mul zz rt tr uq qu vp pv \relax\pstFP@saveshift% - \pstFP@@mul zr rz tq qt up pu vo ov \relax\pstFP@saveshift% - \pstFP@@mul rr qz zq tp pt uo ou vn nv \relax\pstFP@saveshift% - \pstFP@@mul rq qr zp pz to ot un nu vm mv \relax\pstFP@saveshift% - \pstFP@@mul qq rp pr zo oz tn nt um mu vl lv \relax\pstFP@saveshift% - \pstFP@@mul qp pq ro or zn nz tm mt ul lu kv vk \relax\pstFP@saveshift% - \pstFP@@mul pp oq qo rn nr zm mz tl lt ku uk \relax\pstFP@saveshift% - \pstFP@@mul op po nq qn rm mr zl lz tk kt \relax\pstFP@saveshift% - \pstFP@@mul oo pn np mq qm rl lr kz zk \relax\pstFP@saveshift% - \pstFP@@mul no on mp pm lq ql kr rk \relax\pstFP@saveshift% - \pstFP@@mul nn mo om pl lp qk kq \relax\pstFP@saveshift% - \pstFP@@mul mn nm lo ok pk kp \relax\pstFP@saveshift% - \pstFP@@mul mm ln nl ko ok \relax\pstFP@saveshift% - \pstFP@@mul lm ml kn nk \relax\pstFP@saveshift% - \pstFP@@mul ll km mk \relax\pstFP@saveshift% - \pstFP@@mul kl lk \relax\pstFP@saveshift% - \pstFP@@mul kk \relax\pstFP@saveshift\pstFP@saveshift% - \pstFP@ninesplit\pstFP@rd% - \ifnum\pstFP@res=0\relax% - \pstFP@ninesplit\pstFP@rd% - \ifnum\pstFP@res=0\relax% - \pstFP@ninesplit\pstFP@rd\pstFP@ria=\pstFP@res% - \pstFP@ninesplit\pstFP@rd\pstFP@rib=\pstFP@res% - \pstFP@ninesplit\pstFP@rd\pstFP@rfa=\pstFP@res% - \pstFP@ninesplit\pstFP@rd\pstFP@rfb=\pstFP@res% - \pstFP@store\pstFP@tmp{r}% - \else\typeout{pstFPmul: Overflow}\fi% - \else\typeout{pstFPmul: Overflow}\fi% - \global\let\pstFP@tmp\pstFP@tmp}% - \let#1\pstFP@tmp% -} -% -\catcode`\@=\PstAtCode\relax -% -%% END: pst-fp.tex -\endinput diff --git a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex index e4618d5fbde..0cf76d4e7af 100644 --- a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex +++ b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex @@ -1,4 +1,4 @@ -%% $Id: pstricks-add.tex 154 2009-11-30 07:51:26Z herbert $ +%% $Id: pstricks-add.tex 288 2010-02-11 15:43:29Z herbert $ %% %% %% This is file `pstricks-add.tex', @@ -8,7 +8,7 @@ %% Package `pstricks-add.tex' %% %% Dominique Rodriguez -%% Herbert Voss <herbert _at_ dante.de> +%% Herbert Voss <hvoss@tug.org> %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN archives @@ -28,11 +28,10 @@ \ifx\PSTthreeDLoaded\endinput\else\input pst-3d \fi \ifx\MultidoLoaded\endinput\else \input multido \fi \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi -\ifx\PSTFPloaded\endinput\else \input pst-fp \fi \ifx\PSTmathLoaded\endinput\else \input pst-math \fi % -\def\fileversion{3.36} -\def\filedate{2009/11/14} +\def\fileversion{3.38} +\def\filedate{2009/12/13} \message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)} % \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax @@ -41,146 +40,6 @@ % %% prologue for postcript \pstheader{pstricks-add.pro}% -%\pstheader{pst-math.pro}% for equation solver -%\pstheader{pst-algparser.pro}% now done by pstricks.tex -% -%-------------------------------- 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 -\chardef\f@ur=4 -% -\def\psPiFour{12.566371} -\def\psPiTwo{6.283185} -\def\psPi{3.14159265} -\def\psPiH{1.570796327} -\newdimen\pstRadUnit -\newdimen\pstRadUnitInv -\pstRadUnit=1.047198cm % this is pi/3 -\pstRadUnitInv=0.95493cm % this is 3/pi -% -\def\pst@getdimdim#1 #2 #3\@nil{% - \def\pst@tempA{#2}% - \ifx\pst@tempA\@empty - \pssetlength\pst@dimn{#1}% - \pst@dimm=\z@% - \else% - \pssetlength\pst@dimm{#1}% - \pssetlength\pst@dimn{#2}% - \fi% -} -\def\pst@getxdimdim#1 #2 #3\@nil{% - \def\pst@tempA{#2}% - \ifx\pst@tempA\@empty - \pssetxlength\pst@dimn{#1}% - \pst@dimm=\z@ - \else% - \pssetxlength\pst@dimm{#1}% - \pssetxlength\pst@dimn{#2}% - \fi% -} -\def\pst@getydimdim#1 #2 #3\@nil{% - \def\pst@tempA{#2} - \ifx\pst@tempA\@empty - \pssetylength\pst@dimn{#1} - \pst@dimm=\z@ - \else - \pssetylength\pst@dimm{#1}% - \pssetylength\pst@dimn{#2}% - \fi% -} -% -% stolen from latex.ltx to make it TeX compatible -% -\newcount\psLoopIndex -\def\@fornoop#1\@@#2#3{} -\long\def\@for#1:=#2\do#3{% - \pst@cntm=0% - \expandafter\def\expandafter\@fortmp\expandafter{#2}% - \ifx\@fortmp\@empty \else - \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi} -\long\def\@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else - #5\def#4{#2}\ifx #4\@nnil \else\global\advance\psLoopIndex by \@ne\relax% - #5\@iforloop #3\@@#4{#5}\fi\fi} -\long\def\@iforloop#1,#2\@@#3#4{\global\advance\psLoopIndex by \@ne\relax% - \def#3{#1}\ifx #3\@nnil - \expandafter\@fornoop \else - #4\relax\expandafter\@iforloop\fi#2\@@#3{#4}} -\def\psforeach#1#2#3{% - \begingroup% - \edef\reserved@a{#2}% - \@for#1:=\reserved@a\do{#3}% - \endgroup% -} -\def\psForeach#1#2#3{% - \edef\reserved@a{#2}% - \@for#1:=\reserved@a\do{#3}% -} -% -% 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@mindim#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% -} -\def\pst@int#1{\expandafter\pst@@int#1..\@nil} -\def\pst@@int#1.#2.\@nil{#1} -% -\def\pstFPMul#1#2#3{\pstFP@callc\pstFP@mul#1{#2}{#3}% % #1 := int(#2/#3) - \edef#1{\pst@int{#1}}}% -\def\pstFPDiv#1#2#3{\pstFP@callc\pstFP@div#1{#2}{#3}% % #1 := int(#2/#3) - \edef#1{\pst@int{#1}}}% % \def\psGetSlope(#1,#2)(#3,#4)#5{% 4 values without a dimen! #5 is a macro \pst@dimm=#1pt% @@ -188,6 +47,7 @@ \pst@dimn=#2pt% \advance\pst@dimn by -#4pt \pst@divide{\pst@dimn}{\pst@dimm}#5} +% \def\psGetDistance(#1,#2)(#3,#4)#5{% 4 values without a dimen! #5 is a macro \pst@dimm=#1pt% \advance\pst@dimm by -#3pt% @@ -197,13 +57,6 @@ \edef#5{\strip@pt\pst@dimo} }% %--------------------------------------- small stuff ------------------------------- -\def\use@keep@par{% same as \use@par, but keeps the values - \ifx\pst@par\@empty\else - \expandafter\@psset\pst@par,\@nil -% \def\pst@par{}% - \fi% -} -% \define@boolkey[psset]{pstricks-add}[Pst@]{CMYK}[true]{} \psset[pstricks-add]{CMYK=true} % @@ -219,27 +72,18 @@ \defineTColor{TGreen}{green} \defineTColor{TBlue}{blue} % -\define@key[psset]{pstricks-add}{fsAngle}[137.50775]{\pst@getangle{#1}\pst@fsAngle } -\define@key[psset]{pstricks-add}{fsOrigin}{% - \pst@@getcoor{#1}\edef\pst@fsOrigin{\pst@coor T }} -\psset[pstricks-add]{fsOrigin={0,0},fsAngle=137.50775} -% -\def\psfs@spiral{\pst@fill{\pst@fsOrigin \pst@usecolor\psfillcolor clip newpath -0 .1 500 { dup dup sqrt 4 div 0 360 arc fill \pst@fsAngle rotate } for }} -% -\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){% +\def\rmultiput{\pst@object{rmultiput}} +\def\rmultiput@i#1{% \pst@killglue% - \if@star\rput*(#1){\@rmultiputArg} - \else\rput(#1){\@rmultiputArg}\fi - \@ifnextchar({\rmultiput@iii}{\endgroup}% -} + \begingroup% + \use@par% + \@ifnextchar({\rmultiput@ii{#1}}{\rmultiput@ii{#1}(\z@,\z@)}} +\def\rmultiput@ii#1(#2){% + \if@star\rput*(#2){#1}\else\rput(#2){#1}\fi + \@ifnextchar({\rmultiput@ii{#1}}{\endgroup}} % #1: (x,y) #2: rotAngle #3: object -\def\psrotate{\def\pst@par{}\pst@object{psrotate}} +\def\psrotate{\pst@object{psrotate}} \def\psrotate@i(#1)#2{% \pst@killglue \begingroup% @@ -273,81 +117,11 @@ [#1 0 0 #1 #1 xH mul neg xH add #1 yH mul neg yH add] concat } \tx@TMChange }% \box\pst@hbox% - \pst@Verb{\tx@TMRestore}% + \pst@Verb{ \tx@TMRestore }% \end@SpecialObj} % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% 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]{pstricks-add}{maxdashes}[11]{\def\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{% - \psk@linecap\space setlinecap - \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]{pstricks-add}{intSeparator}{\def\psk@intSeparator{#1}} -%\psset{intSeparator={,}} +\psset{intSeparator={,}} % \def\psFormatInt{\def\pst@par{}\pst@object{psFormatInt}} \def\psFormatInt@i#1{{% @@ -467,13 +241,6 @@ \psset[pstricks-add]{filledveearrowangle=15} % default angle \define@key[psset]{pstricks-add}{filledveearrowlinewidth}[0.35mm]{\pst@getlength{#1}\psk@filledveearrowlinewidth} \psset[pstricks-add]{filledveearrowlinewidth=0.35mm} % default vee arrow line width -\define@key[psset]{pstricks-add}{arrowLW}{\pst@getlength{#1}\psk@arrowLW} -% arrowLW as LineWidth for the circled line ends -% -\def\psas@o{\psk@arrowLW\space dup 0 eq { pop }{ SLW } ifelse - {\pst@usecolor\psfillcolor true} false \psk@dotsize \tx@EndDot } -\@namedef{psas@*}{\psk@arrowLW\space dup 0 eq { pop }{ SLW } ifelse - {\pst@usecolor\psfillcolor false} false \psk@dotsize \tx@EndDot} \pst@def{VeeArrow}<% 1 setlinecap % round caps @@ -586,7 +353,7 @@ \define@key[psset]{pstricks-add}{nArrowsA}[2]{\def\psk@nArrowsA{#1}} \define@key[psset]{pstricks-add}{nArrowsB}[2]{\def\psk@nArrowsB{#1}} \define@key[psset]{pstricks-add}{nArrows}[2]{\def\psk@nArrowsA{#1}\def\psk@nArrowsB{#1}} -%\psset{nArrows=2} +\psset{nArrows=2} % \@namedef{psas@>>}{% \psk@nArrowsA\space 1 sub { @@ -667,16 +434,6 @@ \define@key[psset]{pstricks-add}{ArrowInsidePos}[0.5]{\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 @@ -995,11 +752,9 @@ /VPutPos { { VPutLines } HPutCurve } def }> % -\define@key[psset]{pstricks-add}{dashNo}{\def\psk@dashNo{#1}} -\define@key[psset]{pstricks-add}{linecap}{\def\psk@linecap{#1}} \define@key[psset]{pstricks-add}{randomPoints}[1000]{\def\psk@randomPoints{#1}} \define@boolkey[psset]{pstricks-add}[Pst@]{color}[true]{} -%\psset{randomPoints=1000,color=false} +\psset{randomPoints=1000,color=false} % \def\psRandom{\def\pst@par{}\pst@object{psRandom}}% hv 2004-11-12 \def\psRandom@i{\@ifnextchar({\psRandom@ii}{\psRandom@iii(0,0)(1,1)}} @@ -1079,175 +834,7 @@ \end@OpenObj% } % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%% %%%%%%%%%% -%%%%%%%%%%% 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 }% -} -% -% \psGetNodeCenter defines the PS variable #1.x and #1.y, which can then -% be used by the user. #1 must be a valid node name -\def\psGetNodeCenter#1{ tx@NodeDict begin /N@#1 load GetCenter end % x y on stack in system coor - \pst@number\psyunit div /#1.y ED % /#1.y in user coor - \pst@number\psxunit div /#1.x ED } % /#1.x in user coor -\def\psGetNodeEdge#1{ tx@NodeDict begin /N@#1 load 1 GetEdge end % x y on stack in system coor - \pst@number\psyunit div /#1.y ED % /#1.y in user coor - \pst@number\psxunit div /#1.x ED } % /#1.x in user coor -% -\define@key[psset]{pstricks-add}{lineAngle}[0]{% - \ifdim#1pt=\z@\else\psset{armB=0.5}\fi - \def\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{\def\pst@par{}\pst@object{ncbarr}} -\def\ncbarr@i#1#2{ - \begingroup - \use@par% - \psLNode(#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\psLNode(#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\psLCNode(#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}% -} -% -% -\define@boolkey[psset]{pstricks-add}[Pst@]{trueAngle}[true]{} -%\psset{trueAngle=false} -% -\def\psRelNode{\def\pst@par{}\pst@object{psRelNode}} +\def\psRelNode{\pst@object{psRelNode}} \def\psRelNode@i(#1)(#2)#3#4{{% A - B - factor - node name \use@par \pst@getcoor{#1}\pst@tempA% @@ -1349,30 +936,6 @@ } ifelse ){#5}% } % -\def\psLDNode(#1)(#2)#3#4{% -% #1: node A #2: node B #3: dimen measured from A #4: node name - \pst@getcoor{#1}\pst@tempA% - \pst@getcoor{#2}\pst@tempB% - \pssetlength\pst@dimp{#3}% - \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 - /angle dy dx Atan def - /linelength \pst@number\pst@dimp \pst@number\psunit div def - XA linelength angle cos mul add YA linelength angle sin mul add ){#4}% -} -\def\nlput{\def\pst@par{}\pst@object{nlput}} -\def\nlput@i(#1)(#2)#3#4{% - \begin@SpecialObj - \psLDNode(#1)(#2){#3}{temp@lnput} - \pcline[linestyle=none](#1)(temp@lnput)% - \ncput[npos=1]{#4}% - \end@SpecialObj -}% \define@cmdkeys[psset]{pstricks-add}[PSTPSPNk@]{% Christophe Jorssen 2007 blName,bcName,brName, clName,ccName,crName, @@ -1405,1320 +968,6 @@ \endgroup \ignorespaces} % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%% %%%%%%%%%% -%%%%%%%%%%% pst-plot %%%%%%%%%% -%%%%%%%%%%% %%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -%the following works only for plotstyle line, polygon and bezier -\define@key[psset]{pstricks-add}{yMaxValue}[-1.0]{\def\psk@yMaxValue{#1 }} -\psset{yMaxValue=-1.0} -% can be in PS syntax (eg 1e1.2) and must be positiv! negative values -% will beignored -% -% For quick plots, define: -% \beginqp@<foo> : What to do to first point (PS code only). -% \doqp@<foo> : What to do to subsequent points (PS code only). -% \endqp@<foo> : How to end plot. -% \testqp@<foo> : Set \@psttrue if OK to use quick plot. - -\def\doqp@line{ - \psk@yMaxValue 0 gt - { dup abs - \psk@yMaxValue \pst@number\psyunit mul gt - { moveto }{ L } ifelse } - { L } ifelse -} -\def\doqp@polygon{ - \psk@yMaxValue 0 gt - { dup abs - \psk@yMaxValue \pst@number\psyunit mul gt - { moveto }{ L } ifelse } - { L } ifelse -} -\def\doqp@bezier{/n n 1 add def n 3 mod 0 eq { % we need 3 points - \psk@yMaxValue 0 gt - { dup % last y value - abs \psk@yMaxValue\space \pst@number\psyunit mul gt - { moveto pop pop pop pop }{ curveto } ifelse } - { curveto } ifelse - } if -} -% -% Euclide Algorithm (macro by Jean-Come Charpentier) -% #1 : numerator (number.unit) (e.g. 4.\pi or 3.\ell or 12.a) -% #2 : denominator -\def\psIrFrac#1#2{{% - % extrait le num'erateur et l'unit'e - \ps@extract@unit#1\@nil - % d'enominateur - \pst@cntb=#2\relax - \pst@cntc=\@ne - % test du signe et op'erandes toutes positives - \ifnum\pst@cnta<\z@ - \pst@cntc=-\pst@cntc - \pst@cnta=-\pst@cnta - \fi - \ifnum\pst@cntb<\z@ - \pst@cntc=-\pst@cntc - \pst@cntb=-\pst@cntb - \fi - \ifnum\pst@cntc=\@ne - \def\ps@ir@sign{}% - \else - \def\ps@ir@sign{-}% - \fi - % calcul pgcd - \loop - \pst@cntd=\pst@cnta - \pst@cntc=\pst@cnta - \divide\pst@cntd\pst@cntb - \multiply\pst@cntd\pst@cntb - \advance\pst@cntc-\pst@cntd - \ifnum\pst@cntc>\z@ - \pst@cnta=\pst@cntb - \pst@cntb=\pst@cntc - \repeat - % pgcd dans \ir@r - \pst@cntc=\pst@cntb - \pst@cnta=\ps@ir@num - \pst@cntb=#2\relax - % op'erandes toutes positives - \ifnum\pst@cnta<\z@ - \pst@cnta=-\pst@cnta - \fi - \ifnum\pst@cntb<\z@ - \pst@cntb=-\pst@cntb - \fi - % division par le pgcd - \divide\pst@cnta\pst@cntc - \divide\pst@cntb\pst@cntc - % affichage - \ifnum\pst@cnta=\z@ - 0% - \else\ifnum\pst@cnta=\@ne - \ifnum\pst@cntb=\@ne - \ps@ir@sign\ps@ir@unit% - \else - \frac{\ps@ir@sign\ps@ir@unit}{\the\pst@cntb}% - \fi - \else - \ifnum\pst@cntb=\@ne - \ps@ir@sign\the\pst@cnta\ps@ir@unit% - \else - \frac{\ps@ir@sign\the\pst@cnta\ps@ir@unit}{\the\pst@cntb}% - \fi - \fi\fi -}} -% -\def\ps@extract@unit#1.#2\@nil{% - \pst@cnta=#1\relax - \def\ps@ir@num{#1}% sauvegarde (le pgcd 'ecrase la valeur \ir@a) - \def\ps@ir@unit{#2}% -} -% -\define@key[psset]{pstricks-add}{labelFontSize}[{}]{\def\psk@labelFontSize{#1}}% -\define@boolkey[psset]{pstricks-add}[Pst@]{mathLabel}[true]{% - \ifPst@mathLabel% - \def\pshlabel##1{$\psk@labelFontSize##1$}% - \def\psvlabel##1{$\psk@labelFontSize##1$}% - \else% - \def\pshlabel##1{\psk@labelFontSize##1}% - \def\psvlabel##1{\psk@labelFontSize##1}% - \fi} -%\psset{labelFontSize={},mathLabel} -% -\define@key[psset]{pstricks-add}{decimalSeparator}[.]{\def\psk@decimalSeparator{#1}}% -\define@boolkey[psset]{pstricks-add}[Pst@]{comma}[true]{% - \ifPst@comma\def\psk@decimalSeparator{,}\else\def\psk@decimalSeparator{.}\fi} -\define@boolkey[psset]{pstricks-add}[Pst@]{xAxis}[true]{} -\define@boolkey[psset]{pstricks-add}[Pst@]{yAxis}[true]{} -\define@boolkey[psset]{pstricks-add}[Pst@]{xyAxes}[true]{% - \@nameuse{Pst@xAxis#1}\@nameuse{Pst@yAxis#1}}% -%\psset{decimalSeparator=.}% -% -\define@key[psset]{pstricks-add}{xlabelPos}[b]{\pst@expandafter\psset@@xlabelPos{#1}\@nil} -\define@key[psset]{pstricks-add}{ylabelPos}[l]{\pst@expandafter\psset@@ylabelPos{#1}\@nil} -\def\psset@@xlabelPos#1#2\@nil{% - \ifx#1t - \def\psk@xlabelPos{\tw@}% 2=top - \pst@xticksizeC=\pst@xticksizeB% - \else - \ifx#1a - \def\psk@xlabelPos{\@ne}% 1=axis - \pst@xticksizeC=\z@% - \else - \def\psk@xlabelPos{\z@}% 0=bottom - \pst@xticksizeC=\pst@xticksizeA% - \fi\fi}% -\def\psset@@ylabelPos#1#2\@nil{% - \ifx#1r - \def\psk@ylabelPos{\tw@}% 2=right - \pst@yticksizeC=\pst@yticksizeB% - \else - \ifx#1a - \def\psk@ylabelPos{\@ne}% 1=axis - \pst@yticksizeC=\z@% - \else - \def\psk@ylabelPos{\z@}% 0=left - \pst@yticksizeC=\pst@yticksizeA% - \fi\fi} -%\psset{xlabelPos=b, ylabelPos=l}% -% -\define@key[psset]{pstricks-add}{xyDecimals}[{}]{\def\psk@xDecimals{#1}\def\psk@yDecimals{#1}} -\define@key[psset]{pstricks-add}{xDecimals}[{}]{\def\psk@xDecimals{#1}} -\define@key[psset]{pstricks-add}{yDecimals}[{}]{\def\psk@yDecimals{#1}} -%\psset{xyDecimals={}}% -% -\define@key[psset]{pstricks-add}{xlogBase}[{}]{\def\psk@xlogBase{#1}} -\define@key[psset]{pstricks-add}{ylogBase}[{}]{\def\psk@ylogBase{#1}} -\define@key[psset]{pstricks-add}{xylogBase}[{}]{\def\psk@xlogBase{#1}\def\psk@ylogBase{#1}}% -%\psset{xylogBase={}}% -% -\define@key[psset]{pstricks-add}{trigLabelBase}[0]{\pst@getint{#1}{\psk@trigLabelBase}} -\psset{trigLabelBase=0} -% -\define@boolkey[psset]{pstricks-add}[Pst@]{trigLabels}[true]{% - \ifPst@trigLabels - \def\pst@@@hlabel##1{\pshlabel{##1}} - \def\pshlabel##1{% - \ifnum\psk@trigLabelBase<2 - \def\de@nominator{\@ne}\else\def\de@nominator{\psk@trigLabelBase}\fi - \def\pst@tempA{##1} - \pst@abs{\pst@tempA}\pst@cntm - \pst@mod{\pst@cntm}{\de@nominator}\pst@cntp % cntb=##1 modulo trigLabelBase - \ifnum\@ne>\pst@cntp % 1 > modulo -> then we have pi/x - \pst@cnto=\pst@cntm \divide\pst@cnto by \de@nominator - \ifPst@mathLabel% - $\psk@labelFontSize - \ifnum\pst@tempA<0 -\fi - \ifnum\pst@cnto=\@ne % #1 = trigLabelBase - \pi % print pi - \else - \the\pst@cnto\pi % print \pst@cnto/\de@nominator pi - \fi$% - \else% - \psk@labelFontSize% - \ifnum\pst@tempA<0 -\fi% - \ifnum\pst@cnto=\@ne% % #1 = trigLabelBase - $\pi$% % print pi - \else% - \the\pst@cnto$\pi$% % print \pst@cnto/\de@nominator pi - \fi% - \fi% - \else% - \ifPst@mathLabel% - $\psk@labelFontSize% - \ifnum\pst@cntp=\@ne% % < 1 pi? - \if\pst@cntm=\@ne% - \frac{\pi}{\de@nominator}% % pi/x - \else\ifnum\pst@tempA=-1 \frac{-\pi}{\de@nominator}% - \else \ifnum\pst@tempA=1 \frac{\pi}{\de@nominator}% - \else\frac{\pst@tempA\pi}{\de@nominator}% (x pi)/y - \fi\fi\fi% - \else% - \ifnum\pst@tempA=1 \frac{\pi}{\de@nominator}% - \else\ifnum\pst@tempA=\de@nominator \pi% - \else\frac{\pst@tempA\pi}{\de@nominator}% - \fi\fi\fi$% - \else% - \psk@labelFontSize% - \ifnum\pst@cntp=\@ne% % < 1 pi? - \if\pst@cntm=\@ne% - $\frac{\pi}{\de@nominator}$% % pi/x - \else\ifnum\pst@tempA=-1 $\frac{-\pi}{\de@nominator}$% - \else \ifnum\pst@tempA=1 $\frac{\pi}{\de@nominator}$% - \else$\frac{\pst@tempA\pi}{\de@nominator}$% (x pi)/y - \fi\fi\fi% - \else% - \ifnum\pst@tempA=1 $\frac{\pi}{\de@nominator}$% - \else\ifnum\pst@tempA=\de@nominator $\pi$% - \else$\frac{\pst@tempA\pi}{\de@nominator}$% - \fi\fi\fi% - \fi% - \fi% - }% - \else% - \def\pst@@@hlabel##1{% - \edef\@xyDecimals{\psk@xDecimals}% - \ifnum\psk@ticks<\tw@% ticks=all|x - \ifx\psk@xlogBase\@empty% - \pshlabel{\psk@labelFontSize\expandafter\@LabelComma##1..\@nil\psk@xlabelFactor}% - \else% - \pshlabel{\psk@labelFontSize\psk@xlogBase\textsuperscript{\expandafter\@stripDecimals##1..\@nil}}% - \fi% - \fi% - }% - \ifPst@mathLabel% - \def\pshlabel##1{$\psk@labelFontSize##1$}\else% - \def\pshlabel##1{\psk@labelFontSize##1}% - \fi% - \fi% -}% -\psset{trigLabels=false} -% -%logLines=all|x|y|none (0,1,2,3) -\def\psk@logLines{3} -\define@key[psset]{pstricks-add}{logLines}[none]{\pst@expandafter\psset@@logLines#1\@nil\psk@logLines} -\def\psset@@logLines#1#2\@nil#3{% - \ifx#1a - \let#3\z@ - \Pst@maxxTickstrue\Pst@maxyTickstrue - \set@xticksize{0 4pt}\set@yticksize{0 4pt}% - \def\psk@xsubticksize{1}\def\psk@ysubticksize{1}% - \else - \ifx#1x - \let#3\@ne - \Pst@maxxTickstrue\Pst@maxyTicksfalse - \set@xticksize{0 4pt}\def\psk@xsubticksize{1}% - \else - \ifx#1y - \let#3\tw@ - \Pst@maxyTickstrue\Pst@maxxTicksfalse - \set@yticksize{0 4pt}\def\psk@ysubticksize{1}% - \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]{pstricks-add}{ylabelFactor}[\relax]{\def\psk@ylabelFactor{#1}} -\define@key[psset]{pstricks-add}{xlabelFactor}[\relax]{\def\psk@xlabelFactor{#1}} -\define@boolkey[psset]{pstricks-add}[Pst@]{showOriginTick}[true]{}% -%\psset{xlabelFactor=\relax,ylabelFactor=\relax}% - -%% #1 : optional arguments passed to psline -%% #2 : x value -%% #3 : label -\def\psxTick{\def\pst@par{}\pst@object{psxTick}}% idea by Martin Chicoine -\def\psxTick@i(#1)#2{{ - \pst@killglue - \addbefore@par{arrows=-,linewidth=\psk@xtickwidth\pslinewidth} - \use@par - \psline(#1,\pst@xticksizeB)(#1,\pst@xticksizeA) - \rput[t](! \psk@origin - #1 \pst@number\pslabelsep \pst@number\pst@xticksizeB add - \pst@number\psyunit div neg ){\pshlabel{#2\vphantom{1}}}}\ignorespaces} -% -%% #1 : optional arguments passed to psline -%% #2 : y value -%% #3 : label -\def\psyTick{\def\pst@par{}\pst@object{psyTick}}% idea by Martin Chicoine -\def\psyTick@i(#1)#2{{ - \pst@killglue - \addbefore@par{arrows=-,linewidth=\psk@ytickwidth\pslinewidth} - \use@par - \psline(\pst@yticksizeB,#1)(\pst@yticksizeA,#1) - \rput[r]{0}(! \psk@origin - \pst@number\pst@yticksizeB \pst@number\pslabelsep add - \pst@number\psxunit div neg #1){\psvlabel{#2}}}\ignorespaces} -% -%% #1 integer -%% #2 decimals -%% #3 dot -\def\@stripDecimals#1.#2.#3\@nil{% - \def\pst@dummy{#1}% - \ifx\pst@dummy\@empty\the\@zero\else#1\fi% the integer part -} -% -\def\pst@@@vlabel#1{% - \edef\@xyDecimals{\psk@yDecimals}% -% \psk@yLabel% - \ifodd\psk@ticks% ticks=all||y (0,2) - \else% - \ifx\psk@ylogBase\@empty% -% \ifPst@comma - \psvlabel{\expandafter\@LabelComma#1..\@nil\psk@ylabelFactor}% -% \else\psvlabel{#1\psk@ylabelFactor}\fi% - \else% - \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 - \ifnum\@xyDecimals>\@get@digitcounter\expandafter\@process@digits#2;\fi\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\ifmmode\expandafter\mathord\expandafter{\psk@decimalSeparator}\else\psk@decimalSeparator\fi#1\fi% -% \else\psk@decimalSeparator\fi% - \else% write only \xy@decimals - \ifnum\@xyDecimals>\@zero - \ifmmode\expandafter\mathord\expandafter{\psk@decimalSeparator}\else\psk@decimalSeparator\fi% -% \psk@decimalSeparator - \@Reset@digitcounter - \expandafter\@process@digits#1*; - \fi% - \fi% -} -%% #1 integer -%% #2 decimals -%% #3 dot -\def\@LabelComma#1.#2.#3\@nil{% - \def\pst@tempA{#1}% - \ifx\pst@tempA\@empty\the\@zero\else#1\fi% the integer part - \def\pst@tempA{#2}% - \ifx\pst@tempA\@empty\@writeDecimals{}\else\@writeDecimals{#2}\fi} -% -\def\psxs@none{% - \let\psk@arrowA\@empty% - \let\psk@arrowB\@empty% - \psxs@axes} -% -% -\def\psxs@axes{{% - \ifPst@xAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{}{x}\fi% - \ifPst@yAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{exch}{y}\fi}} -% -\def\psaxes{\def\pst@par{}\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){\@ifnextchar[{\psaxes@v(#1)(#2)(#3)}{\psaxes@vii(#1)(#2)(#3)}}% -\def\psaxes@v(#1)(#2)(#3)[#4]{\@ifnextchar[{\psaxes@vi(#1)(#2)(#3)[#4]}{\psaxes@vi(#1)(#2)(#3)[#4][]}}% -\def\psaxes@vi(#1)(#2)(#3)[#4,#5][#6,#7]{% - \psaxes@vii(#1)(#2)(#3)% - \begingroup% - \use@par% - \uput{\pslabelsep}[#5](#3|#1){#4}\uput{\pslabelsep}[#7](#1|#3){#6}% - \endgroup% - \ignorespaces% -} -% -\def\psaxes@vii(#1,#2)(#3,#4)(#5,#6){% - \pst@killglue% - \begingroup% - \pssetxlength\pst@dimc{#5}% ur-x - \pssetylength\pst@dimd{#6}% ur-y - \ifdim\pst@dimc<\z@\ifdim\pst@dimd<\z@% axes show to left and down - \addbefore@par{xlabelPos=top,ylabelPos=right}\fi\fi% - \setbox\pst@hbox=\hbox\bgroup% - \use@par% now the same with an optional unit=... in par - \pssetxlength\pst@dimg{#1}% o-x - \pssetylength\pst@dimh{#2}% o-y - \pssetxlength\pst@dima{#3}% ll-x - \pssetylength\pst@dimb{#4}% ll-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) -% -% Whole thing will be translated to origin: - \advance\pst@dima by -\pst@dimg% Dist. from ll-x to o-x - \advance\pst@dimb by -\pst@dimh% Dist. from ll-y to o-y - \advance\pst@dimc by -\pst@dimg% Dist. from ur-x to o-x - \advance\pst@dimd by -\pst@dimh% Dist. from ur-y to o-y -% Make lines/arrows or frame: - \@nameuse{psxs@\psk@axesstyle}% \psxs@axes or \psxs@frame or \psxs@polar - \ifPst@yAxis% - \begingroup% - \ifdim\pst@dima=\z@\else\showoriginfalse\fi% - \ifnum\psk@dy=\z@% - \pst@dimg=\psk@Dy\psyunit% - \ifdim\pst@dimg<\p@\pst@cnta=\psk@Dy\edef\psk@Dy{-\the\pst@cnta}\fi% v.1.21 - \edef\psk@dy{\number\pst@dimg}% - \fi% -% \ifPst@xAxis\else\showorigintrue\fi% 2009-10-21 - \pst@vlabels{\pst@dimd}{\psk@arrowB}{#3}{#5}% - \ifPst@xAxis\showoriginfalse\fi% - \pst@vlabels{\pst@dimb}{\psk@arrowA}{#3}{#5}% - \endgroup% - \fi% - \ifPst@xAxis% - \begingroup% - \ifdim\pst@dimb=\z@\else\showoriginfalse\fi% - \ifnum\psk@dx=\z@% - \pst@dimg=\psk@Dx\psxunit% - \ifdim\pst@dimg<\p@\pst@cnta=\psk@Dx\edef\psk@Dx{-\the\pst@cnta}% v.1.21 - \fi% v.1.21 - \edef\psk@dx{\number\pst@dimg}% - \fi% -% \ifPst@yAxis\else\showorigintrue\fi% 2009-10-21 - \pst@hlabels{\pst@dimc}{\psk@arrowB}{#4}{#6}% - \ifPst@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% - \endgroup% - \ignorespaces% -} -% -\newdimen\psk@subticksize\psk@subticksize=\z@ -\newdimen\pst@xticksizeA -\newdimen\pst@xticksizeB -\newdimen\pst@xticksizeC -\newdimen\pst@yticksizeA -\newdimen\pst@yticksizeB -\newdimen\pst@yticksizeC -% -\def\set@xticksize#1{% - \pst@expandafter\pst@getydimdim{#1} {} {}\@nil % y-unit!! - \ifdim\pst@dimm>\pst@dimn % first > second value - \pst@xticksizeA=\the\pst@dimn% - \pst@xticksizeB=\the\pst@dimm% - \else - \pst@xticksizeA=\the\pst@dimm% - \pst@xticksizeB=\the\pst@dimn% first > second value - \fi - \edef\psk@xticksize{\pst@number\pst@xticksizeA \pst@number\pst@xticksizeB}% - \ifnum\psk@xlabelPos<\z@ % top - \pst@xticksizeC=\pst@dimn - \else - \pst@xticksizeC=\pst@dimm% bottom - \fi% -} -\def\set@yticksize#1{% - \pst@expandafter\pst@getxdimdim{#1} {} {}\@nil % x-unit! - \ifdim\pst@dimm>\pst@dimn % first > second value - \pst@yticksizeA=\the\pst@dimn% - \pst@yticksizeB=\the\pst@dimm% - \else - \pst@yticksizeA=\the\pst@dimm% - \pst@yticksizeB=\the\pst@dimn% first > second value - \fi - \edef\psk@yticksize{\pst@number\pst@yticksizeA \pst@number\pst@yticksizeB}% - \ifnum\psk@ylabelPos<\z@ % right - \pst@yticksizeC=\pst@dimn - \else - \pst@yticksizeC=\pst@dimo% left - \fi% -} -\newif\ifPst@maxxTicks -\newif\ifPst@maxyTicks -\define@key[psset]{}{ticksize}{% - \psDEBUG[key:ticksize]{setting ticksize} - \def\pst@tempA{max}% - \def\pst@tempB{#1}% - \ifx\pst@tempA\pst@tempB - \psDEBUG[key:ticksize]{setting ticksize to max} - \Pst@maxxTickstrue\Pst@maxyTickstrue - \set@xticksize{0 4pt}\set@yticksize{0 4pt}% - \else - \psDEBUG[key:ticksize]{setting ticksize to user values} - \Pst@maxxTicksfalse\Pst@maxyTicksfalse% - \set@xticksize{#1}\set@yticksize{#1}% - \fi} -\define@key[psset]{pstricks-add}{xticksize}{% - \def\pst@tempA{max}% - \def\pst@tempB{#1}% - \ifx\pst@tempA\pst@tempB - \Pst@maxxTickstrue\set@xticksize{0 4pt}% - \psDEBUG[key:xticksize]{setting ticksize to max} - \else\set@xticksize{#1}\Pst@maxxTicksfalse\fi} -\define@key[psset]{pstricks-add}{yticksize}{% - \def\pst@tempA{max}% - \def\pst@tempB{#1}% - \ifx\pst@tempA\pst@tempB - \psDEBUG[key:yticksize]{setting ticksize to max} - \Pst@maxyTickstrue\set@yticksize{0 4pt}% - \else\set@yticksize{#1}\Pst@maxyTicksfalse\fi}% overwrites the definition in pstricks -%\psset{ticksize=-4pt 4pt} -% -% full= 0, top=1, bottom=-1, inner=2 => -1 0 1 2 -\def\psset@tickstyle#1{\pst@expandafter\psset@@tickstyle{#1}\@nil}% overwrite it -\def\psset@@tickstyle#1#2\@nil{% - \ifx#1f\let\psk@tickstyle\z@\else % full - \ifx#1t\let\psk@tickstyle\@ne % top - \edef\psk@xticksize{0 \pst@number\pst@xticksizeB}% - \edef\psk@yticksize{0 \pst@number\pst@yticksizeB}% - \else\ifx#1b\let\psk@tickstyle\m@ne % bottom - \edef\psk@xticksize{\pst@number\pst@xticksizeA 0}% - \edef\psk@yticksize{\pst@number\pst@yticksizeA 0}% - \else\ifx#1i\let\psk@tickstyle\tw@% % inner (for frame) - \else\@pstrickserr{Bad tick style: `#1#2'}\@ehpa - \fi\fi\fi\fi -} -% -\define@key[psset]{pstricks-add}{subticks}[1]{\def\psk@xsubticks{#1}\def\psk@ysubticks{#1}} -\define@key[psset]{pstricks-add}{xsubticks}[1]{\def\psk@xsubticks{#1}} -\define@key[psset]{pstricks-add}{ysubticks}[1]{\def\psk@ysubticks{#1}} -% -\define@key[psset]{pstricks-add}{subticksize}[0.75]{\def\psk@xsubticksize{#1}\def\psk@ysubticksize{#1}} -\define@key[psset]{pstricks-add}{xsubticksize}[0.75]{\def\psk@xsubticksize{#1}} -\define@key[psset]{pstricks-add}{ysubticksize}[0.75]{\def\psk@ysubticksize{#1}} -% -\define@key[psset]{pstricks-add}{tickwidth}[0.5\pslinewidth]{% - \pst@getlength{#1}\psk@xtickwidth% - \pst@getlength{#1}\psk@ytickwidth} -\define@key[psset]{pstricks-add}{xtickwidth}[0.5\pslinewidth]{\pst@getlength{#1}\psk@xtickwidth} -\define@key[psset]{pstricks-add}{ytickwidth}[0.5\pslinewidth]{\pst@getlength{#1}\psk@ytickwidth} -\define@key[psset]{pstricks-add}{subtickwidth}[0.25\pslinewidth]{% - \pst@getlength{#1}\psk@xsubtickwidth% - \pst@getlength{#1}\psk@ysubtickwidth} -\define@key[psset]{pstricks-add}{xsubtickwidth}[0.25\pslinewidth]{\pst@getlength{#1}\psk@xsubtickwidth} -\define@key[psset]{pstricks-add}{ysubtickwidth}[0.25\pslinewidth]{\pst@getlength{#1}\psk@ysubtickwidth} -% -\define@key[psset]{pstricks-add}{tickcolor}[black]{% - \pst@getcolor{#1}\psk@xtickcolor% - \pst@getcolor{#1}\psk@ytickcolor} -\define@key[psset]{pstricks-add}{xtickcolor}[black]{\pst@getcolor{#1}\psk@xtickcolor} -\define@key[psset]{pstricks-add}{ytickcolor}[black]{\pst@getcolor{#1}\psk@ytickcolor} -\define@key[psset]{pstricks-add}{subtickcolor}[gray]{% - \pst@getcolor{#1}\psk@xsubtickcolor% - \pst@getcolor{#1}\psk@ysubtickcolor} -\define@key[psset]{pstricks-add}{xsubtickcolor}[gray]{\pst@getcolor{#1}\psk@xsubtickcolor} -\define@key[psset]{pstricks-add}{ysubtickcolor}[gray]{\pst@getcolor{#1}\psk@ysubtickcolor} -% -\define@key[psset]{pstricks-add}{xticklinestyle}[solid]{% - \@ifundefined{psls@#1}% - {\@pstrickserr{Line style `#1' not defined}\@eha}% - {\def\psxticklinestyle{#1}}} -\define@key[psset]{pstricks-add}{xsubticklinestyle}[solid]{% - \@ifundefined{psls@#1}% - {\@pstrickserr{Line style `#1' not defined}\@eha}% - {\def\psxsubticklinestyle{#1}}} -\define@key[psset]{pstricks-add}{yticklinestyle}[solid]{% - \@ifundefined{psls@#1}% - {\@pstrickserr{Line style `#1' not defined}\@eha}% - {\def\psyticklinestyle{#1}}} -\define@key[psset]{pstricks-add}{ysubticklinestyle}[solid]{% - \@ifundefined{psls@#1}% - {\@pstrickserr{Line style `#1' not defined}\@eha}% - {\def\psysubticklinestyle{#1}}} -\define@key[psset]{pstricks-add}{ticklinestyle}[solid]{% - \@ifundefined{psls@#1}% - {\@pstrickserr{Line style `#1' not defined}\@eha}% - {\def\psxticklinestyle{#1}\def\psyticklinestyle{#1}}} -\define@key[psset]{pstricks-add}{subticklinestyle}[solid]{% - \@ifundefined{psls@#1}% - {\@pstrickserr{Line style `#1' not defined}\@eha}% - {\def\psxsubticklinestyle{#1}\def\psysubticklinestyle{#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#6{% llx,lly,urx,ury,exch,x|y,arrowA,arrowB - \pst@killglue% - \begin@SpecialObj% - \ifx#6x\relax% % x-axis? - \is@yAxisfalse% - \ifnum\psk@dx=\z@% - \pst@dimg=\psk@Dx\psxunit% - \def\psk@dx{\number\pst@dimg}% - \fi% - \else% - \is@yAxistrue% - \ifnum\psk@dy=\z@% - \pst@dimg=\psk@Dy\psyunit% - \def\psk@dy{\number\pst@dimg}% - \fi% - \fi% - \let\pst@linetype\pst@arrowtype% - \def\pst@tempA{none}% - \pst@addarrowdef% - \addto@pscode{ - /showOrigin \ifPst@showOriginTick true \else false \fi def % ticks for 0/0 ? - \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 abs % added abs 2006-07-07 - 65536 div viceversa { neg } if def % div to get pt instead of sp - /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 stroke} def - /subLSstroke { % set sublinestyle and stroke - \ifis@yAxis\@nameuse{psls@\psysubticklinestyle} - \else\@nameuse{psls@\psxsubticklinestyle}\fi stroke} def -%\iffalse -% start ticks --------------------------------------------------------- -% showOrigin { 0 }{ dT } ifelse - 0 dT MaxValue 1 add { % 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? - \ifis@yAxis - \ifPst@maxyTicks true \else false \fi - \else - \ifPst@maxxTicks true \else false \fi - \fi - { x minTickline #5 moveto - x maxTickline #5 lineto } - { x tickstart STsize mul #5 moveto - x tickend STsize mul #5 lineto } ifelse - } 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 % end logLines - 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? - \ifis@yAxis - \ifPst@maxyTicks true \else false \fi - \else - \ifPst@maxxTicks true \else false \fi - \fi - { cntsubTick minTickline STsize mul #5 moveto - cntsubTick maxTickline STsize mul #5 lineto } - { cntsubTick tickstart STsize mul #5 moveto - cntsubTick tickend STsize mul #5 lineto } ifelse - }{ 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 - showOrigin { - gsave - \ifis@yAxis - \ifPst@maxyTicks true \else false \fi - \else - \ifPst@maxxTicks true \else false \fi - \fi - { cntTick minTickline #5 moveto - cntTick maxTickline #5 lineto } - { cntTick tickstart #5 moveto % line begin main Tick - cntTick tickend #5 lineto } ifelse % lineto tick end - Twidth SLW TColor % set line width and tick color - LSstroke - grestore - }{ /showOrigin true def } ifelse % only for the very first tick valid - } for -% end ticks ---------------------------------------------------------- -%\fi -%\iffalse -% ================================================ % the other side - /showOrigin \ifPst@showOriginTick true \else false \fi def % ticks for 0/0 ? - /dT dT neg def % the other side of the axis - /dsubT dsubT neg def -% start ticks ---------------------------------------------------------- -% showOrigin { 0 }{ dT } ifelse - 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? - \ifis@yAxis - \ifPst@maxyTicks true \else false \fi - \else - \ifPst@maxxTicks true \else false \fi - \fi - { x minTickline #5 moveto - x maxTickline #5 lineto } - { x tickstart STsize mul #5 moveto - x tickend STsize mul #5 lineto } ifelse - } if - } for - /dsubT 0 def - subTwidth SLW subTColor % set line width and subtick color - subLSstroke - grestore - } % end loglines - 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 moveto - cntsubTick tickend STsize mul #5 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 - showOrigin { - gsave - cntTick tickstart #5 moveto % line begin main Tick - cntTick tickend #5 lineto % lineto tick end - Twidth SLW TColor % set line width and tick color - LSstroke - grestore - }{ /showOrigin true def } ifelse % only for the very first tick valid - } for -% end ticks ---------------------------------------------------------- -%\fi - } if% - }% end of \pscode - \end@SpecialObj% - \ignorespaces% -}% -% -% -\def\psxs@frame{% - \begin@SpecialObj% - \addto@pscode{ % the frame - \pst@number\pst@dima \pst@number\pst@dimb moveto % lower left - \pst@number\pst@dimc \pst@number\pst@dimb L % upper left - \pst@number\pst@dimc \pst@number\pst@dimd L % upper right - \pst@number\pst@dima \pst@number\pst@dimd L % lower right - closepath - }% - \pst@stroke% - \psk@fillstyle% - \end@SpecialObj% - \let\psk@arrowA\@empty% - \let\psk@arrowB\@empty% - \pst@xticksizeC=\z@\pst@yticksizeC=\z@% - \psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{}{x}% x axis - \psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{ exch }{y}% y axis - \ifnum\psk@tickstyle=\tw@ % llx,lly,urx,ury,exch,x|y,arrowA,arrowB - \psDEBUG[psxs@frame]{psk@tickstyle=2 (inner)}% - \psDEBUG[psxs@frame]{pst@dima=\pst@number\pst@dima}% - \psDEBUG[psxs@frame]{pst@dimb=\pst@number\pst@dimb}% - \psDEBUG[psxs@frame]{pst@dimc=\pst@number\pst@dimc}% - \psDEBUG[psxs@frame]{pst@dimd=\pst@number\pst@dimd}% - \psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{ neg \pst@number\pst@dimd add }{x}% % upper x axis - \psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{ neg \pst@number\pst@dimc add exch }{y}% right y axis - \fi% -} -% -\def\psxs@polar{% (rx,ry) % all other values are ignored - \pst@killglue - \begingroup - \edef\pst@dimC{\strip@pt\pst@dimc}% RadiusX - \pstFPDiv\pstR@dius{\pst@dimC}{\strip@pt\psxunit}% in cm and as int - \addbefore@par{Dy=30}% for the angle step - \use@keep@par - \pstFPDiv\pstN@lpha{360}{\psk@Dy}% No of (int) main lines - \pstFPdiv\pstd@lpha{\psk@Dy}{\psk@ysubticks}% sub dAlpha - \pstFPdiv\pstdR@dius{1}{\psk@xsubticks}% sub dRadius - \pst@cntm=\psk@xsubticks\advance\pst@cntm by \m@ne - \multido{\iA=\psk@Dx+\psk@Dx,\rB=\pstdR@dius+\psk@Dx,\iB=0+1}{\pstR@dius}{% - \multido{\rA=\rB+\pstdR@dius}{\the\pst@cntm}{\pscircle[linestyle=\psxsubticklinestyle, - linecolor=\psk@xsubtickcolor,linewidth=\psk@xsubtickwidth pt]{\rA}} - \pscircle[linestyle=\psxticklinestyle,linecolor=\psk@xtickcolor, - linewidth=\psk@xtickwidth pt]{\iA}% - \uput[-45](\iB,0){\pshlabel{\iB}}\uput[45](0,\iB){\pshlabel{\iB}}% - }% -% \uput[-45](\pstR@dius,0){\pstR@dius}\uput[45](0,\pstR@dius){\pstR@dius}% - \pst@cntm=\psk@ysubticks\advance\pst@cntm by \m@ne - \multido{\iA=\psk@Dy+\psk@Dy,\rB=\pstd@lpha+\psk@Dy}{\pstN@lpha}{% - \multido{\rA=\rB+\pstd@lpha}{\the\pst@cntm}{\psline[linestyle=\psysubticklinestyle, - linecolor=\psk@ysubtickcolor,linewidth=\psk@ysubtickwidth pt](\pstR@dius;\rA)} - \psline[linestyle=\psyticklinestyle, - linecolor=\psk@ytickcolor,linewidth=\psk@ytickwidth pt](\pstR@dius;\iA)% - \uput[\iA](\pstR@dius;\iA){\psvlabel{\iA}}} - \endgroup\ignorespaces% - \Pst@xAxisfalse\Pst@yAxisfalse% -} - -% #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@yAxis\else\showorigintrue\fi% - \ifnum\psk@labels<\tw@\ifPst@xAxis\pst@@hlabels\fi\fi% - \showoriginfalse% - \fi% - \fi% -} -% Knows \pst@dimb and \pst@cnta -\def\pst@@hlabels{% - \psDEBUG[pst@@hlabels]{xticksizeC=\the\pst@xticksizeC}% - \setbox\z@=\vbox{% save all in a box - \ifcase\psk@xlabelPos - \vskip-\pst@xticksizeA\vskip\pslabelsep\or - \vskip-1ex\vskip-\pslabelsep\or - \vskip-\pst@xticksizeB\vskip-\pslabelsep\vskip-1ex - \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{\nA=\psk@Ox+\psk@Dx}{\pst@cnta}{% - \hskip\pst@dimb\hbox to \z@{\hss% - \ifdim\nA pt=\z@ \pst@@@hlabel{0}% - \else\expandafter\pst@@@hlabel{\nA}% - \fi% prevent -0, doesn't work with \ifnum - \hss}% - }\hss% - }% - }\ht\z@\z@ \dp\z@\z@ \box\z@}% set all values to zero -% -% #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@xAxis\else\showorigintrue\fi% - \ifodd\number\psk@labels\else\ifPst@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 -% \pst@ticksizeC the lowest or highest value -\def\pst@@vlabels{% - \psDEBUG[pst@@vlabels]{yticksizeC=\the\pst@yticksizeC}% -% for left labels we use \def\llap#1{\hb@xt@\z@{\hss#1}} - \vbox to\z@{% - \ifnum\pst@cnta>\z@ \pst@dima=-\pst@dima\fi% up or down label positions - \offinterlineskip% - \ifshoworigin% - \vbox to \z@{\vss\hbox to\z@{% - \ifcase\psk@ylabelPos% - \hss\pst@@@vlabel{\psk@Oy}\hskip\pslabelsep\hskip-\pst@yticksizeA\or% - \hskip\pslabelsep\hss\pst@@@vlabel{\psk@Oy}\hss\or % right labels - \hskip\pst@yticksizeB\hskip\pslabelsep\pst@@@vlabel{\psk@Oy}% - \fi}\vss}% - \fi% - \mmultido{\nA=\psk@Oy+\psk@Dy}{\pst@cnta}{% - \vbox to\pst@dima{\vss}% - \vbox to \z@{% - \vss\hbox to\z@{% - \ifcase\psk@ylabelPos% and also check for -0 - \hss\ifdim\nA pt=\z@ \pst@@@vlabel{0}\else\pst@@@vlabel{\nA}\fi% - \hskip\pslabelsep\hskip-\pst@yticksizeA\or% top - \hss\ifdim\nA pt=\z@\pst@@@vlabel{0}\else\pst@@@vlabel{\nA}\fi% - \ifdim\pslabelsep=\z@\hss\else\kern-\pslabelsep\fi\or% axis - \hskip\pst@yticksizeB\hskip\pslabelsep% - \ifdim\nA pt=\z@\pst@@@vlabel{0}\else\pst@@@vlabel{\nA}\fi% bottom - \fi}\vss}% - }\vss}% -} -% -\define@key[psset]{pstricks-add}{nStep}[1]{\def\psk@nStep{#1}} -\define@key[psset]{pstricks-add}{nStart}[0]{\def\psk@nStart{#1}} -\define@key[psset]{pstricks-add}{nEnd}[{}]{\def\psk@nEnd{#1}} -\define@key[psset]{pstricks-add}{xStep}[0]{\def\psk@xStep{#1}} -\define@key[psset]{pstricks-add}{yStep}[0]{\def\psk@yStep{#1}} -% -\define@key[psset]{pstricks-add}{xStart}[{}]{\def\psk@xStart{#1}} -\define@key[psset]{pstricks-add}{xEnd}[{}]{\def\psk@xEnd{#1}} -\define@key[psset]{pstricks-add}{yStart}[{}]{\def\psk@yStart{#1}} -\define@key[psset]{pstricks-add}{yEnd}[{}]{\def\psk@yEnd{#1}} -% -\define@key[psset]{pstricks-add}{plotNo}[1]{\def\psk@plotNo{#1}} -\define@key[psset]{pstricks-add}{plotNoMax}[1]{\def\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 - \def\pstXScale{#1 }% - \def\pstYScale{#2 }% - \def\pstXPSScale{#3 }% - \def\pstYPSScale{#4 }% - \pst@def{ScalePoints}<% - /y ED /x ED - /yPSOp { #4 y mul #2 mul } def - /xPSOp { #3 x mul #1 mul } def - counttomark dup dup cvi eq not { exch pop } if - /m exch def /n m 2 div cvi def - n { - yPSOp m 1 roll xPSOp 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}% -} -% -\define@boolkey[psset]{pstricks-add}[Psk@]{xyValues}[true]{} -\psset[pstricks-add]{xyValues} -% -\define@boolkey[psset]{pstricks-add}[Pst@]{ChangeOrder}[true]{} -% -\pst@def{PreparePoints}<{% - counttomark /m exch def - \ifPsk@xyValues\else % we have only y values - /mm m def - /M m 1 add def - m { mm exch M 2 roll /M M 1 add def /mm mm 1 sub def } repeat - /m m dup add def - \fi - \ifPst@ChangeOrder - /m0 m def - m \psk@plotNoMax\space 1 add div 1 sub cvi { - m0 \psk@plotNoMax\space 1 add roll /m0 m0 \psk@plotNoMax\space 1 add sub def - } repeat - \fi - /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 1 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 { -% 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]{pstricks-add}{xAxisLabel}[x]{\def\psk@xAxisLabel{#1}} -\define@key[psset]{pstricks-add}{yAxisLabel}[y]{\def\psk@yAxisLabel{#1}} -%\psset{xAxisLabel=x,yAxisLabel=y} -\iffalse -\define@key[psset]{pstricks-add}{xAxisLabelPos}{% - \def\pst@tempA{#1}% - \ifx\pst@tempA\@empty\let\psk@xAxisLabelPos\relax\else% - \pst@getcoor{#1}\psk@xAxisLabelPos\fi} -\define@key[psset]{pstricks-add}{yAxisLabelPos}{% - \def\pst@tempA{#1}% - \ifx\pst@tempA\@empty\let\psk@yAxisLabelPos\relax\else% - \pst@getcoor{#1}\psk@yAxisLabelPos\fi} -\fi -\define@key[psset]{pstricks-add}{xAxisLabelPos}[{}]{\def\psk@xAxisLabelPos{#1}} -\define@key[psset]{pstricks-add}{yAxisLabelPos}[{}]{\def\psk@yAxisLabelPos{#1}} - -%\psset{yAxisLabelPos={},xAxisLabelPos={}} -% -\newdimen\psk@llx -\newdimen\psk@lly -\newdimen\psk@urx -\newdimen\psk@ury -\define@key[psset]{pstricks-add}{llx}[\z@]{\pssetxlength\psk@llx{#1}} -\define@key[psset]{pstricks-add}{lly}[\z@]{\pssetylength\psk@lly{#1}} -\define@key[psset]{pstricks-add}{urx}[\z@]{\pssetxlength\psk@urx{#1}} -\define@key[psset]{pstricks-add}{ury}[\z@]{\pssetylength\psk@ury{#1}} -%\psset{llx=\z@, lly=\z@, urx=\z@, ury=\z@}% prevents rounding errors -\newif\ifPst@plot@box -\define@key[psset]{pstricks-add}{box}[true]{\@nameuse{Pst@plot@box#1}} -% -\newdimen\pst@xunit -\newdimen\pst@yunit -% -\def\psgraph{\def\pst@par{}\pst@object{psgraph}} -\def\psgraph@i{\pst@getarrows\psgraph@ii} -\def\psgraph@ii(#1,#2){\catcode`\!=12\relax - \@ifnextchar({\psgraph@iii(#1,#2)}{\psgraph@iv(0,0)(#1,#2)}} -\def\psgraph@iii(#1,#2)(#3,#4){\@ifnextchar({\psgraph@v(#1,#2)(#3,#4)}{\psgraph@iv(#1,#2)(#3,#4)}} -% -\def\psgraph@iv(#1,#2)(#3,#4)#5#6{% no special origin defined -% minX | minY | maxX | maxY | Length x-axis | length y-axis% - \pst@killglue% - \begingroup% - \pst@dimo=#3\p@ \pst@dimp=#1\p@ \multiply\pst@dimp by \m@ne% - \advance\pst@dimo by \pst@dimp% delta x - \pst@dimm=#5% - \pstFPdiv\pst@@dx{\strip@pt\pst@dimm}{\strip@pt\pst@dimo}% - \pst@xunit=\pst@@dx\p@ -% - \pst@dimo=#4\p@ \pst@dimp=#2\p@ \multiply\pst@dimp by \m@ne% - \advance\pst@dimo by \pst@dimp% delta y - \ifx!#6\pst@dimm=\pst@@dx\pst@dimo\else\pst@dimm=#6\fi% - \pstFPdiv\pst@@dy{\strip@pt\pst@dimm}{\strip@pt\pst@dimo}% - \pst@yunit=\pst@@dy\p@% - % - \pst@dimm=#1\pst@xunit% - \advance\pst@dimm by \psk@llx% - \pst@dimn=#2\pst@yunit% - \advance\pst@dimn by \psk@lly% - \pst@dimo=#3\pst@xunit% - \advance\pst@dimo by \psk@urx% - \pst@dimp=#4\pst@yunit% - \advance\pst@dimp by \psk@ury% - \if@star\pspicture*(\pst@dimm,\pst@dimn)(\pst@dimo,\pst@dimp)\else% - \pspicture(\pst@dimm,\pst@dimn)(\pst@dimo,\pst@dimp)\fi% - \psset{xunit=\pst@xunit,yunit=\pst@yunit}% - \bgroup% - \use@par% - \psaxes(#1,#2)(#3,#4)% - \egroup% - \psgraph@vi(#1,#2)(#1,#2)(#3,#4)% -} -\def\psgraph@v(#1,#2)(#3,#4)(#5,#6)#7#8{% with special origin -% Xorig | yorig | minX | minY | maxX | maxY | Length x-axis | length y-axis% - \pst@killglue% - \begingroup% - \pst@dimo=#5\p@ \pst@dimp=#3\p@ \multiply\pst@dimp by \m@ne% - \advance\pst@dimo by \pst@dimp% delta x - \pst@dimm=#7% - \pstFPdiv\pst@@dx{\strip@pt\pst@dimm}{\strip@pt\pst@dimo}% - \pst@xunit=\pst@@dx\p@% -% - \pst@dimo=#6\p@\pst@dimp=#4\p@\multiply\pst@dimp by \m@ne% - \advance\pst@dimo by \pst@dimp% delta y - \ifx!#8\pst@dimm=\pst@@dx\pst@dimo\else\pst@dimm=#8\fi% - \pstFPdiv\pst@@dy{\strip@pt\pst@dimm}{\strip@pt\pst@dimo}% - \pst@yunit=\pst@@dy\p@ - % - \pst@dima=#3\pst@xunit \advance\pst@dima by \psk@llx% - \pst@dimb=#4\pst@yunit \advance\pst@dimb by \psk@lly% - \pst@dimc=#5\pst@xunit \advance\pst@dimc by \psk@urx% - \pst@dimd=#6\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}% - \bgroup% - \use@par% - \psaxes(#1,#2)(#3,#4)(#5,#6)% - \egroup% - \psgraph@vi(#1,#2)(#3,#4)(#5,#6)% -} -% -\def\setxLabelC@@r#1,#2(#3,#4)(#5){% - \pst@getcoor{#5}\pst@tempB% - \ifx c#1 - \pssetylength\pst@dimm{#2}% - \rput(! #4 #3 add 2 div \pst@number\pst@dimm \pst@tempB\space exch pop add - \pst@number\psyunit div ){\psk@xAxisLabel}% - \else% - \pst@getcoor{\psk@xAxisLabelPos}\pst@tempA% - \rput(! \pst@tempA\space \pst@tempB\space exch pop add \tx@UserCoor ){\psk@xAxisLabel}% - \fi} -\def\setyLabelC@@r#1,#2(#3,#4)(#5){% - \pst@getcoor{#5}\pst@tempB% - \ifx c#2 - \pssetxlength\pst@dimm{#1}% - \rput{90}(! \pst@number\pst@dimm \pst@tempB\space pop add \pst@number\psxunit div #4 #3 add 2 div ){\psk@yAxisLabel}% - \else% - \pst@getcoor{\psk@yAxisLabelPos}\pst@tempA% - \rput{90}(! \pst@tempB\space pop \pst@tempA\space 3 1 roll add exch \tx@UserCoor ){\psk@yAxisLabel}% - \fi -} -% -\def\psgraph@vi(#1,#2)(#3,#4)(#5,#6){% - \ifx\psk@xAxisLabel\@empty\else% - \ifx\psk@xAxisLabelPos\@empty\uput[0](#5,#2){\psk@xAxisLabel}% - \else \expandafter\setxLabelC@@r\psk@xAxisLabelPos(#3,#5)(#1,#2)\fi% - \fi% - \ifx\psk@yAxisLabel\@empty\else% - \ifx\psk@yAxisLabelPos\@empty\uput[90](#1,#6){\psk@yAxisLabel}% - \else\expandafter\setyLabelC@@r\psk@yAxisLabelPos(#4,#6)(#1,#2)\fi% - \fi% - \ignorespaces% -} -\def\endpsgraph{% - \pst@killglue% - \endpspicture% - \endgroup% -} -\@namedef{psgraph*}{\psgraph*} -\@namedef{endpsgraph*}{\endpsgraph} -% -\define@key[psset]{pstricks-add}{ignoreLines}{\def\psk@ignoreLines{#1}} - -\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 - \def\pst@tempg{}% - \ifeof1 - \@pstrickserr{Data file `#3' not found.}\@ehpa - \else - \pst@datadelimiters - \catcode`\[=1 - \catcode`\]=2 - \pst@cnta=0 - \loop \ifnum\the\pst@cnta<\psk@ignoreLines - \advance\pst@cnta by 1\relax - \read1 to \pst@tempA - \repeat - \ifnum\Pst@Debug>0 \typeout{>>> ignored \the\pst@cnta\space data lines}\fi% - \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 -\define@boolkey[psset]{pstricks-add}[Pst@]{polarplot}[true]{} -\define@boolkey[psset]{pstricks-add}[Pst@]{algebraic}[true]{} -\psset[pstricks-add]{polarplot=false,algebraic=false}% remark of ML -% \define@key[psset]{pstricks-add}{method}{\def\psk@method{#1}}% adams - rk4 \define@key[psset]{pstricks-add}{whichabs}{\def\psk@whichabs{#1}}% \define@key[psset]{pstricks-add}{whichord}{\def\psk@whichord{#1}}% @@ -2730,357 +979,10 @@ \def\@adams{adams}% Adams method \def\@default{default}% Adams method % -\define@boolkey[psset]{pstricks-add}[Pst@]{VarStep}[true]{} -\define@key[psset]{pstricks-add}{PlotDerivative}{\def\psk@PlotDerivative{#1}}% -\define@key[psset]{pstricks-add}{VarStepEpsilon}{\def\psk@VarStepEpsilon{#1}}% -\define@key[psset]{pstricks-add}{varsteptol}{\def\psk@varsteptol{#1}}% adams - rk4 -\define@key[psset]{pstricks-add}{adamsorder}{\def\psk@adamsorder{#1}}% adams - rk4 +\define@key[psset]{pstricks-add}{varsteptol}{\def\psk@varsteptol{#1}}% +\define@key[psset]{pstricks-add}{adamsorder}{\def\psk@adamsorder{#1}}% %\define@key[psset]{pstricks-add}{varstepincrease}{\def\psk@varstepincrease{#1}}% varrk4 % -\def\psplot@i#1#2{\@ifnextchar[{\psplot@I{#1}{#2}}{\psplot@I{#1}{#2}[]}} -\def\psplot@I#1#2[#3]#4{% - \pst@killglue% - \begingroup% - \use@par% - \@nameuse{beginplot@\psplotstyle}% -% D.G. modification begin - Jun. 9, 1998 - \ifPst@polarplot% - \addto@pscode{ - \psplot@init - #3 - /x #1 def - /x1 #2 def - /dx x1 x sub \psk@plotpoints div def - /F@pstplot \ifPst@algebraic (#4) - \ifx\psk@PlotDerivative\@none\else - \psk@PlotDerivative\space { (x) tx@Derive begin Derive end } repeat - \fi\space - tx@AlgToPs begin AlgToPs end cvx - \else { #4 } \fi def - \ifPst@VarStep - /StillZero 0 def /LastNonZeroStep dx def - /F2@pstplot tx@Derive begin (#4) (x) Derive (x) Derive end - \ifx\psk@PlotDerivative\@none\else - \psk@PlotDerivative\space { (x) tx@Derive begin Derive end } repeat - \fi\space - tx@AlgToPs begin AlgToPs end cvx def - %% computation of the tolerance defined by plotpoints - /epsilon12 \ifx\psk@VarStepEpsilon\@default tx@Derive begin F2@pstplot end dx 3 exp abs mul abs - \else\psk@VarStepEpsilon\space 12 mul \fi def - /ComputeStep { - dup 1e-4 lt - { pop StillZero 2 ge { LastNonZeroStep 2 mul } { LastNonZeroStep } ifelse /StillZero StillZero 1 add def } - { epsilon12 exch div 1 3 div exp /StillZero 0 def } - ifelse } bind def - \fi - /xy {% Adapted from \parametricplot@i - F@pstplot x \ifPst@algebraic RadtoDeg \fi PtoC -% #4 dup x cos mul exch x sin mul - \pst@number\psyunit mul exch - \pst@number\psxunit mul exch - } def}% - \else% polarplot -% D.G. modification end - \addto@pscode{ - \psplot@init - #3 - /x #1 def - /x1 #2 def - /dx x1 x sub \psk@plotpoints div def - /F@pstplot \ifPst@algebraic (#4) - \ifx\psk@PlotDerivative\@none\else - \psk@PlotDerivative\space { (x) tx@Derive begin Derive end } repeat - \fi\space - tx@AlgToPs begin AlgToPs end cvx - \else { #4 } \fi def - \ifPst@VarStep - /StillZero 0 def /LastNonZeroStep dx def - /F2@pstplot tx@Derive begin (#4) (x) Derive (x) Derive end - \ifx\psk@PlotDerivative\@none\else - \psk@PlotDerivative\space { (x) tx@Derive begin Derive end } repeat - \fi\space - tx@AlgToPs begin AlgToPs end cvx def - %% computation of the tolerance defined by plotpoints - /epsilon12 \ifx\psk@VarStepEpsilon\@default tx@Derive begin F2@pstplot end dx 3 exp abs mul abs - \else\psk@VarStepEpsilon\space 12 mul \fi def - /ComputeStep { - dup 1e-4 lt - { pop StillZero 2 ge { LastNonZeroStep 2 mul } { LastNonZeroStep } ifelse /StillZero StillZero 1 add def } - { epsilon12 exch div 1 3 div exp /StillZero 0 def } - ifelse } bind def - \fi - /xy { - x \pst@number\psxunit mul F@pstplot \pst@number\psyunit mul -% \ifPst@algebraic F@pstplot \else #4 \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{% - \ifPst@VarStep% - \addto@pscode{% - mark xy \@nameuse{beginqp@\psplotstyle} - { F2@pstplot abs ComputeStep - x 2 copy add dup x1 gt {pop x1} if /x exch def F2@pstplot abs ComputeStep - /x 3 -1 roll def 2 copy gt { exch } if pop - /x x 3 -1 roll add dup x1 gt {pop x1} if def - xy \@nameuse{doqp@\psplotstyle} - x x1 eq { exit } if} loop}% - \else\pst@killglue% - \addto@pscode{ - /ps@Exit false def - xy \@nameuse{beginqp@\psplotstyle} - \ifx\psk@method\@varrkiv\else\psk@plotpoints 1 sub \fi { - /x x dx add \ifx\psk@method\@varrkiv dup x1 gt { pop x1 } if \fi def - xy \@nameuse{doqp@\psplotstyle} - \ifx\psk@method\@varrkiv x x1 eq { exit } if \fi - } - ps@Exit { exit } if - \ifx\psk@method\@varrkiv loop \else repeat \fi - ps@Exit not { - /x x1 def - xy \@nameuse{doqp@\psplotstyle} - } if }% - \fi% - \@nameuse{endqp@\psplotstyle}} -\def\psplot@iii{% - \ifPst@VarStep% - \addto@pscode{ - /n 2 def - mark - { xy n 2 roll F2@pstplot abs - ComputeStep x 2 copy add dup x1 gt {pop x1} if - /x exch def F2@pstplot abs ComputeStep - /x 3 -1 roll def 2 copy gt { exch } if pop - /x x 3 -1 roll dup /LastNonZeroStep exch def add dup x1 gt {pop x1} if def /n n 2 add def - x x1 eq { exit } if } loop - xy - n 2 roll}% - \else\pst@killglue% - \addto@pscode{ - mark - /n 2 def - \ifx\psk@method\@varrkiv\else\psk@plotpoints\fi { - xy - n 2 roll - /n n 2 add def - /x x dx add \ifx\psk@method\@varrkiv dup x1 gt { pop x1 } if \fi def - \ifx\psk@method\@varrkiv x x1 eq { exit } if \fi - } \ifx\psk@method\@varrkiv loop\else repeat \fi \space - /x x1 def - xy - 2 copy \tx@UserCoor 2 array astore /SaveFinalState ED - n 2 roll}% - \fi% - \@nameuse{endplot@\psplotstyle}} -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\parametricplot@i#1#2{\@ifnextchar[{\parametricplot@I{#1}{#2}}{\parametricplot@I{#1}{#2}[]}} -\def\parametricplot@I#1#2[#3]#4{% - \pst@killglue% - \begingroup - \use@par - \@nameuse{beginplot@\psplotstyle}% - \addto@pscode{% - \psplot@init - #3 - /t #1 def - /t1 #2 def - /dt t1 t sub \psk@plotpoints div def - /F@pstplot \ifPst@algebraic (#4) - \ifx\psk@PlotDerivative\@none\else - \psk@PlotDerivative\space { (t) tx@Derive begin Derive end } repeat - \fi\space - tx@AlgToPs begin AlgToPs end cvx - \else { #4 } \fi def - \ifPst@VarStep - /StillZero 0 def /LastNonZeroStep dt def - /F2@pstplot tx@Derive begin (#4) (t) Derive (t) Derive end - \ifx\psk@PlotDerivative\@none\else - \psk@PlotDerivative\space { (t) tx@Derive begin Derive end } repeat - \fi\space - tx@AlgToPs begin AlgToPs end cvx def - %% computation of the tolerance defined by plotpoints - /epsilon12 \ifx\psk@VarStepEpsilon\@default - tx@Derive begin F2@pstplot end Pyth - dt 3 exp abs mul - \else\psk@VarStepEpsilon\space 12 mul \fi def - /ComputeStep { - dup 1e-4 lt - { pop StillZero 2 ge { LastNonZeroStep 2 mul } { LastNonZeroStep } ifelse /StillZero StillZero 1 add def } - { epsilon12 exch div 1 3 div exp /StillZero 0 def } - ifelse } bind def - \fi - /xy { - \ifPst@algebraic F@pstplot \else #4 \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} -\def\parametricplot@ii{% - \ifPst@VarStep - \addto@pscode{% - mark xy \@nameuse{beginqp@\psplotstyle} - { F2@pstplot Pyth ComputeStep - t 2 copy add dup t1 gt {pop t1} if /t exch def F2@pstplot Pyth ComputeStep - /t 3 -1 roll def 2 copy gt { exch } if pop - /t t 3 -1 roll add dup t1 gt {pop t1} if def - xy \@nameuse{doqp@\psplotstyle} - t t1 eq { exit } if } loop}% - \else\pst@killglue% - \addto@pscode{% - /ps@Exit false def - xy \@nameuse{beginqp@\psplotstyle} - \psk@plotpoints 1 sub { - /t t dt add def - xy \@nameuse{doqp@\psplotstyle} - ps@Exit { exit } if - } repeat - ps@Exit not { - /t t1 def - xy \@nameuse{doqp@\psplotstyle} - } if }% - \fi% - \@nameuse{endqp@\psplotstyle}} -\def\parametricplot@iii{% - \ifPst@VarStep - \addto@pscode{% - /n 2 def - mark - { xy n 2 roll F2@pstplot Pyth - ComputeStep t 2 copy add dup t1 gt {pop t1} if - /t exch def F2@pstplot Pyth ComputeStep - /t 3 -1 roll def 2 copy gt { exch } if pop - /t t 3 -1 roll dup /LastNonZeroStep exch def add dup t1 gt {pop t1} if def /n n 2 add def - t t1 eq { exit } if } loop - xy n 2 roll}% - \else\pst@killglue% - \addto@pscode{% - mark - /n 2 def - \psk@plotpoints { - xy - n 2 roll - /n n 2 add def - /t t dt add def - } repeat - /t t1 def - xy - n 2 roll}% - \fi% - \@nameuse{endplot@\psplotstyle}} -% -\define@key[psset]{pstricks-add}{barwidth}{\pst@getlength{#1}\Add@barwidth} -\psset[pstricks-add]{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\Add@barwidth 0.5 mul sub 0 moveto - 0 Yval rlineto \number\Add@barwidth 0 rlineto - 0 Yval neg rlineto \number\Add@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} -% -\define@key[psset]{pstricks-add}{PSfont}[Times-Roman]{\def\psk@PSfont{/#1 }} -\define@key[psset]{pstricks-add}{valuewidth}[10]{\pst@getint{#1}\psk@valuewidth } -\define@key[psset]{pstricks-add}{fontscale}[10]{\pst@checknum{#1}\psk@fontscale } -\define@key[psset]{pstricks-add}{decimals}[-1]{\pst@getint{#1}\psk@decimals } -\psset[pstricks-add]{PSfont=Times-Roman,fontscale=10,valuewidth=10,decimals=-1} -% -\def\psvalues@ii{ - \addto@pscode{false \tx@NArray \psvalues@iii}} -\def\psvalues@iii{% - \psk@PSfont findfont \psk@fontscale scalefont setfont - newpath - n { /yO ED /xO ED - gsave -% \psk@valuewidth 2 div \psk@fontscale mul 0 rlineto 0 \psk@fontscale rlineto -% \psk@valuewidth 2 div \psk@fontscale mul neg 0 rlineto 0 \psk@fontscale neg rlineto -% closepath gsave 1 setgray fill stroke grestore - yO \pst@number\psyunit div - \psk@decimals 0 eq { cvi } if - \psk@decimals 0 gt { 10 \psk@decimals exp dup 3 1 roll mul cvi exch div } if - \psk@valuewidth string cvs /Str ED - Str stringwidth pop /yS \psk@fontscale def /xS ED - gsave newpath - xO yO \pst@number\pslabelsep add moveto \psk@rot rotate - xS 0 rlineto 0 yS rlineto xS neg 0 rlineto 0 yS neg rlineto - closepath 1 setgray fill stroke grestore - xO yO \pst@number\pslabelsep add moveto \psk@rot rotate Str show grestore } repeat -}% -\def\beginplot@values{\begin@SpecialObj} -\def\endplot@values{% - \psvalues@ii% - \pst@stroke - \end@SpecialObj} -% -% -% LSM Least Square Method 2006-03-13 (hv) -\def\psLSM@ii{\addto@pscode{ false \tx@NArray \psLSM@iii }} -\def\psLSM@iii{% - /xiSquare 0 def % xi*xi - /xi 0 def % xi - /fi 0 def % f(xi) - /xifi 0 def % xi*f(xi) - exch dup dup /xEnd ED /xStart ED exch - n { % number of data pairs - /Yval ED /Xval ED % save x y values - /xi xi Xval add def % sum xi - /xiSquare xiSquare Xval dup mul add def % sum xi*xi - /xifi xifi Xval Yval mul add def % sum xi*yi, same as xi*f(xi) - /fi fi Yval add def % sum yi, same as f(xi) - Xval xStart lt { /xStart Xval def } if % find the lowest xi - Xval xEnd gt { /xEnd Xval def } if % find the largest xi - } repeat - /u xiSquare fi mul xi xifi mul sub n xiSquare mul xi dup mul sub div def - /v n xifi mul xi fi mul sub n xiSquare mul xi dup mul sub div def - \Pst@Debug\space 0 gt { % print the equation - /Helvetica findfont 12 scalefont setfont - 0 -50 moveto (y=) show % print y= - v 20 string cvs show ( x+) show % m*x+ - u \pst@number\psyunit div 20 string cvs show } if - newpath - (\psk@xStart) length 0 gt % special start value? - { \psk@xStart\space \pst@number\psxunit mul } - { xStart } ifelse - dup v mul u add % xStart f(xStart) - moveto % goto first point x1 y(x1) - (\psk@xEnd) length 0 gt % special end value? - { \psk@xEnd\space \pst@number\psxunit mul } - { xEnd } ifelse - dup v mul u add % xEnd f(xEnd) - lineto % line to second point x2 y(x2) -}% -% -\def\beginplot@LSM{\begin@SpecialObj} -\def\endplot@LSM{% - \psLSM@ii\psk@fillstyle\ifpsshadow\pst@closedshadow\fi% - \pst@stroke - \end@SpecialObj% -} -% \define@key[psset]{pstricks-add}{StepType}{\pst@expandafter\psset@@StepType{#1}\@nil}% \def\psset@@StepType#1#2\@nil{% \ifx#1u\let\psk@StepType\@ne @@ -3189,8 +1091,8 @@ abc aload pop pop exch % b a #7 mul 2 mul add % b+2*a*x0=mTan \ifPST@Tnormal - neg 1 exch div % mOrth - #8 mul /dy ED % mOrth*dx + neg 1 exch div % -1/mTan=mOrth + #8 mul /dy ED % mOrth*dx=dy [ #7 #8 add y0 dy add \tx@ScreenCoor % x0+dx y0 +dy #7 y0 \tx@ScreenCoor % x0 y0 @@ -3272,17 +1174,18 @@ cleartomark y2 y1 sub \pst@number\psyunit mul x2 x1 sub \pst@number\psxunit mul } ifelse atan % atan(dy dx), we have the slope angle of the secant + \ifPST@Tnormal 90 add \fi \else % there is a derivation defined - #2 dup /x ED /t ED tx@addDict begin mark FDer@pstplot end counttomark 1 gt % test, if we have parametricplot - { /y ED /x ED } - { \ifPst@polarplot /Fphi ED % the value F'(phi) - tx@addDict begin F@pstplot end x \ifPst@algebraic RadtoDeg \fi PtoC /y0 ED /x0 ED % the x y values - x \ifPst@algebraic RadtoDeg \fi sin Fphi mul x0 add /y ED - x \ifPst@algebraic RadtoDeg \fi cos Fphi mul y0 sub /x ED - \else /y ED /x 1 def \fi } ifelse - cleartomark - y \pst@number\psyunit mul x \pst@number\psxunit mul Atan \ifPST@Tnormal 90 add \fi -% y ATAN1 % we have the slope angle of the tangent. ATAN is defined int the pstricks.pro, patch 6 + #2 dup /x ED /t ED tx@addDict begin mark FDer@pstplot end counttomark 1 gt % test, if we have parametricplot + { /y ED /x ED } + { \ifPst@polarplot /Fphi ED % the value F'(phi) + tx@addDict begin F@pstplot end x \ifPst@algebraic RadtoDeg \fi PtoC /y0 ED /x0 ED % the x y values + x \ifPst@algebraic RadtoDeg \fi sin Fphi mul x0 add /y ED + x \ifPst@algebraic RadtoDeg \fi cos Fphi mul y0 sub /x ED + \else /y ED /x 1 def \fi } ifelse + cleartomark + y \pst@number\psyunit mul x \pst@number\psxunit mul Atan \ifPST@Tnormal 90 add \fi + % y ATAN1 % we have the slope angle of the tangent. ATAN is defined int the pstricks.pro, patch 6 \fi cvi 180 mod dup 90 gt { 180 sub } if % -90 <= angle <= 90 rotate % rotate, depending to the origin @@ -3291,7 +1194,7 @@ \ifPST@Tnormal 0 0 % moveto #3 - y \pst@number\psyunit mul x \pst@number\psxunit mul Atan 90 add cos div \pst@number\psxunit mul 0 % lineto + y \pst@number\psyunit mul x \pst@number\psxunit mul Atan cos div \pst@number\psxunit mul 0 % lineto \else % points are in reverse order ... \ifx\pst@tempRight\@empty #3 \else \pst@tempRight\space \fi \pst@number\psxunit mul 0 % moveto StarVersion { 0 }{\ifx\pst@tempRight\@empty #3 neg \else @@ -3577,117 +1480,6 @@ \ignorespaces% }} % -\define@key[psset]{pstricks-add}{IQLfactor}{\pst@checknum{#1}\pst@IQLfactor} -%\psset[pstricks-add]{IQLfactor=1.5} -% -\def\psBoxplot@ii{% - \addto@pscode{ - /Barwidth \number\Add@barwidth 2 div def - /Endwidth Barwidth \psk@arrowlength\space mul def - tx@addDict begin % BSort from pro file - NArray bubblesort end - /NArray ED % save sorted array - [ NArray { yUnit mul } forall ] /NArray ED % multiply with y unit - NArray 0 get /MinVal ED % save minimum - NArray m 1 sub get /MaxVal ED % maximum - m 2 div cvi /M ED % the middle - NArray length 2 mod 0 eq { % even numbers of entries - M 1 sub NArray exch get % even number of values - NArray M get % and the upper one - add 2 div /Median ED % the median - }{ - NArray M get /Median ED % odd numbers of values - } ifelse - m 2 mod 1 eq { % get the lower Quartil even/odd - M 2 div cvi 1 add dup /M2 ED % save middle index - 1 sub NArray exch get - NArray M2 get - add 2 div /LowerQuartil ED - }{ - NArray M 2 div cvi get /LowerQuartil ED - } ifelse % end even/odd - m 2 mod 1 eq { % get the upper Quartil - M 1.5 mul cvi 1 add dup /M3 ED - 1 sub NArray exch get - NArray M3 get - add 2 div /UpperQuartil ED - }{ % upper quartil - NArray M 1.5 mul cvi get /UpperQuartil ED - } ifelse - /IQL UpperQuartil LowerQuartil sub \pst@IQLfactor\space mul def - 0 1 m 1 sub { % Index on stack - dup /Index ED - NArray exch get LowerQuartil sub abs IQL sub 0 gt { - newpath 0 NArray Index get 2 0 360 arc gsave - 1 0 0 setrgbcolor fill grestore - stroke closepath - NArray Index 1 add get /MinVal ED }{ exit } ifelse - } for - m 1 sub -1 0 { % Index on stack - dup /Index ED - NArray exch get UpperQuartil sub abs IQL sub 0 gt { - newpath 0 NArray Index get 2 0 360 arc gsave - 1 0 0 setrgbcolor fill grestore - stroke closepath - NArray Index 1 sub get /MaxVal ED }{ exit } ifelse - } for -% - Endwidth neg MaxVal moveto % we are on top - Endwidth dup add 0 rlineto - 0 MaxVal moveto - 0 UpperQuartil lineto % upper quartil - 0 LowerQuartil moveto - 0 MinVal lineto - Endwidth neg MinVal moveto - Endwidth dup add 0 rlineto - gsave - \pst@number\pslinewidth SLW - \pst@usecolor\pslinecolor - \tx@setStrokeTransparency - \tx@setStrokeTransparency - \@nameuse{psls@\pslinestyle} - stroke - grestore - newpath - Barwidth neg LowerQuartil moveto % lower quartil - Barwidth neg UpperQuartil lineto - Barwidth dup add 0 rlineto - Barwidth LowerQuartil lineto - closepath - gsave \pst@usecolor\psfillcolor \tx@setTransparency fill grestore - Barwidth neg Median moveto % median - Barwidth dup add 0 rlineto - \pst@number\pslinewidth SLW - \pst@usecolor\pslinecolor - \tx@setStrokeTransparency - \tx@setStrokeTransparency - \@nameuse{psls@solid} -}}% -\def\beginplot@Boxplot{\init@pscode} -\def\endplot@Boxplot{% - \psBoxplot@ii\psk@fillstyle\ifpsshadow\pst@closedshadow\fi% - \pst@stroke - \end@SpecialObj} -\def\psBoxplot{\def\pst@par{}\pst@object{psBoxplot}} -\def\psBoxplot@i#1{% - \leavevmode - \pst@killglue - \begingroup - \addbefore@par{barwidth=40pt,arrowlength=0.75}% - \addto@par{plotstyle=Boxplot}% - \use@par - \@nameuse{beginplot@\psplotstyle}% - \addto@pscode{ - /D {} def - [ #1 ] /NArray ED - NArray aload length /m ED - /xUnit \pst@number\psxunit def - /yUnit \pst@number\psyunit def - }% - \@nameuse{endplot@\psplotstyle}% - \ignorespaces% -} - % the datafile must be a matrix with % /dotmatrix [ % ..... @@ -3696,6 +1488,11 @@ % \define@key[psset]{pstricks-add}{colorType}[0]{\def\psk@colorType{#1}} \psset[pstricks-add]{colorType=0} % 0-> two color mode 1->wavelength mode (400..700nm) +% 0-> two color mode +% 1-> wavelength mode (400..700nm) +% 2-> wavelength mode inverse +% 3-> gray color mode +% 4-> gray color mode invers \def\psMatrixPlot{\def\pst@par{}\pst@object{psMatrixPlot}} \def\psMatrixPlot@i#1#2#3{% \pst@killglue% @@ -3722,6 +1519,12 @@ \or Min sub dMaxMin div neg 1 add 300 mul 400 add tx@addDict begin wavelengthToRGB Red Green Blue end setrgbcolor + \or + Min sub dMaxMin div neg 1 add 300 mul 400 add + tx@addDict begin wavelengthToGRAY end setgray + \or + Min sub dMaxMin div neg 1 add 300 mul 400 add + tx@addDict begin wavelengthToGRAY end neg 1 add setgray \fi x \psk@xStep\space mul \pst@number\psxunit mul \ifPst@ChangeOrder #1 y sub 1 add \else y \fi \psk@yStep\space mul \pst@number\psyunit mul Dot% @@ -3791,15 +1594,14 @@ \begingroup% \def\psk@chartValues{#1}% \def\psk@chartSepValues{#2}% only valid for a pie chart - \pst@dimm=\z@\relax% sum of all entries (for a pie) - \pst@cnta=1\relax% number of entries - \pst@dimn=\z@\relax% greatest entry + \pst@dimm=\z@ % sum of all entries (for a pie) + \pst@cnta=1 % number of entries + \pst@dimn=\z@ % greatest entry \psforeach{\chart@tempA}{#1}{% - \global\advance\pst@cnta by \@ne% % no of entries - \global\advance\pst@dimm by \chart@tempA\p@% % sum of all entries + \global\advance\pst@cnta by \@ne % % no of entries + \global\advance\pst@dimm by \chart@tempA\p@ % % sum of all entries \pst@dima=\chart@tempA\p@% - \ifdim\pst@dima>\pst@dimn\relax - \global\pst@dimn=\pst@dima\fi% + \ifdim\pst@dima>\pst@dimn \global\pst@dimn=\pst@dima\fi% }% \addbefore@par{dimen=outer}% \begin@SpecialObj% @@ -3825,8 +1627,9 @@ \global\advance\pst@cnta by \@ne% \pst@dimo=0.5\pst@dimn\advance\pst@dimo by 0.5\pst@dimm% half angle of the chart \global\@chartSepfalse% - \psforeach{\chart@tempC}{\psk@chartSepValues}{\ifnum\chart@tempC=\the\pst@cnta\relax - \global\@chartSeptrue\fi}% + \if$\psk@chartSepValues$\else + \psforeach{\chart@tempC}{\psk@chartSepValues}{\ifnum\chart@tempC=\the\pst@cnta \global\@chartSeptrue\fi}% + \fi \if@chartSep% \pswedge(\psk@chartSep\p@;\pst@number\pst@dimo){\pst@chartRadius}{\pst@number\pst@dimn}{\pst@number\pst@dimm}% \else% @@ -3838,7 +1641,7 @@ \fi% \def\chart@alpha{0}% \pst@dimm=0pt\pst@dimn=0pt\pst@dimo=0pt\pst@cnta=0\relax% - \psforeach{\chart@tempA}{\psk@chartValues}{% + \psForeach{\chart@tempA}{\psk@chartValues}{% \global\advance\pst@dimm by \chart@tempA\p@% \global\advance\pst@dimn by \chart@alpha\p@% \def\pst@tempB{\pst@number\chart@ColorIndex}% @@ -3851,9 +1654,10 @@ \else\xglobal\definecolor{\chart@FillColor}{gray}{\pst@tempB}\fi% \fi% \pst@dimo=0.5\pst@dimn\advance\pst@dimo by 0.5\pst@dimm% half angle of the chart - \global\@chartSepfalse% - \psforeach{\chart@tempC}{\psk@chartSepValues}{\ifnum\chart@tempC=\the\pst@cnta\relax% - \global\@chartSeptrue\fi}% + \global\@chartSepfalse + \if$\psk@chartSepValues$\else + \psForeach{\chart@tempC}{\psk@chartSepValues}{\ifnum\chart@tempC=\the\pst@cnta \global\@chartSeptrue\fi}% + \fi \if@chartSep% \pswedge[linecolor={chartFillColor\the\pst@cnta},fillstyle=solid,fillcolor={chartFillColor\the\pst@cnta}]% (\psk@chartSep\p@;\pst@number\pst@dimo){\pst@chartRadius}{\pst@number\pst@dimn}{\pst@number\pst@dimm}% @@ -4080,30 +1884,10 @@ ArrowFill=true, ArrowInside={}, ArrowInsidePos=0.5, ArrowInsideNo=1, ArrowInsideOffset=0, - arrowLW=0, - dashNo=0.2,linecap=0, - xyAxes=true, - xlabelPos=bottom, ylabelPos=left, - trigLabels=false,trigLabelBase=0, - xDecimals={},yDecimals={}, - xlogBase={},ylogBase={}, - labelFontSize={},mathLabel, - logLines=none, - ignoreLines=0, - nStep=1,nStart=0,nEnd={}, - xStep=0,yStep=0,xStart={},xEnd={},yStart={},yEnd={},comma=false, - decimalSeparator=., - plotNo=1,plotNoMax=1, - xAxisLabel=x,yAxisLabel=y, - yAxisLabelPos={},xAxisLabelPos={}, - llx=\z@, lly=\z@, urx=\z@, ury=\z@,% prevents rounding errors randomPoints=1000,color=false, method={},whichabs={},whichord={}, plotfuncx={},plotfuncy={},buildvector=false, -% algebraic=false, % individuelly set Derive={},adamsorder=4, - VarStep=false, PlotDerivative=none, VarStepEpsilon=default, - varsteptol=.001, Tnormal=false, braceWidth=2\pslinewidth, bracePos=0.5, @@ -4111,92 +1895,7 @@ braceWidthOuter=10\pslinewidth, chartNodeI=0.75, chartNodeO=1.5, - IQLfactor=1.5, - showOriginTick - } - \psset{% -%%%% pstricks %%%%%%%% -% opacity=1, -% blendmode=0, -% shapealpha=0.6, - 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,% - maxdashes=11, dash=5pt 3pt, dashadjust=true, % - dotsep=3pt,% - linestyle=solid,% - fillcolor=white,% - hatchwidth=.8pt, hatchsep=4pt, hatchcolor=black, hatchangle=45,% - hatchsepinc=0pt,hatchwidthinc=0pt,% - fillstyle=none,% - nArrows=2,% - 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=middle,% - 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,% - intSeparator={,},% -%%%%%%%%% pst-plot %%%%%%%%%%%%% - labelFontSize={},% - StepType=lower, % alternative SumType=upper - plotstyle=line,plotpoints=50,% -% barwidth=0.25cm,% individuell set - ticksize=-4pt 4pt, - tickstyle=full, ticks=all,% - subticksize=0.75,subticks=1,tickcolor=black,% - ticklinestyle=solid,subticklinestyle=solid,% - subtickcolor=gray,% - tickwidth=0.5\pslinewidth,subtickwidth=0.25\pslinewidth,% - labels=all,Ox=0,Dx=1,dx=0,Oy=0,Dy=1,dy=0,% - xlabelFactor=\relax,ylabelFactor=\relax,% - showorigin=true,% - axesstyle=axes,% - ChangeOrder=false,% - arrowscale=1,% - %%%%%%%%% pst-node %%%%%%%%%% - lineAngle=0, - 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, - mcol=c, - mnode=R, - emnode=none% -}} + }} % \resetOptions % |