summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-03-07 22:42:17 +0000
committerKarl Berry <karl@freefriends.org>2017-03-07 22:42:17 +0000
commitf99cc5a22fe69fa6f1b3f864c9185ec424fd2e49 (patch)
tree86b2c73d78b528b1375ea5a413535e912d144dda /Master
parenta6dc131e8a2ff8ce660543a262d771380fdf1b4e (diff)
pst-func (7mar17)
git-svn-id: svn://tug.org/texlive/trunk@43423 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/generic/pst-func/Changes1
-rw-r--r--Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdfbin3641191 -> 3693177 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex98
-rw-r--r--Master/texmf-dist/tex/generic/pst-func/pst-func.tex572
4 files changed, 492 insertions, 179 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-func/Changes b/Master/texmf-dist/doc/generic/pst-func/Changes
index 0dc37c0ca23..5ee0621abc9 100644
--- a/Master/texmf-dist/doc/generic/pst-func/Changes
+++ b/Master/texmf-dist/doc/generic/pst-func/Changes
@@ -1,4 +1,5 @@
..... pst-func.tex
+0.83 2017-03-07 - added some more macros for binomial distributions
0.82 2016-05-01 - psk@PontName->\psk@func@PointName (same name in pst-eucl)
0.81 2014-05-20 - changed \pstVerb to \pst@Verb in \psZero to allow
variables from tx@Dict
diff --git a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf
index 2b71cac8b1c..f037e3a5c4a 100644
--- a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf
+++ b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex
index 6530ae60883..c6f152ad565 100644
--- a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex
+++ b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex
@@ -1032,14 +1032,17 @@ and is predefined with 5.
\clearpage
+
+
+
\subsection{Binomial distribution}\label{sec:bindistri}
-These two macros plot binomial distribution, \Lcs{psBinomialN} the normalized one.
-It is always done in the $x$-Intervall $[0;1]$.
-Rescaling to another one can be done by setting the \Lkeyword{xunit} option
-to any other value.
+These five macros plot binomial probability mass function \Lcs{psBinomial} and \Lcs{psBinomialC} in curve style, the normalized one is \Lcs{psBinomialN}. The cumulative distribution function $F$ \Lcs{psBinomialF} and the complement of the cumulative distribution function to one ($1-F$) \Lcs{psBinomialFS}
+It is always done in the $y$-Intervall $[0;1]$.
+Rescaling to another one can be done by setting the \Lkeyword{yunit} option
+to any other value.
-The binomial distribution gives the discrete probability distribution $P_p(n|N)$ of obtaining
-exactly $n$ successes out of $N$ Bernoulli trials (where the result of each
+The binomial distribution \Lcs{psBinomial} gives the discrete probability distribution $P_p(n|N)$ of obtaining
+exactly $n$ successes out of $N$ Bernoulli trials (where the result of each
Bernoulli trial is true with probability $p$ and false with probability
$q=1-p$. The binomial distribution is therefore given by
@@ -1048,7 +1051,7 @@ P_p(n|N) &= \binom{N}{n}p^nq^{N-n} \\
&= \frac{N!}{n!(N-n)!}p^n(1-p)^{N-n},
\end{align}
-where $(N; n)$ is a binomial coefficient and $P$ the probability.
+where $(N; n)$ is a binomial coefficient and $P$ the probability.
The syntax is quite easy:
@@ -1056,14 +1059,21 @@ The syntax is quite easy:
\Lcs{psBinomial}\OptArgs\Largb{N}\Largb{probability p}\\
\Lcs{psBinomial}\OptArgs\Largb{m,N}\Largb{probability p}\\
\Lcs{psBinomial}\OptArgs\Largb{m,n,N}\Largb{probability p}\\
-\Lcs{psBinomialN}\OptArgs\Largb{N}\Largb{probability p}
+\Lcs{psBinomialC}\OptArgs\Largb{N}\Largb{probability p}\\
+\Lcs{psBinomialN}\OptArgs\Largb{N}\Largb{probability p}\\
+\Lcs{psBinomialF}\OptArgs\Largb{N}\Largb{probability p}\\
+\Lcs{psBinomialF}\OptArgs\Largb{m,N}\Largb{probability p}\\
+\Lcs{psBinomialF}\OptArgs\Largb{m,n,N}\Largb{probability p}\\
+\Lcs{psBinomialFS}\OptArgs\Largb{N}\Largb{probability p}\\
+\Lcs{psBinomialFS}\OptArgs\Largb{m,N}\Largb{probability p}\\
+\Lcs{psBinomialFS}\OptArgs\Largb{m,n,N}\Largb{probability p}
\end{BDef}
\begin{itemize}
\item with one argument $N$ the sequence $0\ldots N$ is calculated and plotted
-\item with two arguments $m,N$ the sequence $0\ldots N$ is calculated and
+\item with two arguments $m,N$ the sequence $0\ldots N$ is calculated and
the sequence $m\ldots N$ is plotted
-\item with three arguments $m,n,N$ the sequence $0\ldots N$ is calculated and
+\item with three arguments $m,n,N$ the sequence $0\ldots N$ is calculated and
the sequence $m\ldots n$ is plotted
\end{itemize}
@@ -1071,23 +1081,38 @@ There is a restriction in using the value for N. It depends to the probability,
one should expect problems with $N>100$. PostScript cannot handle such small values and there will
be no graph printed. This happens on PostScript side, so \TeX\ doesn't report any problem in
the log file. The valid options for the macros are \Lkeyword{markZeros} to draw rectangles instead
-of a continous line and \Lkeyword{printValue} for printing the $y$-values on top of the lines,
-rotated by 90\textdegree. For this option all other options from section~1
-for the macro \Lcs{psPrintValue} are valid, too.~ \cite{pst-tools} Important is the keyword \Lkeyword{valuewidth}
+of a continous line and \Lkeyword{printValue} for printing the $y$-values in the color LabelColor $=$ color on top of the lines in distance labelsep and xlabelsep, rotated by labelangle $=\alpha$. For this option all other options from section~1
+for the macro \Lcs{psPrintValue} are valid, too.~ \cite{pst-tools} Important is the keyword \Lkeyword{valuewidth}
which is preset to 10. If your value has more characters when converting into a string, it will
not be printed or cause an GhostScript error.
-The only special option is \Lkeyword{barwidth},
-which is a factor (no dimension) and set by default to 1. This option is only valid for
-the macro \Lcs{psBinomial} and not for the normalized one!
+Special options are
+\begin{itemize}
+\item \Lkeyword{barwidth}, which is a factor (no dimension) and set by default to 1. This option is not valid for
+the macro \Lcs{psBinomialN}!
+\item \Lkeyword{labelangle} is the rotation of the printed values, default is 90\textdegree
+\item \Lkeyword{xlabelsep} is the x-separation of the printed values, default is 0 (no dimension)
+\item \Lkeyword{labelsep} is the y-separation of the printed values, default is 0.2 (no dimension)
+\item \Lkeyword{LabelColor} is the color of the printed values, default is black
+\item \Lkeyword{LineEnding} this boolean is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS}, default is true. Draws circles at the end of the lines
+\item \Lkeyword{VLines} this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS}, default is false. Draws the vertical lines dashed.
+\item \Lkeyword{rightEnd}, this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) and $n=N$, default is 2
+\item \Lkeyword{leftEnd}, this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) and $m=0$, default is 1
+\item \Lkeyword{radiusout}, this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) for the outer radius of the both dots left and right, default is 2
+\item \Lkeyword{radiusinL}, this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) for the inner radius of the left dot, default is 0
+\item \Lkeyword{radiusinR}, this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) for the inner radius of the right dot, default is 1.5
+\item \Lkeyword{LineEndColorL} this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) for the color of the left dot, default is green
+\item \Lkeyword{LineEndColorR} this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) for the inner radius of the right dot, default is red
+\end{itemize}
\psset[pst-func]{barwidth=1}
\begin{LTXexample}[pos=t,preset=\centering]
\psset{xunit=1cm,yunit=5cm}%
-\begin{pspicture}(-1,-0.15)(7,0.55)%
+\begin{pspicture}(-1,-0.15)(7,0.6)%
\psaxes[Dy=0.2,dy=0.2\psyunit]{->}(0,0)(-1,0)(7,0.5)
\uput[-90](7,0){$k$} \uput[90](0,0.5){$P(X=k)$}
-\psBinomial[markZeros,printValue,fillstyle=vlines]{6}{0.4}
+\psBinomial[markZeros,printValue,fillstyle=vlines,
+labelangle=80,LabelColor=blue]{6}{0.4}
\end{pspicture}
\end{LTXexample}
@@ -1096,8 +1121,9 @@ the macro \Lcs{psBinomial} and not for the normalized one!
\begin{pspicture}(-1,-0.05)(8,0.6)%
\psaxes[Dy=0.2,dy=0.2\psyunit]{->}(0,0)(-1,0)(8,0.5)
\uput[-90](8,0){$k$} \uput[90](0,0.5){$P(X=k)$}
+\psBinomialC[fillstyle=solid,opacity=0.5,fillcolor=cyan,plotstyle=curve]{7}{0.6}
\psBinomial[linecolor=red,markZeros,printValue,fillstyle=solid,
- fillcolor=blue,barwidth=0.2]{7}{0.6}
+ fillcolor=blue,barwidth=0.2,xlabelsep=-0.05]{7}{0.6}
\end{pspicture}
\end{LTXexample}
@@ -1109,6 +1135,7 @@ the macro \Lcs{psBinomial} and not for the normalized one!
\psBinomial[linecolor=black!30]{0,7}{0.6}
\psBinomial[linecolor=blue,markZeros,printValue,fillstyle=solid,
fillcolor=blue,barwidth=0.4]{2,5,7}{0.6}
+\psBinomialC[,showpoints=true,plotstyle=curve]{7}{0.6}
\end{pspicture}
\end{LTXexample}
@@ -1125,6 +1152,35 @@ the macro \Lcs{psBinomial} and not for the normalized one!
\end{pspicture*}
\end{LTXexample}
+\begin{LTXexample}[pos=t,preset=\centering]
+\psset{xunit=0.8cm,yunit=8cm}%
+\begin{pspicture*}[showgrid=false](-1.5,-0.1)(16,1.2)%
+\psset{arrowscale=1.3,arrowinset=0.05,arrowlength=1.9,comma}%
+\psaxes[labelFontSize=\scriptstyle,xticksize=0 1.07,yticksize=0 16,tickcolor=gray!50,
+ Dy=0.1,dy=0.1,Dx=1,dx=1,Ox=0]{->}(0,0)(-0.9,0)(16,1.1)
+\uput[-90](15.8,0){$z$}\uput[0](0,1.1){$P_{0,15}^{100}(Z=z)$}
+\psBinomialC[linecolor=cyan,fillstyle=solid,fillcolor=cyan!50,opacity=0.4,plotstyle=curve]{40}{0.15}%
+\psBinomial[markZeros,linecolor=BrickRed,fillstyle=solid,fillcolor=BrickRed,barwidth=0.75,opacity=0.6]{1,16,40}{0.15}%
+\psBinomialFS[markZeros,linecolor=Green,fillstyle=solid,fillcolor=orange,barwidth=0.3,opacity=0.6]{0,16,40}{0.15}%
+\psBinomialF[linecolor=gray,fillstyle=solid,fillcolor=yellow,barwidth=0.4,opacity=0.5]{3,16,40}{0.15}
+\end{pspicture*}
+\end{LTXexample}
+
+\begin{LTXexample}[pos=t,preset=\centering]
+\psset{xunit=0.75cm,yunit=7.5cm}%
+\begin{pspicture*}[showgrid=false](-1.3,-0.067)(14.67,1.13)%
+\psset{arrowscale=1.3,arrowinset=0.05,arrowlength=1.9,comma}
+\psaxes[labelFontSize=\scriptstyle,xticksize=0 1.07,yticksize=0 12,tickcolor=gray!50,Dy=0.1,dy=0.1,Dx=1,dx=1,Ox=0]{->}(0,0)(-0.9,0)(14,1.1)
+\uput[-90](13.8,0){$z$} \uput[0](0,1.08){$F_{0,7}^{10}(Z\leq z)$}
+\psBinomial[markZeros,linecolor=orange,fillstyle=solid,fillcolor=orange,barwidth=1,opacity=0.5]{0,10,10}{0.7}
+\psBinomialF[markZeros,linecolor=blue,linewidth=0.7pt,barwidth=0.2,
+opacity=0.5,fillstyle=solid,fillcolor=blue,valuewidth=15]{0,13,10}{0.7}
+\psBinomialFS[LineEnding=false,linecolor=BrickRed,linewidth=0.9pt,VLines=true]{0,10,10}{0.7}
+\psBinomialF[linecolor=Green,printValue=false,linewidth=1.2pt,LineEndColorR=BrickRed,LineEndColorL=Green!70,
+radiusout=3.5,radiusinL=0,radiusinR=2,LineEnding=true,leftEnd=1,rightEnd=3]{0,10,10}{0.7}
+\end{pspicture*}
+\end{LTXexample}
+
The default binomial distribution has the mean of $\mu=E(X)=N\cdot p$
and a variant of $\sigma^2=\mu\cdot(1-p)$.
The normalized distribution has a mean of $0$. Instead of $P(X=k)$
@@ -1166,7 +1222,7 @@ P(k) = P(k-1)\cdot\frac{N-k+1}{k}\cdot\frac{p}{1-p}
\end{pspicture*}
\end{LTXexample}
-For the normalized distribution the plotstyle can be set to \Lkeyval{curve} (\Lkeyset{plotstyle=curve}),
+For the normalized distribution the plotstyle can be set to \Lkeyval{curve} (\Lkeyset{plotstyle=curve}),
then the binomial distribution looks like a normal distribution. This option is only
valid for \Lcs{psBinomialN}. The option \Lkeyword{showpoints} is valid if \Lkeyval{curve} was chosen.
@@ -1190,6 +1246,8 @@ valid for \Lcs{psBinomialN}. The option \Lkeyword{showpoints} is valid if \Lkeyv
\end{pspicture*}
\end{LTXexample}
+
+
\clearpage
\subsection{Poisson distribution}
Given a Poisson process\footnote{\url{http://mathworld.wolfram.com/PoissonProcess.html}},
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 579d344acf8..7d42c7f194d 100644
--- a/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
+++ b/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
@@ -19,7 +19,7 @@
%%
\csname PSTfuncLoaded\endcsname
\let\PSTfuncLoaded\endinput
-% Requires some PSTricks packages
+% Requires some PSTricks packages
\ifx\PSTricksLoaded\endinput\else \input pstricks.tex\fi
\ifx\PSTnodesLoaded\endinput\else \input pst-plot.tex\fi
\ifx\PSTmathLoaded\endinput \else \input pst-math.tex\fi
@@ -31,8 +31,8 @@
% interface to the `xkeyval' package
\pst@addfams{pst-func}
%
-\def\fileversion{0.82}
-\def\filedate{2016/05/01}
+\def\fileversion{0.83}
+\def\filedate{2017/03/07}
\message{`PST-func' v\fileversion, \filedate\space (hv)}
%
\pstheader{pst-func.pro}
@@ -94,7 +94,7 @@
coeff=0 1, % coeff=a0 a1 a2 a3 ...
Derivation=0, % 0 is the original function
markZeros=false,% no dots for the zeros
- epsZero=0.1, % the distance between two zero points
+ epsZero=0.1, % the distance between two zero points
dZero=0.1, % the distance of the x value for scanning the function
zeroLineTo=-1, % a line to the value of the lineTo's Derivation (-1= none)
zeroLineStyle=dashed,%
@@ -139,7 +139,7 @@
y0 % the returned value ist the zero point
0 \tx@ScreenCoor pstack
3 0 360 arc gsave 0 0 1 setrgbcolor fill grestore 1 setlinewidth stroke
-} def
+} def
\fi
%
\def\psPolynomial{\pst@object{psPolynomial}}
@@ -157,7 +157,7 @@
/dx x1 x0 sub \psk@plotpoints\space div def
/Derivation \psk@Derivation\space def
/x x0 def
- \ifPst@markZeros
+ \ifPst@markZeros
5 dict begin % hold all local!
gsave
\pst@number\psk@zeroLineWidth SLW
@@ -168,10 +168,10 @@
xZero \pst@number\psxunit mul /xPixel exch def
\psk@dotsize
\@nameuse{psds@\psk@dotstyle}%
- xPixel 0 Dot
+ xPixel 0 Dot
\psk@zeroLineTo\space 0 ge { % line to function \psk@lineTo
xPixel 0 moveto
- xZero coeff \psk@zeroLineTo\space FuncValue
+ xZero coeff \psk@zeroLineTo\space FuncValue
\pst@number\psyunit mul xPixel exch L
\@nameuse{psls@\psk@zeroLineStyle}
} if
@@ -180,7 +180,7 @@
end
\fi
/xy {
- x \psk@xShift\space sub coeff Derivation FuncValue \pst@number\psyunit mul
+ x \psk@xShift\space sub coeff Derivation FuncValue \pst@number\psyunit mul
x \pst@number\psxunit mul exch
} def
xy moveto
@@ -210,7 +210,7 @@
mark
/n 2 def
\psk@plotpoints {
- xy
+ xy
n 2 roll
/n n 2 add def
/x x dx add def
@@ -257,13 +257,13 @@
\psplot{#2}{#3}[ /nue \psk@nue def /epsilon 1e-20 def ]{%
/Sum 0 def
/Iter 0 def
- {/Sum_Iter
+ {/Sum_Iter
x dup mul 4 div Iter exp % nominator
nue Iter add 1 add GAMMA Iter tx@AddMathFunc begin ! end mul % denominator
Div def
Sum_Iter abs epsilon lt { exit } if
/Sum Sum Sum_Iter add def
- /Iter Iter 1 add def
+ /Iter Iter 1 add def
} loop
x 0.5 mul nue exp Sum mul
}%
@@ -280,7 +280,7 @@
\psset{plotpoints=200}%
\psset{#1}%
\psplot[algebraic=false]{#2}{#3}{%
- Euler x \psk@mue sub dup mul 2 div \psk@sigma dup mul div neg exp
+ Euler x \psk@mue sub dup mul 2 div \psk@sigma dup mul div neg exp
1.0 \psk@sigma div TwoPi sqrt div mul%
}%
}\ignorespaces}
@@ -296,20 +296,20 @@
/a #1 def
/dx #2 #1 sub \psk@plotpoints\space div def
/b a dx add def
- /scx { \pst@number\psxunit mul } def
+ /scx { \pst@number\psxunit mul } def
/scy { \pst@number\psyunit mul } def
- tx@FuncDict begin
+ tx@FuncDict begin
/C 1 \psk@sigma div TwoPi sqrt div def
/SFunc {% x on Stack
- Euler exch \psk@mue\space sub dup mul 2 div \psk@sigma\space dup mul div neg exp C mul
- } def
+ Euler exch \psk@mue\space sub dup mul 2 div \psk@sigma\space dup mul div neg exp C mul
+ } def
end
% a scx 0 moveto
a scx 0 \@nameuse{beginqp@\psplotstyle}
\psk@plotpoints 1 sub {
a b \psk@Simpson % a b M on Stack
tx@FuncDict begin Simpson I end % y value on stack
- scy b scx exch \@nameuse{doqp@\psplotstyle} %lineto
+ scy b scx exch \@nameuse{doqp@\psplotstyle} %lineto
/b b dx add def
} repeat
% stroke
@@ -397,17 +397,17 @@
\def\psPrintValue@i#1{\expandafter\psPrintValue@ii#1,,\@nil}
\def\psPrintValue@ii#1,#2,#3\@nil{% #1,#2 only for algebraic code
\begin@SpecialObj
- \addto@pscode{
- gsave \psk@PSfont findfont \psk@fontscale scalefont setfont
- \ifPst@algebraic
- /x #1 def
- /Func (#2) tx@AlgToPs begin AlgToPs end cvx def
- Func
+ \addto@pscode{
+ gsave \psk@PSfont findfont \psk@fontscale scalefont setfont
+ \ifPst@algebraic
+ /x #1 def
+ /Func (#2) tx@AlgToPs begin AlgToPs end cvx def
+ Func
\else #1 \fi
\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 dot2comma \fi % do we have to change dot to comma
- \psk@xShift\space 0 moveto %Output
+ \psk@xShift\space 0 moveto %Output
show grestore
}%
\end@SpecialObj%
@@ -425,20 +425,20 @@
/mfont { \psk@PSfont findfont \psk@fontscale scalefont setfont } bind def
/mfontexp { \psk@PSfont findfont \psk@fontscale 1.2 div scalefont setfont } bind def
/s1 { /Symbol findfont \psk@fontscale scalefont setfont } bind def
- \ifPst@algebraic
+ \ifPst@algebraic
/x #1 def
- /Func (#2) tx@AlgToPs begin AlgToPs end cvx def
- Func
+ /Func (#2) tx@AlgToPs begin AlgToPs end cvx def
+ Func
\else #1 \fi
/value ED
\psk@Scin {
value 0 ne { value log floor cvi /expon ED }{ /expon 0 def } ifelse
- value 10 expon exp div
- \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul
+ value 10 expon exp div
+ \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul
\ifPst@round round \else cvi \fi exch div } if
\psk@decimals 0 eq { cvi } if /numb ED
expon \psk@valuewidth string cvs /expon exch def
- numb \psk@valuewidth string cvs
+ numb \psk@valuewidth string cvs
\ifPst@comma dot2comma \fi % do we have to change dot to comma
/Output exch def
/txspc \psk@fontscale 4 div def
@@ -447,12 +447,12 @@
txspc 0 rmoveto mfont (10) show
txspc 2 div txspc 1.5 mul rmoveto mfontexp expon show }
{ value
- \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul
+ \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul
\ifPst@round round \else cvi \fi exch div } if
\psk@decimals 0 eq { cvi } if %inserted to handle decimals=0
- \psk@valuewidth string cvs
+ \psk@valuewidth string cvs
\ifPst@comma dot2comma \fi % do we have to change dot to comma
- \psk@xShift\space 0 moveto mfont %Output
+ \psk@xShift\space 0 moveto mfont %Output
show
} ifelse
}%
@@ -522,8 +522,22 @@
}%
%
\define@boolkey[psset]{pst-func}[Pst@]{printValue}[true]{}
+\define@boolkey[psset]{pst-func}[Pst@]{LineEnding}[true]{}
+\define@boolkey[psset]{pst-func}[Pst@]{VLines}[true]{}
\define@key[psset]{pst-func}{barwidth}[1]{\def\psFunc@barwidth{#1 }}% a factor, not a dimen
-\psset[pst-func]{printValue=false,barwidth=1}
+\define@key[psset]{pst-func}{rightEnd}[2]{\def\psFunc@rightEnd{#1 }}
+\define@key[psset]{pst-func}{leftEnd}[2]{\def\psFunc@leftEnd{#1 }}
+\define@key[psset]{pst-func}{labelangle}[90]{\def\psFunc@langle{#1 }}
+\define@key[psset]{pst-func}{xlabelsep}[0]{\def\psFunc@xlabelsep{#1 }}
+\define@key[psset]{pst-func}{radiusout}[2]{\def\psFunc@radiusout{#1 }}
+\define@key[psset]{pst-func}{radiusinL}[0]{\def\psFunc@radiusinL{#1 }}
+\define@key[psset]{pst-func}{radiusinR}[1.5]{\def\psFunc@radiusinR{#1 }}
+\define@key[psset]{pst-func}{LabelColor}[black]{\pst@getcolor{#1}\psk@LabelColor}
+\define@key[psset]{pst-func}{LineEndColorL}[green]{\pst@getcolor{#1}\psk@LineEndColorL}
+\define@key[psset]{pst-func}{LineEndColorR}[red]{\pst@getcolor{#1}\psk@LineEndColorR}
+\define@key[psset]{pst-func}{vlinestyle}[solid]{\def\psvlinestyle{#1}}
+\psset[pst-func]{printValue=false,barwidth=1,labelangle=90,xlabelsep=0,LabelColor=black,LineEndColorL=green,LineEndColorR=red,
+radiusout=2,radiusinL=0,radiusinR=1.5,LineEnding=true,leftEnd=1,rightEnd=2,VLines=false}
%
\def\psBinomial{\pst@object{psBinomial}}
\def\psBinomial@i#1#2{\psBinomial@ii#1,,,\@nil{#2}}%
@@ -565,12 +579,12 @@
kOld scx Y scy L k dx add scx Y scy L
\ifPst@markZeros k dx add scx 0 L kOld 1 add scx 0 L \fi
\ifPst@printValue
- gsave \psk@PSfont findfont \psk@fontscale scalefont setfont
- Y \psk@valuewidth string cvs
+ gsave \psk@PSfont findfont \psk@fontscale scalefont setfont \pst@usecolor\psk@LabelColor %
+ Y \psk@valuewidth string cvs
\ifPst@comma dot2comma \fi
- k scx \psk@fontscale 2 div add
+ k scx \psk@fontscale 2 div add \psFunc@xlabelsep scx add
Y scy \pst@number\pslabelsep add moveto
- 90 rotate show grestore
+ \psFunc@langle rotate show grestore
\fi
/kOld kOld 1 add def
} for
@@ -581,64 +595,304 @@
\end@OpenObj%
}%
%
-\def\psBinomialN{\pst@object{psBinomialN}}
+\def\psBinomialN{\pst@object{psBinomialN}}%
\def\psBinomialN@i#1#2{%
+\leavevmode
+\pst@killglue
+\begingroup
+\use@par
+\init@pscode
+\def\cplotstyle{curve}%
+\ifx\psplotstyle\cplotstyle \@nameuse{beginplot@\psplotstyle}\fi
+\addto@pscode{%
+\ifx\psplotstyle\cplotstyle /Curve true def \else /Curve false def \fi
+ /scx { \pst@number\psxunit mul } def
+ /scy { \pst@number\psyunit mul } def
+ /N #1 def
+ /p #2 def % probability
+ /q 1 p sub def
+ /E N p mul def
+ /sigma E q mul sqrt def % variant
+ /dx 1.0 sigma div 2 div def
+ /xOld dx neg E sub sigma div def
+ /xEnd xOld neg dx add scx def
+ Curve
+ { /Coors [xOld dx sub scx 0] def }% saves the coordinates for curve
+ { xOld scx 0 moveto } % starting point
+ ifelse
+ 0 1 N {% % N times
+ /k exch def % save loop variable
+ k 0 eq
+ { /Y q N exp def }
+ { /Y Y N k sub 1 add mul k div p mul q div def }
+ ifelse % recursive definition
+ /x k E sub sigma div dx add def
+ /y Y sigma mul def % normalize
+ Curve
+ { x dx sub scx y scy Coors aload length 2 add array astore /Coors exch def}
+ { xOld scx y scy L x scx y scy L
+ \ifPst@markZeros x scx 0 L \fi %
+ } ifelse
+ \ifPst@printValue
+ gsave \psk@PSfont findfont \psk@fontscale scalefont setfont \pst@usecolor\psk@LabelColor %
+ y \psk@valuewidth string cvs %/Output exch def
+ \ifPst@comma dot2comma \fi % do we have to change dot to comma
+ x dx sub scx \psk@fontscale 2 div add \psFunc@xlabelsep scx add
+ y scy \pst@number\pslabelsep add moveto
+ \psFunc@langle rotate show grestore
+ \fi
+ /xOld x def
+ } for
+ Curve { [ xEnd 0 Coors aload pop } if% showpoints on top of the stack
+}%
+\ifx\psplotstyle\cplotstyle\@nameuse{endplot@\psplotstyle}\else
+\psk@fillstyle
+\pst@stroke
+\fi
+\use@pscode
+\endgroup
+\ignorespaces%
+}%
+\def\psBinomialF{\pst@object{psBinomialF}}
+\def\psBinomialF@i#1#2{\psBinomialF@ii#1,,,\@nil{#2}}%
+\def\psBinomialF@ii#1,#2,#3,#4\@nil#5{%
+ \def\pst@tempA{#2}%
+ \ifx\pst@tempA\@empty
+ \psBinomialF@iii{0}{#1}{#1}{#5}%
+ \else
+ \def\pst@tempA{#3}%
+ \ifx\pst@tempA\@empty\psBinomialF@iii{#1}{#2}{#2}{#5}%
+ \else\psBinomialF@iii{#1}{#2}{#3}{#5}\fi
+ \fi}%
+\def\psBinomialF@iii#1#2#3#4{%
+ \begin@OpenObj%
+ \addto@pscode{
+ /scx { \pst@number\psxunit mul } def
+ /scy { \pst@number\psyunit mul } def
+ /m #1 def
+ /n #2 def
+ /N #3 def
+ /p #4 def
+ /dx \psFunc@barwidth 2 div def
+ /q 1 p sub def
+ \ifPst@markZeros /kOld dx neg m add def \else
+ /kOld m def \fi
+ kOld scx 0 moveto % starting point
+ 0 1 m 1 sub {
+ /k exch def % save loop variable
+ k 0 eq
+ { /Y q N exp def
+ /F Y def}
+ { /Y Y N k sub 1 add mul k div p mul q div def
+ /F F Y add def}
+ ifelse
+ } for
+ m 1 n { % n-m+1 times
+ /k exch def % save loop variable
+ k 0 eq
+ { /Y q N exp def
+ /F Y def}
+ { /Y Y N k sub 1 add mul k div p mul q div def
+ /F F Y add def}
+ ifelse % recursive definition
+ \ifPst@markZeros kOld scx F scy L k dx add scx F scy L k dx add scx 0 L kOld 1 add scx 0 L
+ \else
+ \ifPst@LineEnding
+ k 0 eq
+ { }
+ { kOld scx F scy newpath \psFunc@radiusout 0 360 arc kOld scx F scy \psFunc@radiusinL 360 0 arcn closepath \pst@usecolor\psk@LineEndColorL fill } ifelse \fi
+ kOld \ifPst@LineEnding\psFunc@radiusout\pst@number\psxunit div add \fi
+ k 0 eq
+ { \psFunc@leftEnd sub }
+ { } ifelse
+ scx F scy moveto
+ k 1 add
+ \ifPst@LineEnding\psFunc@radiusout\pst@number\psxunit div sub \fi
+ k N eq
+ { \psFunc@rightEnd add }
+ { } ifelse
+ scx F scy L \pst@usecolor\pslinecolor [1 0] 0 setdash stroke
+ \ifPst@LineEnding
+ k N eq
+ { }
+ { k 1 add scx F scy newpath \psFunc@radiusout 0 360 arc k 1 add scx F scy \psFunc@radiusinR 360 0 arcn closepath \pst@usecolor\psk@LineEndColorR fill }
+ ifelse
+ \ifPst@VLines
+ Y \psFunc@radiusout\pst@number\psyunit div 2 mul le
+ { }
+ { k scx F Y sub \psFunc@radiusout\pst@number\psyunit div add scy moveto k scx F \psFunc@radiusout\pst@number\psyunit div sub scy L \pst@usecolor\pslinecolor [3 2] 0 setdash stroke } ifelse \fi
+ \else
+ \ifPst@VLines
+ Y \psFunc@radiusout\pst@number\psyunit div 0.1 mul le
+ { }
+ { k scx F Y sub scy moveto k scx F scy L \pst@usecolor\pslinecolor [3 2] 0 setdash stroke } ifelse
+ \fi\fi\fi
+ \ifPst@printValue
+ gsave \psk@PSfont findfont \psk@fontscale scalefont setfont \pst@usecolor\psk@LabelColor %
+ F \psk@valuewidth string cvs
+ \ifPst@comma dot2comma \fi
+ k scx \psk@fontscale 2 div add \psFunc@xlabelsep scx add
+ F scy \pst@number\pslabelsep add moveto
+ \psFunc@langle rotate show grestore
+ \fi
+ /kOld kOld 1 add def
+ } for
+ }%
+ \end@OpenObj%
+}%
+%
+\def\psBinomialFS{\pst@object{psBinomialFS}}
+\def\psBinomialFS@i#1#2{\psBinomialFS@ii#1,,,\@nil{#2}}%
+\def\psBinomialFS@ii#1,#2,#3,#4\@nil#5{%
+ \def\pst@tempA{#2}%
+ \ifx\pst@tempA\@empty
+ \psBinomialFS@iii{0}{#1}{#1}{#5}%
+ \else
+ \def\pst@tempA{#3}%
+ \ifx\pst@tempA\@empty\psBinomialFS@iii{#1}{#2}{#2}{#5}%
+ \else\psBinomialFS@iii{#1}{#2}{#3}{#5}\fi
+ \fi}%
+\def\psBinomialFS@iii#1#2#3#4{%
+ \begin@OpenObj%
+ \addto@pscode{
+ /scx { \pst@number\psxunit mul } def
+ /scy { \pst@number\psyunit mul } def
+ /m #1 def
+ /n #2 def
+ /N #3 def
+ /p #4 def
+ /dx \psFunc@barwidth 2 div def
+ /q 1 p sub def
+ \ifPst@markZeros /kOld dx neg m add def \else
+ /kOld m def \fi
+ kOld scx 0 moveto % starting point
+ 0 1 m 1 sub {
+ /k exch def % save loop variable
+ k 0 eq
+ { /Y q N exp def
+ /F Y def
+ /FS 1 F sub def}
+ { /Y Y N k sub 1 add mul k div p mul q div def
+ /F F Y add def
+ /FS 1 F sub def}
+ ifelse
+ } for
+ m 1 n { % n-m+1 times
+ /k exch def % save loop variable
+ k 0 eq
+ { /Y q N exp def
+ /F Y def
+ /FS 1 F sub def}
+ { /Y Y N k sub 1 add mul k div p mul q div def
+ /F F Y add def
+ /FS 1 F sub def}
+ ifelse % recursive definition
+ \ifPst@markZeros kOld scx FS scy L k dx add scx FS scy L k dx add scx 0 L kOld 1 add scx 0 L
+ \else
+ \ifPst@LineEnding
+ k 0 eq
+ { }
+ { kOld scx FS scy newpath \psFunc@radiusout 0 360 arc kOld scx FS scy \psFunc@radiusinL 360 0 arcn closepath \pst@usecolor\psk@LineEndColorL fill } ifelse \fi
+ kOld \ifPst@LineEnding\psFunc@radiusout\pst@number\psxunit div add \fi
+ k 0 eq
+ { \psFunc@leftEnd sub }
+ { } ifelse
+ scx FS scy moveto
+ k 1 add
+ \ifPst@LineEnding\psFunc@radiusout\pst@number\psxunit div sub \fi
+ k N eq
+ { \psFunc@rightEnd add }
+ { } ifelse
+ scx FS scy L \pst@usecolor\pslinecolor [1 0] 0 setdash stroke
+ \ifPst@LineEnding
+ k N eq
+ { }
+ { k 1 add scx FS scy newpath \psFunc@radiusout 0 360 arc k 1 add scx FS scy \psFunc@radiusinR 360 0 arcn closepath \pst@usecolor\psk@LineEndColorR fill }
+ ifelse
+ \ifPst@VLines
+ Y \psFunc@radiusout\pst@number\psyunit div 2 mul le
+ { }
+ { k scx FS Y add \psFunc@radiusout\pst@number\psyunit div sub scy moveto k scx FS \psFunc@radiusout\pst@number\psyunit div add scy L \pst@usecolor\pslinecolor [3 2] 0 setdash stroke } ifelse \fi
+ \else
+ \ifPst@VLines
+ Y \psFunc@radiusout\pst@number\psyunit div 0.1 mul le
+ { }
+ { k scx FS Y add scy moveto k scx FS scy L \pst@usecolor\pslinecolor [3 2] 0 setdash stroke } ifelse
+ \fi\fi\fi
+ \ifPst@printValue
+ gsave \psk@PSfont findfont \psk@fontscale scalefont setfont \pst@usecolor\psk@LabelColor %
+ FS \psk@valuewidth string cvs
+ \ifPst@comma dot2comma \fi
+ k scx \psk@fontscale 2 div add \psFunc@xlabelsep scx add
+ FS scy \pst@number\pslabelsep add moveto
+ \psFunc@langle rotate show grestore
+ \fi
+ /kOld kOld 1 add def
+ } for
+ }%
+ \end@OpenObj%
+}%
+%
+\def\psBinomialC{\pst@object{psBinomialC}}
+\def\psBinomialC@i#1#2{%
\leavevmode
\pst@killglue
\begingroup
\use@par
\init@pscode
\def\cplotstyle{curve}%
- \ifx\psplotstyle\cplotstyle \@nameuse{beginplot@\psplotstyle} \fi%
- \addto@pscode{
+ \ifx\psplotstyle\cplotstyle \@nameuse{beginplot@\psplotstyle}\fi
+ \addto@pscode{%
\ifx\psplotstyle\cplotstyle /Curve true def \else /Curve false def \fi
- /scx { \pst@number\psxunit mul } def
+ /scx { \pst@number\psxunit mul } def
/scy { \pst@number\psyunit mul } def
- /N #1 def
- /p #2 def % probability
- /q 1 p sub def
- /E N p mul def
- /sigma E q mul sqrt def % variant
+ /N #1 def
+ /p #2 def % Wahrscheinlichkeit
+ /q 1 p sub def % q = 1 - p
+ /E N p mul def % Erwartungswert
+ /sigma E q mul sqrt def % Varianz
/dx 1.0 sigma div 2 div def
/xOld dx neg E sub sigma div def
- /xEnd xOld neg dx add scx def
- Curve
+ /xEnd xOld neg E add dx add scx def
+% /xOld dx neg sigma div def
+% /xEnd xOld neg dx add scx def
+ Curve
{ /Coors [xOld dx sub scx 0] def }% saves the coordinates for curve
{ xOld scx 0 moveto } % starting point
- ifelse
+ ifelse
0 1 N { % N times
/k exch def % save loop variable
- k 0 eq
+ k 0 eq
{ /Y q N exp def }
{ /Y Y N k sub 1 add mul k div p mul q div def }
ifelse % recursive definition
- /x k E sub sigma div dx add def
- /y Y sigma mul def % normalize
- Curve
+ /x k 1 div dx add def
+ /y Y 1 mul def % normalize
+ Curve
{ x dx sub scx y scy Coors aload length 2 add array astore /Coors exch def}
{ xOld scx y scy L x scx y scy L
- \ifPst@markZeros x scx 0 L \fi %
+ \ifPst@markZeros x scx 0 L \fi %
} ifelse
- \ifPst@printValue
- gsave \psk@PSfont findfont \psk@fontscale scalefont setfont
+ \ifPst@printValue
+ gsave \psk@PSfont findfont \psk@fontscale scalefont setfont \pst@usecolor\psk@LabelColor %
y \psk@valuewidth string cvs %/Output exch def
\ifPst@comma dot2comma \fi % do we have to change dot to comma
- x dx sub scx \psk@fontscale 2 div add
- y scy \pst@number\pslabelsep add moveto
- 90 rotate show grestore
+ x dx sub scx \psk@fontscale 2 div add \psFunc@xlabelsep scx add
+ y scy \pst@number\pslabelsep add moveto
+ \psFunc@langle rotate show grestore
\fi
/xOld x def
} for
- Curve { [ xEnd 0 Coors aload pop } if % showpoints on top of the stack
+ Curve { [ xEnd 0 Coors aload pop } if% showpoints on top of the stack
}%
- \ifx\psplotstyle\cplotstyle\@nameuse{endplot@\psplotstyle}\else%
- \psk@fillstyle%
- \pst@stroke%
- \fi%
- \use@pscode%
- \endgroup%
- \ignorespaces%
-}
+\ifx\psplotstyle\cplotstyle\@nameuse{endplot@\psplotstyle}\else
+ \psk@fillstyle
+ \pst@stroke
+\fi
+\use@pscode
+\endgroup
+\ignorespaces}
+%
%
\def\psPoisson{\pst@object{psPoisson}}% with contributions from Gerry Coombes
\def\psPoisson@i#1#2{\psPoisson@ii#1,,\@nil{#2}}%
@@ -709,9 +963,9 @@
\else
\addbefore@par{plotpoints=200,alpha=1,beta=1}%
\begin@OpenObj
- \psplot[algebraic=false]{#1}{#2}{
+ \psplot[algebraic=false]{#1}{#2}{
\psk@beta \psk@alpha add GAMMA
- \psk@beta GAMMA \psk@alpha GAMMA mul div
+ \psk@beta GAMMA \psk@alpha GAMMA mul div
1 x sub \psk@beta 1.0 sub exp mul
x \psk@alpha 1.0 sub exp mul }
\end@OpenObj%
@@ -803,7 +1057,7 @@
\ifdim#1pt<\z@ \psline(#1,0)(0,0)\def\pst@tempA{0}\fi
\psplot[algebraic=false]{\pst@tempA}{#2}{
\psk@alpha \psk@beta \psk@alpha neg exp mul % alpha*beta^(-alpha)
- x \psk@alpha 1 sub exp % x^(alpha-1)
+ x \psk@alpha 1 sub exp % x^(alpha-1)
mul
Euler x \psk@beta div \psk@alpha exp neg exp % e^(-(x/beta)^alpha))
mul }
@@ -848,41 +1102,41 @@
\iffalse
\def\Lorenz@code{
/D {} def
- [ \L@Data\space counttomark dup
+ [ \L@Data\space counttomark dup
1 sub /m ED 2 div cvi /n ED % m=0..n-1 n=number of pairs
] /xyValues ED
- /Xval [] def /Yval [] def /Xmax 0 def
+ /Xval [] def /Yval [] def /Xmax 0 def
/Xsum 0 def /Ysum 0 def /XYsum 0 def
xyValues aload pop % [ x y x y x y ... ]
n { 2 copy mul XYsum add /XYsum ED
- dup
- Yval aload length 1 add array astore /Yval ED
+ dup
+ Yval aload length 1 add array astore /Yval ED
Ysum add /Ysum ED
dup
- Xval aload length 1 add array astore /Xval ED
+ Xval aload length 1 add array astore /Xval ED
dup Xsum add /Xsum ED
dup Xmax gt { /Xmax ED }{ pop } ifelse
} repeat
Xval bubblesort /Xval ED
Yval bubblesort /Yval ED
- Xval { Xmax div } forall n array astore /XvalRelMax ED
- Xval { Xsum div } forall n array astore /XvalRel ED
- Yval { Ysum div } forall n array astore /YvalRel ED
- 0 1 n 1 sub {
+ Xval { Xmax div } forall n array astore /XvalRelMax ED
+ Xval { Xsum div } forall n array astore /XvalRel ED
+ Yval { Ysum div } forall n array astore /YvalRel ED
+ 0 1 n 1 sub {
cvi /Index ED
- Xval Index get
+ Xval Index get
Yval Index get
mul } for
n array astore /XmulY ED
- XmulY aload length 1 sub { add } repeat
+ XmulY aload length 1 sub { add } repeat
/XmulYsum ED
- XmulY { XmulYsum div } forall
+ XmulY { XmulYsum div } forall
n array astore /XmulYdivXmulYsum ED
/X [0] def
/Y [0] def
/Xsum 0 def /Ysum 0 def
0 1 n 1 sub {
- /Index ED
+ /Index ED
% XvalRel Index get Xsum add /Xsum ED
% X aload length 1 add Xsum exch array astore /X ED
X aload length 1 add XvalRelMax Index get exch array astore /X ED %%
@@ -891,52 +1145,52 @@
} for
\ifPst@Gini
0 % start value for Gini
- 0 1 X length 2 sub {
+ 0 1 X length 2 sub {
/Index ED
Y Index get Y Index 1 add get add 2 div % yHeight=(y0+y1)/2
- X Index 1 add get X Index get sub abs % xWidth=x1-x0
+ X Index 1 add get X Index get sub abs % xWidth=x1-x0
mul % x*y
add
} for
2 mul 1 sub neg % triangle area divided by the area under the polygon
- \psk@PSfont findfont \psk@fontscale scalefont setfont
+ \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 dot2comma \fi % do we have to change dot to comma
/Output ED
- \psk@xShift\space -30 moveto (Gini: ) show
- Output show
+ \psk@xShift\space -30 moveto (Gini: ) show
+ Output show
\fi
- 0 1 n { dup X exch get exch Y exch get } for
+ 0 1 n { dup X exch get exch Y exch get } for
\if@star 1 0 0 0 \fi % add values for the closed curve
}% filling the area under the curve.
\fi
%%%%%%%%%%%%%%%%%%%%%%5
\def\Lorenz@code{
[ #1 ] dup length /n ED
- bubblesort /Yval ED
+ bubblesort /Yval ED
[ 1 1 n { } for ] /Xval ED
- /Xsum n dup 1 add mul 2 div cvi def
+ /Xsum n dup 1 add mul 2 div cvi def
/Ysum 0 def /XYsum 0 def
0 Yval { add } forall /Ysum ED
- Xval { n div } forall n array astore /XvalRelMax ED
- Xval { Xsum div } forall n array astore /XvalRel ED
- Yval { Ysum div } forall n array astore /YvalRel ED
- 0 1 n 1 sub {
+ Xval { n div } forall n array astore /XvalRelMax ED
+ Xval { Xsum div } forall n array astore /XvalRel ED
+ Yval { Ysum div } forall n array astore /YvalRel ED
+ 0 1 n 1 sub {
/Index ED
- Xval Index get
+ Xval Index get
Yval Index get
mul } for
n array astore /XmulY ED
- XmulY aload length 1 sub { add } repeat
+ XmulY aload length 1 sub { add } repeat
/XmulYsum ED
- XmulY { XmulYsum div } forall
+ XmulY { XmulYsum div } forall
n array astore /XmulYdivXmulYsum ED
/X [0] def
/Y [0] def
/Xsum 0 def /Ysum 0 def
0 1 n 1 sub {
- /Index ED
+ /Index ED
% XvalRel Index get Xsum add /Xsum ED
% X aload length 1 add Xsum exch array astore /X ED
X aload length 1 add XvalRelMax Index get exch array astore /X ED %%
@@ -945,23 +1199,23 @@
} for
\ifPst@Gini
0 % start value for Gini
- 0 1 X length 2 sub {
+ 0 1 X length 2 sub {
/Index ED
Y Index get Y Index 1 add get add 2 div % yHeight=(y0+y1)/2
- X Index 1 add get X Index get sub abs % xWidth=x1-x0
+ X Index 1 add get X Index get sub abs % xWidth=x1-x0
mul % x*y
add
} for
2 mul 1 sub neg % triangle area divided by the area under the polygon
- \psk@PSfont findfont \psk@fontscale scalefont setfont
+ \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 dot2comma \fi % do we have to change dot to comma
/Output ED
- \psk@xShift\space -30 moveto (Gini: ) show
- Output show
+ \psk@xShift\space -30 moveto (Gini: ) show
+ Output show
\fi
- 0 1 n { dup X exch get exch Y exch get } for
+ 0 1 n { dup X exch get exch Y exch get } for
\if@star 1 0 0 0 \fi % add values for the closed curve
}% filling the area under the curve.
\if@star\listplot*{\Lorenz@code}\else\listplot{\Lorenz@code}%
@@ -982,9 +1236,9 @@
\addbefore@par{plotpoints=200}%
\use@par
\parametricplot{0}{360}{%
- t cos dup mul 1 #1\space div exp \pst@radiusA \pst@number\psxunit div mul
+ t cos dup mul 1 #1\space div exp \pst@radiusA \pst@number\psxunit div mul
t 90 gt { t 270 lt { neg } if } if
- t sin dup mul 1 #1\space div exp \pst@radiusB \pst@number\psyunit div mul
+ t sin dup mul 1 #1\space div exp \pst@radiusB \pst@number\psyunit div mul
t 180 gt { neg } if }
\endgroup\ignorespaces}
%
@@ -996,9 +1250,9 @@
\psplot{#1}{#2}[/ps@a #3 def /ps@b #4 def]{
/ps@n 0 def
/ps@WS 0 def
- {
- ps@a ps@n exp ps@b ps@n exp Pi mul x mul RadtoDeg cos mul
- dup abs \psk@epsilon gt { ps@WS add /ps@WS ED }{ ps@WS add exit } ifelse
+ {
+ ps@a ps@n exp ps@b ps@n exp Pi mul x mul RadtoDeg cos mul
+ dup abs \psk@epsilon gt { ps@WS add /ps@WS ED }{ ps@WS add exit } ifelse
ps@n 1 add /ps@n ED
} loop
}%
@@ -1010,9 +1264,9 @@
\psplot{#1}{#2}[/ps@a #3 def]{
/ps@k 1 def
/ps@WS 0 def
- {
- ps@k ps@a exp Pi mul dup x mul RadtoDeg sin exch div
- dup abs \psk@epsilon gt { ps@WS add /ps@WS ED }{ ps@WS add exit } ifelse
+ {
+ ps@k ps@a exp Pi mul dup x mul RadtoDeg sin exch div
+ dup abs \psk@epsilon gt { ps@WS add /ps@WS ED }{ ps@WS add exit } ifelse
ps@k 1 add /ps@k ED
} loop
}%
@@ -1044,12 +1298,12 @@
/yMin #2 def
/yMax #4 def
#5 % additional PS code
- \ifPst@polarplot
+ \ifPst@polarplot
/@PolarAlgPlot (#6) tx@addDict begin AlgParser end cvx def
/Func {
/phi y x atan def
- /r x y Pyth def
- \ifPst@algebraic @PolarAlgPlot \else #6 \fi } def
+ /r x y Pyth def
+ \ifPst@algebraic @PolarAlgPlot \else #6 \fi } def
\else
/Func \ifPst@algebraic (#6) tx@addDict begin AlgParser end cvx \else { #6 } \fi def
\fi
@@ -1057,17 +1311,17 @@
/yPixel yMax yMin sub \pst@number\psyunit mul round cvi def
/dx xMax xMin sub xPixel div def
/dy yMax yMin sub yPixel div def
- /setpixel {
- dy div exch
- dx div exch
- \ifPst@saveData
+ /setpixel {
+ dy div exch
+ dx div exch
+ \ifPst@saveData
2 copy
- \pst@number\psyunit div exch \pst@number\psxunit div
- 20 string cvs Pst@data exch writestring
- Pst@data (\space) writestring
- 20 string cvs Pst@data exch writestring
+ \pst@number\psyunit div exch \pst@number\psxunit div
+ 20 string cvs Pst@data exch writestring
+ Pst@data (\space) writestring
+ 20 string cvs Pst@data exch writestring
% Pst@data (\string\]) writestring
- Pst@data (\string\n) writestring
+ Pst@data (\string\n) writestring
\fi
\pst@number\pslinewidth 2 div 0 360 arc fill } bind def
%
@@ -1078,7 +1332,7 @@
\ifPst@saveData Pst@data ([\string\n) writestring \fi
yMin dy \psk@stepFactor\space mul yMax {
/y exch def
- Func 0 lt
+ Func 0 lt
{ VZ { x y setpixel /VZ false def} if }
{ VZ {}{ x y setpixel /VZ true def } ifelse } ifelse
} for
@@ -1092,7 +1346,7 @@
\ifPst@saveData Pst@data ([\string\n) writestring \fi
xMin dx \psk@stepFactor\space mul xMax {
/x exch def
- Func 0 lt
+ Func 0 lt
{ VZ { x y setpixel /VZ false def} if }
{ VZ {}{ x y setpixel /VZ true def } ifelse } ifelse
} for
@@ -1105,7 +1359,7 @@
/y exch def
xMin dx \psk@stepFactor\space mul xMax {
/x exch def
- Func 0 lt
+ Func 0 lt
{ VZ { x y setpixel /VZ false def} if }
{ VZ {}{ x y setpixel /VZ true def } ifelse } ifelse
} for
@@ -1125,7 +1379,7 @@
\psplot[fillstyle=none]{#1}{#2}{#4}% original function
\ifPst@algebraic
\psplot[fillstyle=none]{#1}{#2}{-(#4)}
- \else
+ \else
\psplot[fillstyle=none]{#1}{#2}{#4 neg}% mirrored at the x-axis
\fi
\multido{\iA=1+1}{#3}{% run it #3 times with increment \A
@@ -1134,7 +1388,7 @@
/dX #2 #1 sub #3 div def % delta x, the step
/Start dX \iA\space 1 sub mul #1 add def % xStart
/End Start dX add def % xEnd=xStart+dX
- /Height End Start add 2 div /x ED
+ /Height End Start add 2 div /x ED
\ifPst@algebraic (#4) AlgParser cvx exec \else #4 \fi def } % height=f(x)
% x is the mean between Start+End
\psellipticarc(!Start 0)(! Height 8 div Height){90}{270}
@@ -1144,9 +1398,9 @@
% draw the other half of the ellipse
\rlineto(!dX neg 0)}}% draw a line in negative x-direction
\psset{fillstyle=none}
-% \psellipse(#2,0)(!#2 dup #1 sub #3 div 2 div sub /x ED #4 dup
+% \psellipse(#2,0)(!#2 dup #1 sub #3 div 2 div sub /x ED #4 dup
% 8 div exch)% draw again the ellipse to get the borderline.
- \psellipse(#2,0)(!{ #2 dup #1 sub #3 div 2 div sub /x ED
+ \psellipse(#2,0)(!{ #2 dup #1 sub #3 div 2 div sub /x ED
\ifPst@algebraic (#4) AlgParser cvx exec \else #4 \fi dup
8 div exch}) % draw again the ellipse to get the borderline.
\psset{plotstyle=line,linestyle=dashed,
@@ -1154,7 +1408,7 @@
\psplot[fillstyle=none]{#1}{#2}{#4}
\ifPst@algebraic
\psplot[fillstyle=none]{#1}{#2}{-(#4)}
- \else
+ \else
\psplot[fillstyle=none]{#1}{#2}{#4 neg}% mirrored at the x-axis
\fi
% draw again the curves to get the borderline
@@ -1177,9 +1431,9 @@
\def\psBezier@ii{%
\addto@pscode{%
\psk@plotpoints % step for Bezier T=0,0+epsilon,0+i*epsilon,...,1
- \pst@BezierType % type of the Bezier curve 2,3,4,...
- \txFunc@BezierCurve
- \ifshowpoints \txFunc@BezierShowPoints \else pop \fi
+ \pst@BezierType % type of the Bezier curve 2,3,4,...
+ \txFunc@BezierCurve
+ \ifshowpoints \txFunc@BezierShowPoints \else pop \fi
}%
\end@OpenObj}
%
@@ -1190,13 +1444,13 @@
\def\psBernstein{\pst@object{psBernstein}}% \psBernstein[options](t1,t2)(i,n)
\def\psBernstein@i(#1,#2){%
\@ifnextchar({\psBernstein@ii(#1,#2)}{\psBernstein@ii(0,1)(#1,#2)}}
-%
+%
\def\psBernstein@ii(#1,#2)(#3,#4){% (tStart,tEnd)(i,n)
\addbefore@par{plotpoints=200}%
\begin@OpenObj
\addto@pscode{%
/ScreenCoor { \tx@ScreenCoor } def
- #1\space #2\space
+ #1\space #2\space
1.0 \psk@plotpoints\space div % step=1/plotpoints
#3\space #4\space
% on stack we have tStart tEnd epsilon i n
@@ -1211,29 +1465,29 @@
\begin@ClosedObj
\addto@pscode{
1 1 #3 {
- dup
+ dup
/ipSave ED % save loop value
/ip ED % dito
1 1 #3 {
dup
/iqSave ED % save loop value
/iq ED % dito
- {
+ {
iq 0 le { exit } if
- ip iq mod
+ ip iq mod
/ip iq def
- /iq ED
+ /iq ED
} loop
- ip 1 eq {
+ ip 1 eq {
/xVal ipSave iqSave div def
xVal #1 ge { xVal #2 le {
\psk@dotsize
\@nameuse{psds@\psk@dotstyle}
- \pst@usecolor\pslinecolor xVal 1 iqSave div \tx@ScreenCoor
+ \pst@usecolor\pslinecolor xVal 1 iqSave div \tx@ScreenCoor
2 copy pop 0 moveto lineto } if } if
% 2 copy moveto Dot } if } if
} if
- } for
+ } for
} for
}%
\end@ClosedObj%
@@ -1252,7 +1506,7 @@
/dx x1 x sub \psk@plotpoints div def
#3
/xy {
-% x
+% x
tx@FuncDict begin
#4 aload pop \pst@number\psyunit mul exch \pst@number\psxunit mul exch
end
@@ -1285,7 +1539,7 @@
\def\psZero{\def\pst@par{}\pst@object{psZero}}
\def\psZero@i(#1,#2)#3{\@ifnextchar[{\psZero@ii(#1,#2)#3}{\psZero@ii(#1,#2){#3}[0]}}
\def\psZero@ii(#1,#2)#3[#4]#5{%
-% (#1,#2) Intervall für die Nullstelle, bzw #1 Startwert für Newton, #3 1. Funktion, #4 2. Funktion, #5 Knotenname
+% (#1,#2) Intervall f\"{u}r die Nullstelle, bzw #1 Startwert f\"{u}r Newton, #3 1. Funktion, #4 2. Funktion, #5 Knotenname
\begingroup
\pst@killglue
% \addbefore@par{fontscale=40,PSfont=Times-Roman}%
@@ -1296,7 +1550,7 @@
/FunctionB
\ifPst@algebraic (#4) tx@AlgToPs begin AlgToPs end cvx \else {#4} \fi def
\ifPst@Newton % --------------------------- Newton-Verfahren --- TS 05.2014
- /eps 1e-6 def % eps für (f(x+eps)-f(x))/eps
+ /eps 1e-6 def % eps f\"{u}r (f(x+eps)-f(x))/eps
/x0 #1 def % Startwert wird vorgegeben
/Xend x0 def
{
@@ -1330,13 +1584,13 @@
\pnode(! xM yM){#5}%
\addto@pscode{
\ifPst@onlyNode \else
- /dec \psk@decimals\space def % Anzahl der Dezimahlen für x
- /ydec \psk@ydecimals\space def % Anzahl der Dezimalen für y
- /symb { /Symbol findfont \psk@fontscale\space scalefont setfont } bind def % Symbolschrift für Klammer und senkrechten Strich
- /schrift { \psk@PSfont findfont \psk@fontscale scalefont setfont } bind def % Schrift für die Ergebnisse
- /TiefSchrift { /Symbol findfont \psk@fontscale 1.6 div scalefont setfont } bind def % Schrift für tiefergestellte Buchstaben
- /spdx \psk@fontscale 4 div def % Abstand, der mit der Schriftgöße skaliert ist
- /spdy \psk@fontscale 15 div def % Abstand, der mit der Schriftgöße skaliert ist
+ /dec \psk@decimals\space def % Anzahl der Dezimahlen f\"{u}r x
+ /ydec \psk@ydecimals\space def % Anzahl der Dezimalen f\"{u}r y
+ /symb { /Symbol findfont \psk@fontscale\space scalefont setfont } bind def % Symbolschrift f\"{u}r Klammer und senkrechten Strich
+ /schrift { \psk@PSfont findfont \psk@fontscale scalefont setfont } bind def % Schrift f\"{u}r die Ergebnisse
+ /TiefSchrift { /Symbol findfont \psk@fontscale 1.6 div scalefont setfont } bind def % Schrift f\"{u}r tiefergestellte Buchstaben
+ /spdx \psk@fontscale 4 div def % Abstand, der mit der Schriftg\"{o}{\ss}e skaliert ist
+ /spdy \psk@fontscale 15 div def % Abstand, der mit der Schriftg\"{o}{\ss}e skaliert ist
/Wert { 10 dec exp mul round 10 dec exp div dec 0 eq {cvi 15 string cvs} {15 string cvs } ifelse % x-Wert runden und als string ablegen
\ifPst@comma dot2comma \fi show } def % gegebenenfalls Komma statt Punkt und Ergebnis anzeigen
/yWert { 10 ydec exp mul round 10 ydec exp div ydec 0 eq {cvi 15 string cvs} {15 string cvs } ifelse % y-Wert runden und als string ablegen
@@ -1388,7 +1642,7 @@
\fi\fi}%
\ifPst@markZeros \psdot(#5)\fi
\endgroup\use@pscode\ignorespaces
-}%
+}%
%
\catcode`\@=\PstAtCode\relax
%