diff options
author | Karl Berry <karl@freefriends.org> | 2009-04-30 00:42:38 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-04-30 00:42:38 +0000 |
commit | f45d184aee6deefd464c66bfc98b59ac92c0da16 (patch) | |
tree | e6c16764f420807b7e610a08a42d0139a7aabc0c /Master/texmf-dist/tex/generic/pstricks-add | |
parent | fbb9340f54cd0f028e4c18f444b9b4075d18e00e (diff) |
pstricks-add update (29apr09)
git-svn-id: svn://tug.org/texlive/trunk@12873 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pstricks-add')
-rw-r--r-- | Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex | 110 |
1 files changed, 73 insertions, 37 deletions
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 145b576a517..3fc77bf7dea 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 112 2009-04-17 19:21:56Z herbert $ +%% $Id: pstricks-add.tex 115 2009-04-29 08:19:40Z herbert $ %% %% %% This is file `pstricks-add.tex', @@ -30,8 +30,8 @@ \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi \ifx\PSTFPloaded\endinput\else \input pst-fp \fi % -\def\fileversion{3.30} -\def\filedate{2009/04/17} +\def\fileversion{3.31} +\def\filedate{2009/04/29} \message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)} % \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax @@ -171,6 +171,9 @@ \def\pst@int#1{\expandafter\pst@@int#1..\@nil} \def\pst@@int#1.#2.\@nil{#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% \advance\pst@dimm by -#3pt% @@ -1508,12 +1511,14 @@ \fi} %\psset{labelFontSize={},mathLabel} % -\define@boolkey[psset]{pstricks-add}[Pst@]{comma}[true]{} +\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{xyAxes=true}% +%\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} @@ -1680,8 +1685,9 @@ \addbefore@par{arrows=-,linewidth=\psk@xtickwidth\pslinewidth} \use@par \psline(#1,\pst@xticksizeB)(#1,\pst@xticksizeA) - \rput[t](! #1 \pst@number\pslabelsep \pst@number\pst@xticksizeB add - \pst@number\psyunit div neg ){\pshlabel{#2\vphantom{1}}}}\ignorespaces} + \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 @@ -1692,8 +1698,9 @@ \addbefore@par{arrows=-,linewidth=\psk@ytickwidth\pslinewidth} \use@par \psline(\pst@yticksizeB,#1)(\pst@yticksizeA,#1) - \rput[r]{0}(!\pst@number\pst@yticksizeB \pst@number\pslabelsep add - \pst@number\psxunit div neg #1){\psvlabel{#2}}}\ignorespaces} + \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 @@ -1739,13 +1746,10 @@ \ifx\@xyDecimals\@empty% take value as is \def\@tempa{#1}% write only if not empty \ifx\@tempa\@empty% write nothing - \else - \ifPst@comma{,}\else.\fi% - #1% - \fi% + \else\psk@decimalSeparator#1\fi% \else% write only \xy@decimals \ifnum\@xyDecimals>\@zero - \ifPst@comma{,}\else.\fi + \psk@decimalSeparator% \@Reset@digitcounter \expandafter\@process@digits#1*; \fi% @@ -1765,6 +1769,7 @@ \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}} @@ -1808,7 +1813,7 @@ \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 + \@nameuse{psxs@\psk@axesstyle}% \psxs@axes or \psxs@frame or \psxs@polar \ifPst@yAxis% \begingroup% \ifdim\pst@dima=\z@\else\showoriginfalse\fi% @@ -2246,6 +2251,36 @@ \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 ? @@ -2469,11 +2504,11 @@ \iffalse \define@key[psset]{pstricks-add}{xAxisLabelPos}{% \def\pst@tempA{#1}% - \ifx\pst@tempA\@empty\let\psk@xAxisLabelPos\relax\else + \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 + \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}} @@ -2516,7 +2551,7 @@ \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@yunit=\pst@@dy\p@% % \pst@dimm=#1\pst@xunit% \advance\pst@dimm by \psk@llx% @@ -2543,7 +2578,7 @@ \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@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 @@ -2566,33 +2601,33 @@ } % \def\setxLabelC@@r#1,#2(#3,#4)(#5){% - \pst@getcoor{#5}\pst@tempB - \ifx#1c - \pssetylength\pst@dimm{#2} + \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} + \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#2c - \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} + \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}% + \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}% + \ifx\psk@yAxisLabelPos\@empty\uput[90](#1,#6){\psk@yAxisLabel}% \else\expandafter\setyLabelC@@r\psk@yAxisLabelPos(#4,#6)(#1,#2)\fi% \fi% \ignorespaces% @@ -3961,6 +3996,7 @@ 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={}, |