diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex | 210 |
1 files changed, 99 insertions, 111 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex b/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex index 2a6a6c00cb2..1a2608d9c95 100644 --- a/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex +++ b/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex @@ -1,4 +1,4 @@ -% $Id: pst-plot.tex 393 2017-03-20 08:00:05Z herbert $ +% $Id: pst-plot.tex 641 2017-11-13 18:56:40Z herbert $ %% %% BEGIN pst-plot.tex %% @@ -23,8 +23,8 @@ \ifx\PSTFPloaded\endinput\else \input pst-fp.tex \fi \ifx\MultidoLoaded\endinput\else \input multido.tex \fi % -\def\fileversion{1.84} -\def\filedate{2017/08/31} +\def\fileversion{1.85} +\def\filedate{2017/11/12} \message{ v\fileversion, \filedate\space (tvz,hv)} % \edef\TheAtCode{\the\catcode`\@} @@ -1384,7 +1384,7 @@ D\space##1% \ifPst@xmathLabel\def\pshlabel##1{$\psk@xlabelFontSize##1$}\else\def\pshlabel##1{\psk@xlabelFontSize##1}\fi } \def\setTrighLabels{% - \def\pst@@@hlabel##1{\pshlabel{##1}} + \def\pst@@@hlabel##1{\pshlabel{##1}}% \def\pshlabel##1{% \ifnum\psk@xtrigLabelBase<2 \def\de@nominator{\@ne}\else\def\de@nominator{\psk@xtrigLabelBase}\fi @@ -1956,14 +1956,16 @@ D\space##1% }} % \newif\ifSpecialLabelsDone +% \def\psaxes{\pst@object{psaxes}} -\def\psaxes@i{\pst@getarrows\psaxes@ii} +\def\psaxes@i{% + \let\pst@par@save\pst@par + \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]{% - \let\pst@par@save\pst@par \psaxes@vii(#1)(#2)(#3)% \let\pst@par\pst@par@save \begingroup @@ -1972,74 +1974,70 @@ D\space##1% \ifshowgrid\psgrid[style=gridstyleA]\fi \uput{\psxlabelsep}[#5](#3|#1){#4}\uput{\psylabelsep}[#7](#1|#3){#6}% \endgroup - \ignorespaces} + \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@\relax \ifdim\pst@dimd<\z@\relax% axes show to left and down + \ifdim\pst@dimc<\z@\relax \ifdim\pst@dimd<\z@\relax % 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 - \ifshowgrid\psgrid[style=gridstyleA]\fi - \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) -% + \pssetxlength\pst@dimc{#5}% ur-x + \pssetylength\pst@dimd{#6}% ur-y + \pssetxlength\pst@dimg{#1}% o-x + \pssetylength\pst@dimh{#2}% o-y + \pssetxlength\pst@dima{#3}% ll-x + \pssetylength\pst@dimb{#4}% ll-y % Whole thing will be translated to origin: - \pst@dima=\dimexpr\pst@dima-\pst@dimg\relax - \pst@dimb=\dimexpr\pst@dimb-\pst@dimh\relax - \pst@dimc=\dimexpr\pst@dimc-\pst@dimg\relax - \pst@dimd=\dimexpr\pst@dimd-\pst@dimh\relax -% \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 + \pst@dima=\dimexpr\pst@dima-\pst@dimg\relax + \pst@dimb=\dimexpr\pst@dimb-\pst@dimh\relax + \pst@dimc=\dimexpr\pst@dimc-\pst@dimg\relax + \pst@dimd=\dimexpr\pst@dimd-\pst@dimh\relax + \setbox\pst@hbox=\hbox\bgroup + \ifshowgrid\psgrid[style=gridstyleA]\fi % Make lines/arrows or frame: - \@nameuse{psxs@\psk@axesstyle}% \psxs@axes or \psxs@frame or \psxs@polar - \ifPst@yAxis - \SpecialLabelsDonefalse - \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\numexpr-1*\pst@cnta}\fi% v.1.21 - \edef\psk@dy{\number\pst@dimg}% + \@nameuse{psxs@\psk@axesstyle}% \psxs@axes or \psxs@frame or \psxs@polar + \ifPst@xAxis + \SpecialLabelsDonefalse + \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\numexpr-1*\pst@cnta}% + \fi% v.1.21 + \edef\psk@dx{\number\pst@dimg}% + \fi + \pst@hlabels{\pst@dimc}{\psk@arrowB}{#3}{#5}% Right + \ifPst@yAxis\showoriginfalse\fi + \pst@hlabels{\pst@dima}{\psk@arrowA}{#3}{#5}% Left + \endgroup \fi -% \ifPst@xAxis\else\showorigintrue\fi% 2009-10-21 - \pst@vlabels{\pst@dimb}{\psk@arrowA}{#4}{#6}% - \ifPst@xAxis\ifdim\pst@dima<\z@ \showoriginfalse\fi\fi% no 0 when x- axis is crossing - \pst@vlabels{\pst@dimd}{\psk@arrowB}{#4}{#6}% - \endgroup - \fi - \ifPst@xAxis - \SpecialLabelsDonefalse - \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\numexpr-1*\pst@cnta}\fi% v.1.21 - \edef\psk@dx{\number\pst@dimg}% + \ifPst@yAxis + \SpecialLabelsDonefalse + \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\numexpr-1*\pst@cnta}% + \fi% v.1.21 + \edef\psk@dy{\number\pst@dimg}% + \fi + \pst@vlabels{\pst@dimb}{\psk@arrowA}{#4}{#6}% + \ifPst@xAxis\ifdim\pst@dima<\z@ \showoriginfalse\fi\fi % no 0 when x- axis is crossing + \pst@vlabels{\pst@dimd}{\psk@arrowB}{#4}{#6}% + \endgroup \fi -% \ifPst@yAxis\else\showorigintrue\fi% 2009-10-21 - \pst@hlabels{\pst@dimc}{\psk@arrowB}{#3}{#5}% - \ifPst@yAxis\showoriginfalse\fi - \pst@hlabels{\pst@dima}{\psk@arrowA}{#3}{#5}% - \endgroup - \fi % Now close "\pst@hbox" (which is 0-dimensional), and put it at the origin. - \egroup + \egroup% \pssetxlength\pst@dimg{#1}% \pssetylength\pst@dimh{#2}% - \leavevmode\psput@cartesian\pst@hbox + \leavevmode + \psput@cartesian\pst@hbox \endgroup \ignorespaces } @@ -2380,56 +2378,51 @@ D\space##1% \define@key[psset]{pst-plot}{yLabelsRot}[0]{\pst@getangle{#1}\pst@yLabelsRot} \psset[pst-plot]{yLabels=,yLabelsRot=0} % +% % #1:Max/Min in pt from origin; #2:arrow; #3:min; #4:max \def\pst@hlabels#1#2#3#4{% - \ifSpecialLabelsDone\else - \kern\psk@xlabelOffset pt% % set the x offset? - \ifx\empty\psk@xLabels - \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 +%\expandafter\typeout\expandafter{#1|#2|#3|#4|}% 0 0 0 10 + \ifSpecialLabelsDone + \else + \kern\psk@xlabelOffset pt % set the x offset? + \ifx\empty\psk@xLabels + \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 + \else + \ifnum\psk@xlabelPos=\tw@ \def\pst@tempC{90}\else\def\pst@tempC{-90}\fi + \pstFPsub\pst@pmtempa{#4}{#3} + \pstFPDiv\pst@pmtempb{\pst@pmtempa}{\psk@Dx} + \pstFPadd\pst@pmtempc{\pst@pmtempb}{-1}% + \pstFPadd\pst@pmtempd{\pst@pmtempb}{1}% + \ifdim\pst@pmtempb pt < \z@ + \def\pst@pmtempe{\pst@int{\pst@pmtempc}}% + \else + \def\pst@pmtempe{\pst@int{\pst@pmtempd}}% + \fi + \multido{\nA=0+1,\rA=#3+\psk@Dx}{\pst@pmtempe}{% + \ifdim \nA pt < \z@ \def\nB{-\nA} \else \def\nB{\nA} \fi + \uput{\psxlabelsep}[\pst@tempC]{\pst@xLabelsRot}(\rA,0){% + \strut\expandafter\pshlabel\expandafter{\psPutXLabel{\nB}}}}% + \SpecialLabelsDonetrue \fi \fi - \else -% \pst@cnta=#1\relax% % Distance (in sp) to end. -% \edef\pst@tempA{\strip@pt#1}% -% \pstFPmul\pst@tempA{\pst@tempA}{65536}% -% \pstFPdiv\pst@tempA{\pst@tempA}{\psk@dx}% -% \pstFPadd\pst@tempA{1.55}{\pst@tempA}% % to prevent rounding errors -% \edef\pst@tempB{\pst@int{\pst@tempA}}% -% \divide\pst@cnta\psk@dx\relax% % Number of ticks/labels -% \edef\pst@tempA{\psk@Dx}% - \ifnum\psk@xlabelPos=\tw@ \def\pst@tempC{90}\else\def\pst@tempC{-90}\fi -% \multido{\iB=#3+1,\rB=#3+\pst@tempA}{\pst@tempB}% -% {\uput{\psxlabelsep}[\pst@tempC]{\pst@xLabelsRot}(\rB,0)%\psxlabelsep) -% {\strut\pshlabel{\psPutXLabel{\iB}}}}% -% \edef\pst@Xstart{\pst@int{#3}}% -% \edef\pst@Xend{\pst@int{#4}}% -% \multido{\nA=0+1,\rA=\pst@Xstart+\psk@Dx}{% -% \numexpr\pst@Xend-\pst@Xstart+1}{\uput{\psxlabelsep}[\pst@tempC]{\pst@xLabelsRot}(\rA,0){% -% \strut\expandafter\pshlabel\expandafter{\psPutXLabel{\nA}}}}% - \pstFPsub\pst@pmtempa{#4}{#3} - \pstFPDiv\pst@pmtempb{\pst@pmtempa}{\psk@Dx} - \pstFPadd\pst@pmtempc{\pst@pmtempb}{-1}% - \pstFPadd\pst@pmtempd{\pst@pmtempb}{1}% - \ifdim\pst@pmtempb pt < \z@ \def\pst@pmtempe{\pst@int{\pst@pmtempc}}\else\def\pst@pmtempe{\pst@int{\pst@pmtempd}}\fi% - \multido{\nA=0+1,\rA=0+\psk@Dx}{\pst@pmtempe}{% - \ifdim \nA pt < \z@ \def\nB{-\nA} \else \def\nB{\nA} \fi - \uput{\psxlabelsep}[\pst@tempC]{\pst@xLabelsRot}(\rA,0){% - \strut\expandafter\pshlabel\expandafter{\psPutXLabel{\nB}}}}% - \SpecialLabelsDonetrue - \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 % 0 \vskip-\pst@xticksizeA\vskip\psxlabelsep\or % 1 @@ -2445,7 +2438,7 @@ D\space##1% \else\expandafter\pst@@@hlabel{\nA}% \fi% prevent -0, doesn't work with \ifnum \hss}% - } + }\hss% 1.85 }% }\ht\z@\z@ \dp\z@\z@ \box\z@}% set all values to zero % @@ -2466,17 +2459,12 @@ D\space##1% \fi \fi \else -% \edef\pst@Ystart{\pst@int{#3}}% -% \edef\pst@Yend{\pst@int{#4}}% -% \multido{\nA=0+1,\rA=\pst@Ystart+\psk@Dy}{\numexpr\pst@Yend-\pst@Ystart+1}{% -% \uput{\psylabelsep}[180]{\pst@yLabelsRot}(0,\rA){% -% \strut\expandafter\psvlabel\expandafter{\psPutYLabel{\nA}}}}% \pstFPsub\pst@pmtempa{#4}{#3}% \pstFPDiv\pst@pmtempb{\pst@pmtempa}{\psk@Dy}% \pstFPadd\pst@pmtempc{\pst@pmtempb}{-1}% \pstFPadd\pst@pmtempd{\pst@pmtempb}{1}% \ifdim\pst@pmtempb pt < \z@ \def\pst@pmtempe{\pst@int{\pst@pmtempc}}\else\def\pst@pmtempe{\pst@int{\pst@pmtempd}}\fi% - \multido{\nA=0+1,\rA=0+\psk@Dy}{\pst@pmtempe}{% + \multido{\nA=0+1,\rA=#3+\psk@Dy}{\pst@pmtempe}{% \ifdim \nA pt < \z@ \def\nB{-\nA}\else \def\nB{\nA}\fi \uput{\psylabelsep}[180]{\pst@yLabelsRot}(0,\rA){% \strut\expandafter\psvlabel\expandafter{\psPutYLabel{\nB}}}}% |