texlive[44666] Master/texmf-dist: pst-func (21jun17)
commits+karl at tug.org
commits+karl at tug.org
Fri Jun 23 00:35:10 CEST 2017
Revision: 44666
http://tug.org/svn/texlive?view=revision&revision=44666
Author: karl
Date: 2017-06-23 00:35:10 +0200 (Fri, 23 Jun 2017)
Log Message:
-----------
pst-func (21jun17)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/generic/pst-func/Changes
trunk/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf
trunk/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex
trunk/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
Modified: trunk/Master/texmf-dist/doc/generic/pst-func/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-func/Changes 2017-06-22 22:34:35 UTC (rev 44665)
+++ trunk/Master/texmf-dist/doc/generic/pst-func/Changes 2017-06-22 22:35:10 UTC (rev 44666)
@@ -1,4 +1,5 @@
..... pst-func.tex
+0.86 2017-06-21 - allow alternating colors for bars
0.85 2017-04-18 - allow framing of function values (ts)
0.84 2017-03-11 - some more modifications to the binomial distributions (ts)
0.83 2017-03-07 - added some more macros for binomial distributions (ts)
Modified: trunk/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex 2017-06-22 22:34:35 UTC (rev 44665)
+++ trunk/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex 2017-06-22 22:35:10 UTC (rev 44666)
@@ -20,7 +20,7 @@
\psGauss[sigma=1, linecolor=blue, linewidth=2pt]{-1.75}{1.75}
\end{pspicture}}
-\usepackage[style=dtk]{biblatex}
+%\usepackage[style=dtk]{biblatex}
\addbibresource{pst-func-doc.bib}
@@ -1505,6 +1505,18 @@
+\begin{LTXexample}[pos=t,preset=\centering]
+\definecolor{A1}{RGB}{28, 134, 238}
+\definecolor{A2}{RGB}{124, 205, 124}
+\psset{xunit=4mm,yunit=70cm,arrowscale=1.5}%
+\begin{pspicture*}(-2,-0.01)(30,0.25)
+\psBinomial[fillstyle=alternateColors,
+ fillcolorA=A1,fillcolorB=A2,
+ markZeros]{60}{0.25}
+\psaxes[Dx=5,dx=5\psxunit,Dy=0.1,dy=0.1\psyunit,
+ arrows=D>]{->}(28,0.13)[\Large$k$,-90][\Large$P(X=k)$,0]
+\end{pspicture*}%
+\end{LTXexample}
Modified: trunk/Master/texmf-dist/tex/generic/pst-func/pst-func.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pst-func/pst-func.tex 2017-06-22 22:34:35 UTC (rev 44665)
+++ trunk/Master/texmf-dist/tex/generic/pst-func/pst-func.tex 2017-06-22 22:35:10 UTC (rev 44666)
@@ -31,8 +31,8 @@
% interface to the `xkeyval' package
\pst at addfams{pst-func}
%
-\def\fileversion{0.85}
-\def\filedate{2017/04/18}
+\def\fileversion{0.86}
+\def\filedate{2017/06/21}
\message{`PST-func' v\fileversion, \filedate\space (hv)}
%
\pstheader{pst-func.pro}
@@ -535,9 +535,16 @@
\define at key[psset]{pst-func}{LabelColor}[black]{\pst at getcolor{#1}\psk at LabelColor}
\define at key[psset]{pst-func}{LineEndColorL}[green]{\pst at getcolor{#1}\psk at LineEndColorL}
\define at key[psset]{pst-func}{LineEndColorR}[red]{\pst at getcolor{#1}\psk at LineEndColorR}
+\define at key[psset]{pst-func}{fillcolorA}[blue!40]{\pst at getcolor{#1}\psk at fillcolorA}
+\define at key[psset]{pst-func}{fillcolorB}[red!40]{\pst at getcolor{#1}\psk at fillcolorB}
+
+\def\psfs at alternateColors{}
+\def\pst at alternateColors{alternateColors}
+
\define at 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}
+ radiusout=2,radiusinL=0,radiusinR=1.5,LineEnding=true,leftEnd=1,rightEnd=2,VLines=false,
+ fillcolorA=blue!40,fillcolorB=red!40}
%
\def\psBinomial{\pst at object{psBinomial}}
\def\psBinomial at i#1#2{\psBinomial at ii#1,,,\@nil{#2}}%
@@ -554,6 +561,11 @@
\def\psBinomial at iii#1#2#3#4{%
\begin at OpenObj
\addto at pscode{
+ /toggle false def
+ \ifx\psk at fillstylename\pst at alternateColors
+ /ColA { \pst at usecolor\psk at fillcolorA } def
+ /ColB { \pst at usecolor\psk at fillcolorB } def
+ \fi
/scx { \pst at number\psxunit mul } def
/scy { \pst at number\psyunit mul } def
/m #1 def
@@ -577,8 +589,17 @@
{ /Y q N exp def }
{ /Y Y N k sub 1 add mul k div p mul q div def }
ifelse % recursive definition
+ \ifx\psk at fillstylename\pst at alternateColors
+ newpath
+ kOld scx 0 moveto
+ \fi
kOld scx Y scy L k dx add scx Y scy L
\ifPst at markZeros k dx add scx 0 L kOld 1 add scx 0 L \fi
+ \ifx\psk at fillstylename\pst at alternateColors
+ closepath
+ gsave toggle {ColA}{ColB} ifelse fill grestore
+ /toggle toggle not def
+ \fi
\ifPst at printValue
gsave \psk at PSfont findfont \psk at fontscale scalefont setfont \pst at usecolor\psk at LabelColor %
Y \psk at valuewidth string cvs
More information about the tex-live-commits
mailing list