summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pstricks-add
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 /Master/texmf-dist/tex/generic/pstricks-add
parentbbf57f78a6acd818c39f6459e64afca17e9962f4 (diff)
pstricks-add 0.21/3.11 (13oct08)
git-svn-id: svn://tug.org/texlive/trunk@10962 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.tex123
1 files changed, 118 insertions, 5 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 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 %%%%%%%%