diff options
author | Norbert Preining <preining@logic.at> | 2014-03-03 01:30:04 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2014-03-03 01:30:04 +0000 |
commit | 28e659bbcfcb708eb292955e59ef98d3d3c72a9f (patch) | |
tree | 05a07bac7fd342bdde0be4e1808f96263e262e17 | |
parent | 12d58bf20f1d0e51ef49ef952b676251137e8d4e (diff) |
pst-plot 1.60 (3Mar)
git-svn-id: svn://tug.org/texlive/trunk@33076 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-plot/Changes | 1 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf | bin | 1230800 -> 1244740 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.tex | 100 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex | 36 |
4 files changed, 122 insertions, 15 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-plot/Changes b/Master/texmf-dist/doc/generic/pst-plot/Changes index 360998803eb..8f73f3a4df2 100644 --- a/Master/texmf-dist/doc/generic/pst-plot/Changes +++ b/Master/texmf-dist/doc/generic/pst-plot/Changes @@ -1,4 +1,5 @@ ----- pst-plot.tex +1.60 2014-02-28 - allow postActions for \psBoxplot (log, etc) 1.59 2014-02-18 - modifications to \psBoxplot 1.58 2014-01-15 - save last coordinates as /FinalState instead of /SaveFinalState. Also for parametric plot diff --git a/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf b/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf Binary files differindex 062f8b2d3ca..816226c8301 100644 --- a/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf +++ b/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.pdf diff --git a/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.tex b/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.tex index 40901a70632..adcf60d30cd 100644 --- a/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.tex +++ b/Master/texmf-dist/doc/generic/pst-plot/pst-plot-doc.tex @@ -487,6 +487,106 @@ It is also possible to read a data column from an external file: \end{lstlisting} +With the optional argument \Lkeyword{postAction} one can modify the $y$ value of the boxplot, e.g. for +an output with a vertical axis in logarithm scaling: + + +\begin{pspicture}(-1,-3)(9,5) +\psset{fillstyle=solid} +\psaxes[ylogBase=10,Oy=-2,logLines=y,ticksize=0 4pt, subticks=5](1,-2)(9,4) +\rput(3,0){\psBoxplot[fillcolor=red!30,barwidth=0.9cm,postAction=Log]{ + 0.09 0.44 0.12 0.06 0.32 0.23 0.44 0.02 0.15 0.18 0 0.29 0 0.11 0.26 0.11 + 0 0.45 0.04 0.14 0.03 0.12 0.14 0.31 0.06 0.06 0.11 0.12 0.12 0.12 0.13 + 0.01 0.40 0.01 0.03 0.17 0 0.10 0.15 0.16 0.06 0.10 0.01 0.60 0.26 0.11 + 0.15 0.22 0.14 0.01 }} + \rput(4,0){\psBoxplot[fillcolor=red!30,barwidth=0.9cm,postAction=Log]{ +0.07 0.49 0.34 0.20 0.02 1.08 6.83 0.31 0.54 0.02 0.29 0.18 0.60 0.09 0.61 +1.37 0.26 0.03 2.30 0.09 3.15 0.13 0.29 0.27 1.30 0.73 0.63 0.24 10.03 0 +0.26 0.18 3.29 2.43 1.94 0.22 0.23 0.60 1.69 0.35 3.96 0.56 9.90 0.10 0.43 +0.22 0.26 0.31 0.29 0.79 }} + \rput(5,0){\psBoxplot[fillcolor=red!30,barwidth=0.9cm,postAction=Log]{ +12.70 1.34 0.68 0.51 1.77 0.04 3.79 287.05 1.35 5.41 15.56 3.13 0.91 7.48 +2.40 1.04 3.53 0.58 31.71 7.89 4.90 2.61 0.89 0.03 3.78 8.11 4.82 1.02 5.57 +8.85 0.15 17.59 0.21 8.10 2.15 3.43 6.44 1.65 6.83 23.54 0.52 1.47 0.75 +3.54 3.59 5.56 0.33 8.58 1.90 0.78 }} + \rput(6,0){\psBoxplot[fillcolor=red!30,barwidth=0.9cm,postAction=Log]{ +55.72 14.91 14.95 6.01 6.53 88.30 281.50 40.15 13.41 0.91 1.65 44.32 13.41 +7.33 3.51 3.44 70.40 0.75 58.20 54.88 26.45 33.76 0.70 0.05 0.29 57.12 +14.30 31.11 18.56 0.48 21.33 1.15 2.22 3.88 1.78 151.25 7.77 137.92 0.50 +3.01 1.99 23.18 119.59 17.50 15.87 13.63 21.85 23.53 68.72 2.90 }} + \rput(7,0){\psBoxplot[fillcolor=red!30,barwidth=0.9cm,postAction=Log]{ +1.19 1.94 13.40 7.40 267.30 5.94 11.05 6.51 2.94 5.45 5.24 231 4.48 0.68 +311.29 77.47 621.20 139.08 1933.59 2.52 100.96 11.02 153.43 26.67 83.84 +4.31 106.34 15.90 1118.59 9.49 131.48 48.92 5.85 3.74 1.05 32.03 5.69 +45.10 12.43 238.56 28.75 1.01 119.29 12.09 31.18 16.60 29.67 138.55 +17.42 0.83 }} + \rput(8,0){\psBoxplot[fillcolor=red!30,barwidth=0.9cm,postAction=Log]{ +2077.45 762.10 469 143.60 685 3600 20.20 249.60 269 0.30 0.20 779.40 1.80 +146.80 1.30 32.50 137 2016.40 2.30 33.90 801.60 2.20 646.90 3600 1184 627 +500.50 238.30 477.40 3600 17.80 1726.80 2 316.70 174.50 2802.70 335.30 +201.20 1.10 247.10 2705.10 156.90 5.10 2342.50 3600 3600 72.70 47.40 +301.20 1.60 }} +\end{pspicture} + + +\begin{lstlisting} +\begin{pspicture}(-1,-3)(9,5) +\psset{fillstyle=solid} +\psaxes[ylogBase=10,Oy=-2,logLines=y,ticksize=0 4pt, subticks=5](1,-2)(9,4) +\rput(3,0){\psBoxplot[fillcolor=red!30,barwidth=0.9cm,postAction=Log]{ + 0.09 0.44 0.12 0.06 0.32 0.23 0.44 0.02 0.15 0.18 0 0.29 0 0.11 0.26 0.11 + 0 0.45 0.04 0.14 0.03 0.12 0.14 0.31 0.06 0.06 0.11 0.12 0.12 0.12 0.13 + 0.01 0.40 0.01 0.03 0.17 0 0.10 0.15 0.16 0.06 0.10 0.01 0.60 0.26 0.11 + 0.15 0.22 0.14 0.01 }} + \rput(4,0){\psBoxplot[fillcolor=red!30,barwidth=0.9cm,postAction=Log]{ +0.07 0.49 0.34 0.20 0.02 1.08 6.83 0.31 0.54 0.02 0.29 0.18 0.60 0.09 0.61 +1.37 0.26 0.03 2.30 0.09 3.15 0.13 0.29 0.27 1.30 0.73 0.63 0.24 10.03 0 +0.26 0.18 3.29 2.43 1.94 0.22 0.23 0.60 1.69 0.35 3.96 0.56 9.90 0.10 0.43 +0.22 0.26 0.31 0.29 0.79 }} + \rput(5,0){\psBoxplot[fillcolor=red!30,barwidth=0.9cm,postAction=Log]{ +12.70 1.34 0.68 0.51 1.77 0.04 3.79 287.05 1.35 5.41 15.56 3.13 0.91 7.48 +2.40 1.04 3.53 0.58 31.71 7.89 4.90 2.61 0.89 0.03 3.78 8.11 4.82 1.02 5.57 +8.85 0.15 17.59 0.21 8.10 2.15 3.43 6.44 1.65 6.83 23.54 0.52 1.47 0.75 +3.54 3.59 5.56 0.33 8.58 1.90 0.78 }} + \rput(6,0){\psBoxplot[fillcolor=red!30,barwidth=0.9cm,postAction=Log]{ +55.72 14.91 14.95 6.01 6.53 88.30 281.50 40.15 13.41 0.91 1.65 44.32 13.41 +7.33 3.51 3.44 70.40 0.75 58.20 54.88 26.45 33.76 0.70 0.05 0.29 57.12 +14.30 31.11 18.56 0.48 21.33 1.15 2.22 3.88 1.78 151.25 7.77 137.92 0.50 +3.01 1.99 23.18 119.59 17.50 15.87 13.63 21.85 23.53 68.72 2.90 }} + \rput(7,0){\psBoxplot[fillcolor=red!30,barwidth=0.9cm,postAction=Log]{ +1.19 1.94 13.40 7.40 267.30 5.94 11.05 6.51 2.94 5.45 5.24 231 4.48 0.68 +311.29 77.47 621.20 139.08 1933.59 2.52 100.96 11.02 153.43 26.67 83.84 +4.31 106.34 15.90 1118.59 9.49 131.48 48.92 5.85 3.74 1.05 32.03 5.69 +45.10 12.43 238.56 28.75 1.01 119.29 12.09 31.18 16.60 29.67 138.55 +17.42 0.83 }} + \rput(8,0){\psBoxplot[fillcolor=red!30,barwidth=0.9cm,postAction=Log]{ +2077.45 762.10 469 143.60 685 3600 20.20 249.60 269 0.30 0.20 779.40 1.80 +146.80 1.30 32.50 137 2016.40 2.30 33.90 801.60 2.20 646.90 3600 1184 627 +500.50 238.30 477.40 3600 17.80 1726.80 2 316.70 174.50 2802.70 335.30 +201.20 1.10 247.10 2705.10 156.90 5.10 2342.50 3600 3600 72.70 47.40 +301.20 1.60 }} +\end{pspicture} +\end{lstlisting} + +It uses the PostScript function \Lps{Log} instead of \Lps{log}. The latter +cannot handle zero values. The next examples shows how a very small intervall +can be handled: + +\psset{yunit=0.5cm} +\begin{pspicture}(-2,-1)(2,11) +\savedata{\data}[0.9936 0.9937 0.9934 0.9936 0.9937 0.9938 0.9934 0.9933 0.9930 0.9935] +\psaxes[Oy=0.9930,Dy=0.0005,dy=2cm](0,0)(1,10) +\rput(.5,0){\psBoxplot[barwidth=.5\psxunit,postAction=0.993 sub 1e4 mul]{\data}} +\end{pspicture} + +\begin{lstlisting} +\psset{yunit=0.5cm} +\begin{pspicture}(-2,-1)(2,11) +\savedata{\data}[0.9936 0.9937 0.9934 0.9936 0.9937 0.9938 0.9934 0.9933 0.9930 0.9935] +\psaxes[Oy=0.9930,Dy=0.0005,dy=2cm](0,0)(1,10) +\rput(.5,0){\psBoxplot[barwidth=.5\psxunit,postAction=0.993 sub 1e4 mul]{\data}} +\end{pspicture} +\end{lstlisting} \clearpage 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 fea5086587e..ac549681f1f 100644 --- a/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex +++ b/Master/texmf-dist/tex/generic/pst-plot/pst-plot.tex @@ -19,8 +19,8 @@ \ifx\PSTFPloaded\endinput\else \input pst-fp.tex \fi \ifx\MultidoLoaded\endinput\else \input multido.tex \fi % -\def\fileversion{1.59} -\def\filedate{2014/02/18} +\def\fileversion{1.60} +\def\filedate{2014/02/28} \message{ v\fileversion, \filedate\space (tvz,hv)} % \edef\TheAtCode{\the\catcode`\@} @@ -389,6 +389,9 @@ D\space##1% % \define@key[psset]{pst-plot}{IQLfactor}{\pst@checknum{#1}\pst@IQLfactor} \psset[pst-plot]{IQLfactor=1.5} +\define@key[psset]{pst-plot}{postAction}[]{\def\psk@postAction{% + \ifx\relax#1\relax\else\pst@number\psyunit div #1 \pst@number\psyunit mul \fi }} +\psset[pst-plot]{postAction=} % \def\psBoxplot@ii{% \addto@pscode{ @@ -434,7 +437,7 @@ D\space##1% NArray exch get LowerQuartil sub abs IQL sub 0 gt { \psk@dotsize \@nameuse{psds@\psk@dotstyle} - 0 NArray Index get + 0 NArray Index get \psk@postAction Dot NArray Index LowerQuartil UpperQuartil LowerQuartil sub \pst@IQLfactor\space mul sub dup /MinVal ED put % replace with 1.5 IQL @@ -447,7 +450,7 @@ D\space##1% % newpath \psk@dotsize \@nameuse{psds@\psk@dotstyle} - 0 NArray Index get + 0 NArray Index get \psk@postAction\space Dot NArray Index UpperQuartil LowerQuartil sub \pst@IQLfactor\space mul UpperQuartil add dup /MaxVal ED put % replace with 1.5 IQL @@ -455,14 +458,17 @@ D\space##1% }{ 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 neg MaxVal \psk@postAction moveto % we are on top / lower whisker Endwidth dup add 0 rlineto + 0 MaxVal \psk@postAction moveto + 0 UpperQuartil \psk@postAction lineto % upper quartil +%% + MinVal \psk@postAction MaxVal \psk@postAction lt { + 0 LowerQuartil \psk@postAction moveto % line to lower whisker + 0 MinVal \psk@postAction lineto + Endwidth neg MinVal \psk@postAction moveto + Endwidth dup add 0 rlineto + } if gsave \pst@number\pslinewidth SLW \pst@usecolor\pslinecolor @@ -472,13 +478,13 @@ D\space##1% stroke grestore newpath - Barwidth neg LowerQuartil moveto % lower quartil - Barwidth neg UpperQuartil lineto + Barwidth neg LowerQuartil \psk@postAction moveto % lower quartil + Barwidth neg UpperQuartil \psk@postAction lineto Barwidth dup add 0 rlineto - Barwidth LowerQuartil lineto + Barwidth LowerQuartil \psk@postAction lineto closepath gsave \pst@usecolor\psfillcolor \tx@setTransparency fill grestore - Barwidth neg Median moveto % median + Barwidth neg Median \psk@postAction moveto % median Barwidth dup add 0 rlineto \pst@number\pslinewidth SLW \pst@usecolor\pslinecolor |