summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-01-27 01:42:29 +0000
committerKarl Berry <karl@freefriends.org>2010-01-27 01:42:29 +0000
commitaf846fbe6248cf5ca88c380c243617524dba6773 (patch)
treecd222ab9829996c5d375f56f216310631600f92b /Master/texmf-dist/tex/generic
parent6558da0729e1c500bec9acbfaa748066b84b02f4 (diff)
pst-func update (26jan10)
git-svn-id: svn://tug.org/texlive/trunk@16830 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r--Master/texmf-dist/tex/generic/pst-func/pst-func.tex86
1 files changed, 83 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-func/pst-func.tex b/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
index 863d4bfd28b..02b786a0df4 100644
--- a/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
+++ b/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
@@ -30,8 +30,8 @@
% interface to the `xkeyval' package
\pst@addfams{pst-func}
%
-\def\fileversion{0.64}
-\def\filedate{2010/01/20}
+\def\fileversion{0.66}
+\def\filedate{2010/01/25}
\message{`PST-func' v\fileversion, \filedate\space (hv)}
%
\pstheader{pst-func.pro}
@@ -709,7 +709,87 @@
\fi%
\ignorespaces%
}
-
+%
+\define@key[psset]{pst-func}{m}[0]{\def\psk@cauchy@m{#1 }}
+\define@key[psset]{pst-func}{b}[1]{\def\psk@cauchy@b{#1 }}
+\psset[pst-func]{m=0,b=1}
+%
+\def\psCauchy{\pst@object{psCauchy}}
+\def\psCauchy@i#1#2{{%
+ \pst@killglue%
+ \addbefore@par{plotpoints=200}%
+ \use@par%
+ \psplot[algebraic=false]{#1}{#2}{
+ \psk@cauchy@b dup dup mul x \psk@cauchy@m sub dup mul add div Pi div
+ }%
+}\ignorespaces}
+%
+\def\psCauchyI{\pst@object{psCauchyI}}
+\def\psCauchyI@i#1#2{{%
+ \pst@killglue%
+ \addbefore@par{plotpoints=200}%
+ \use@par%
+ \psplot[algebraic=false]{#1}{#2}{
+ x \psk@cauchy@m sub \psk@cauchy@b div ATAN1 DegtoRad Pi div 0.5 add
+ }%
+}\ignorespaces}
+%
+\define@boolkey[psset]{pst-func}[Pst@]{Gini}[true]{}
+\psset[pst-func]{Gini=false}
+%
+\def\psLorenz{\pst@object{psLorenz}}
+\def\psLorenz@i#1{{%
+ \readdata{\L@Data}{#1}%
+ \if@star\addto@par{fillstyle=solid,fillcolor=\pslinecolor}\fi
+ \use@par%
+ \def\Lorenz@code{
+ [ \L@Data\space counttomark dup
+ 1 sub /m ED 2 div cvi /n ED
+ ] dup /xyValues ED
+ mark exch % [ [x y x y ...]
+ aload pop % [ x y x y x y ... ]
+ n { exch div m 1 roll /m m 2 sub def } repeat
+ n array astore /yxdiv ED
+% xyValues == % [0.5 0.025 0.4 0.475 0.09 0.27 0.01 0.23]
+% yxdiv == % [23.0 3.0 1.1875 0.05]
+% yxdiv bubblesort == % [0.05 1.1875 3.0 23.0]
+ /X [0] def
+ /Y [0] def
+ 0 1 n 1 sub {
+ /Index ED
+ X aload pop xyValues Index 2 mul get X Index get add
+ Index 2 add array astore /X ED
+ Y aload pop xyValues Index 2 mul 1 add get Y Index get add
+ Index 2 add array astore /Y ED
+ } for
+% X == % [0 0.5 0.9 0.99 1.0]
+% Y == % [0 0.025 0.5 0.77 1.0]
+ 0 1 n { /Index ED X Index get Y Index get } for
+ \if@star 1 0 0 0 \fi
+ \ifPst@Gini
+ 0
+ 0 1 n 1 sub { /Index ED
+ Y Index 1 add get
+ xyValues Index 2 mul 1 add get 0.5 mul sub
+ xyValues Index 2 mul get mul
+ add
+ } for
+ 2 mul 1 sub neg
+ gsave \psk@PSfont findfont \psk@fontscale scalefont setfont
+ \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul cvi exch div } if
+ \psk@valuewidth string cvs /Output exch def % save output
+ \ifPst@comma % do we have to change dot to comma
+ 0 1 Output length 1 sub {
+ /Index exch def
+ Output Index get 46 eq { Output Index 44 put } if
+ } for
+ \fi
+ \psk@xShift\space -30 moveto (Gini: ) show
+ Output show grestore
+ \fi
+ }% filling the area under the curve.
+ \if@star\listplot*{\Lorenz@code}\else\listplot{\Lorenz@code}\fi%
+}\ignorespaces}
%
% Superellipese / Lamefunction
\define@key[psset]{pst-func}{radiusA}[1]{\pst@getlength{#1}\pst@radiusA}