summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-10-14 00:08:06 +0000
committerKarl Berry <karl@freefriends.org>2008-10-14 00:08:06 +0000
commitdd666ba9d1d0d19c4331d45a0b0c99919f8acbc4 (patch)
tree56ccc6d435e5687e5c14bc455294529064edc91f
parentbbf57f78a6acd818c39f6459e64afca17e9962f4 (diff)
pstricks-add 0.21/3.11 (13oct08)
git-svn-id: svn://tug.org/texlive/trunk@10962 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/generic/pstricks-add/Changes5
-rw-r--r--Master/texmf-dist/doc/generic/pstricks-add/README5
-rw-r--r--Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdfbin1701030 -> 1712671 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex89
-rw-r--r--Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro46
-rw-r--r--Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex123
6 files changed, 226 insertions, 42 deletions
diff --git a/Master/texmf-dist/doc/generic/pstricks-add/Changes b/Master/texmf-dist/doc/generic/pstricks-add/Changes
index f6187245759..c64ec370cd9 100644
--- a/Master/texmf-dist/doc/generic/pstricks-add/Changes
+++ b/Master/texmf-dist/doc/generic/pstricks-add/Changes
@@ -1,6 +1,7 @@
-%% $Id: Changes 39 2008-08-27 21:17:28Z herbert $
+%% $Id: Changes 49 2008-10-13 10:59:27Z herbert $
%%
-pstricks-add.pro ----------- (Dominik Rodriguez/hv)
+pstricks-add.pro -----------
+ v 0.21 2008-10-13 - add bubblesort macro
v 0.20 2008-01-12 - moved the AlgParser into pst-algparser.pro
- moved Pyth2 and tan into pstricks.pro
v 0.14 2007-09-17 - moved Pyth2 into tx@Add part
diff --git a/Master/texmf-dist/doc/generic/pstricks-add/README b/Master/texmf-dist/doc/generic/pstricks-add/README
index 18403a4f3c4..68950ed0b46 100644
--- a/Master/texmf-dist/doc/generic/pstricks-add/README
+++ b/Master/texmf-dist/doc/generic/pstricks-add/README
@@ -1,8 +1,8 @@
pstricks-add redefines a lot of the pstricks macros and uses the extended
version of the keyval package. So be sure that you
-- pstricks-add depends on the pstricks.pro Version 1.01, 2005/09/18
+- pstricks-add depends on the pstricks.pro Version 1.05, 2008/06/25
you can get it from http://perce.de/LaTeX/pstricks/ or CTAN
-- load pstricks-add at last pstricks related package
+- load pstricks-add as last pstricks related package
- have installed xkeyval with the special pst-xkey
(CTAN: tex-archive/macros/latex/contrib/xkeyval/)
- do not load another package after pstricks-add, which loads
@@ -41,7 +41,6 @@ to the pstricks mailing list and has some more new features:
pstricks-add.pro : the prolog file for pstricks-add
-pstricks-add-doc.ltx: the main doc file
pstricks-add-doc.tex: the included doc file
Save the files pstricks-add.sty|pro|tex in a directory, which is part of your
diff --git a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf
index cb6aeb3be55..19e9b822ba7 100644
--- a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf
+++ b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex
index db6950f272c..bfebf8b1668 100644
--- a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex
+++ b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex
@@ -1,4 +1,4 @@
-%% $Id: pstricks-add-doc.tex 39 2008-08-27 21:17:28Z herbert $
+%% $Id: pstricks-add-doc.tex 49 2008-10-13 10:59:27Z herbert $
\documentclass[10pt]{article}
\listfiles
\usepackage{filecontents}
@@ -899,30 +899,10 @@
775 155126
776 155806
777 156377
-778 156692
-779 156734
-780 156883
-781 157412
-782 157929
-783 158547
-784 158764
-785 158973
-786 159385
-787 159416
-788 159637
-789 159670
-790 160103
-791 160549
-792 160679
-793 161283
-794 161951
-795 162320
-796 162776
-797 163374
-798 164039
-799 164090
-800 164460
-801 164947
+778 156692 779 156734 780 156883 781 157412 782 157929 783 158547
+784 158764 785 158973 786 159385 787 159416 788 159637 789 159670
+790 160103 791 160549 792 160679 793 161283 794 161951 795 162320
+796 162776 797 163374 798 164039 799 164090 800 164460 801 164947
802 165162 803 165373 804 165703 805 165906 806 166207 807 166815
808 167412 809 168041 810 168758 811 168994 812 169548 813 170116
814 170134 815 170275 816 170725 817 171110 818 171652 819 172034
@@ -8026,6 +8006,65 @@ est remarquable.
%--------------------------------------------------------------------------------------
+\section{\CMD{psBoxplot}}
+%--------------------------------------------------------------------------------------
+
+A box-and-whisker plot (often called simply a box plot) is a histogram-like method of
+displaying data, invented by John.\,Tukey. The box-and-whisker plot is a box with
+ends at the quartiles $Q_1$ and $Q_3$ and has a statistical median M as a horizontal line in
+the box. The "`whiskers"* are lines to the farthest points that are not outliers (i.e.,
+that are within 3/2 times the interquartile range of $Q_1$ and $Q_3$). Then, for every point
+more than 3/2 times the interquartile range from the end of a box, is a dot.
+
+The only special optional arguments, beside all other which are valid for drawing lines
+and filling areas, are \verb+IQLfactor+, \verb+barwidth+, and \verb+arrowlength+, where the latter is a factor
+which is multiplied with the barwidth for the line ends.
+The \verb+IQLfactor+, preset to 1.5, defines the area for the outliers.
+
+\begin{LTXexample}[pos=t,preset=\centering]
+\begin{pspicture}(-1,-1)(12,14)
+\psset{yunit=0.1,fillstyle=solid}
+\savedata{\data}[100 90 120 115 120 110 100 110 100 90 100 100 120 120 120]
+\rput(1,0){\psBoxplot[fillcolor=red!30]{\data}}
+\rput(1,105){2001}
+\savedata{\data}[90 120 115 116 115 110 90 130 120 120 120 85 100 130 130]
+\rput(3,0){\psBoxplot[arrowlength=0.5,fillcolor=blue!30]{\data}}
+\rput(3,107){2008}
+\savedata{\data}[35 70 90 60 100 60 60 80 80 60 50 55 90 70 70]
+\rput(5,0){\psBoxplot[barwidth=40pt,arrowlength=1.2,fillcolor=red!30]{\data}}
+\rput(5,65){2001}
+\savedata{\data}[60 65 60 75 75 60 50 90 95 60 65 45 45 60 90]
+\rput(7,0){\psBoxplot[barwidth=40pt,fillcolor=blue!30]{\data}}
+\rput(7,65){2008}
+\savedata{\data}[20 20 25 20 15 20 20 25 30 20 20 20 30 30 30]
+\rput(9,0){\psBoxplot[fillcolor=red!30]{\data}}
+\rput(9,22){2001}
+\savedata{\data}[20 30 20 35 35 20 20 60 50 20 35 15 30 20 40]
+\rput(11,0){\psBoxplot[fillcolor=blue!30,linestyle=dashed]{\data}}
+\rput(11,25){2008}
+\psaxes[dy=1cm,Dy=10](0,0)(12,130)
+\end{pspicture}
+\end{LTXexample}
+
+The next example uses an external file for the data, hich must first be read by the
+macro \verb+\readdata+.
+
+\begin{filecontents}{boxplot.data}
+2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32
+\end{filecontents}
+
+\begin{LTXexample}[width=5cm]
+\begin{pspicture}(-1,-1)(4,10)
+\psset{yunit=0.25,fillstyle=solid}
+\readdata{\data}{boxplot.data}
+\rput(1,0){\psBoxplot[fillcolor=blue!30]{\data}}
+\psaxes[dy=1cm,Dy=4](0,0)(4,35)
+\end{pspicture}
+\end{LTXexample}
+
+
+
+%--------------------------------------------------------------------------------------
\section{\CMD{psMatrixPlot}}
%--------------------------------------------------------------------------------------
\begin{filecontents}{matrix.dat}
diff --git a/Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro b/Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro
index 43bce4de57c..4bdeba0acad 100644
--- a/Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro
+++ b/Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro
@@ -1,6 +1,6 @@
-%% $Id: pstricks-add.pro 23 2008-05-15 21:51:18Z herbert $
+%% $Id: pstricks-add.pro 49 2008-10-13 10:59:27Z herbert $
% PostScript prologue for pstricks-add.tex.
-% Version 0.20, 2008/01/01
+% Version 0.21, 2008/10/15
% For distribution, see pstricks.tex.
%
% HISTORY -> see file Changes
@@ -27,13 +27,13 @@
/ShadingType 4 % single Gouraud
/ColorSpace [ /DeviceRGB ]
/DataSource ds
- >>
+ >>
shfill
closepath
mtrx
setmatrix grestore} def
%
-/RGBtoCMYK { % on stack r g b
+/RGBtoCMYK { % on stack r g b -> C M Y K
3 dict begin
/Blue ED /Green ED /Red ED
1 Red sub % Cyan
@@ -43,7 +43,7 @@
end
} def
%
-/CMYKtoGRAY { % c m y k on stack
+/CMYKtoGRAY { % on stack c m y k -> gray
exch 0.11 mul add
exch 0.59 mul add
exch 0.3 mul add
@@ -51,7 +51,7 @@
neg 1 add
} def
%
-/RGBtoGRAY {
+/RGBtoGRAY { % on stack r g b -> gray
0.11 mul
exch 0.59 mul add
exch 0.3 mul add
@@ -164,8 +164,40 @@
end
} bind def
%
+%%%%% ### bubblesort ###
+%% syntax : array bubblesort --> array2 trie par ordre croissant
+%% code de Bill Casselman
+%% http://www.math.ubc.ca/people/faculty/cass/graphics/text/www/
+/bubblesort {
+4 dict begin
+ /a exch def
+ /n a length 1 sub def
+ n 0 gt {
+ % at this point only the n+1 items in the bottom of a remain to
+ % the sorted largest item in that blocks is to be moved up into
+ % position n
+ n {
+ 0 1 n 1 sub {
+ /i exch def
+ a i get a i 1 add get gt {
+ % if a[i] > a[i+1] swap a[i] and a[i+1]
+ a i 1 add
+ a i get
+ a i a i 1 add get
+ % set new a[i] = old a[i+1]
+ put
+ % set new a[i+1] = old a[i]
+ put
+ } if
+ } for
+ /n n 1 sub def
+ } repeat
+ } if
+ a
+end
+} def
+%
end
%
% END pstricks-add.pro
-
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 f2484f32e49..5c8b1a67389 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 39 2008-08-27 21:17:28Z herbert $
+%% $Id: pstricks-add.tex 49 2008-10-13 10:59:27Z herbert $
%%
%%
%% This is file `pstricks-add.tex',
@@ -29,8 +29,8 @@
\ifx\MultidoLoaded\endinput\else \input multido \fi
\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi
%
-\def\fileversion{3.10}
-\def\filedate{2008/08/27}
+\def\fileversion{3.11}
+\def\filedate{2008/10/13}
\message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)}
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
@@ -183,7 +183,7 @@
\defineTColor{TGreen}{green}
\defineTColor{TBlue}{blue}
%
-\define@key[psset]{pstricks-add}{fsAngle}{\pst@getangle{#1}\pst@fsAngle }
+\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}
@@ -2485,6 +2485,7 @@
\let#1\pst@tempg
\global\let\pst@tempg\relax
\ignorespaces}
+
\gdef\readdata@{%
\read1 to \pst@tempA
\ifnum\linecnt=\psk@nStep
@@ -3278,6 +3279,117 @@
\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 [
% .....
@@ -3683,7 +3795,8 @@
braceWidthInner=10\pslinewidth,
braceWidthOuter=10\pslinewidth,
chartNodeI=0.75,
- chartNodeO=1.5
+ chartNodeO=1.5,
+ IQLfactor=1.5
}
\psset{%
%%%% pstricks %%%%%%%%