diff options
author | Karl Berry <karl@freefriends.org> | 2011-02-05 00:16:56 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-02-05 00:16:56 +0000 |
commit | 3452f352c7df351df8f08f0ae01f6cae4ace2fb4 (patch) | |
tree | 2e6618d90444854d4fdc9f0f6273546566d884b5 /Master/texmf-dist/doc/generic | |
parent | acc047ba3ea08abac25940c1cec10cced0297c4b (diff) |
pstricks-add (2feb11)
git-svn-id: svn://tug.org/texlive/trunk@21290 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic')
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/Changes | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf | bin | 1780776 -> 1806906 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex | 202 |
3 files changed, 200 insertions, 6 deletions
diff --git a/Master/texmf-dist/doc/generic/pstricks-add/Changes b/Master/texmf-dist/doc/generic/pstricks-add/Changes index e9a470d06ba..6ce4488dd56 100644 --- a/Master/texmf-dist/doc/generic/pstricks-add/Changes +++ b/Master/texmf-dist/doc/generic/pstricks-add/Changes @@ -1,4 +1,4 @@ -%% $Id: Changes 445 2011-01-18 18:43:16Z herbert $ +%% $Id: Changes 453 2011-01-29 13:44:41Z herbert $ %% pstricks-add.pro ----------- 0.23 2009-12-20 - add RGBtoGRAY and WavelengthToGRAY @@ -39,6 +39,8 @@ pstricks-add.sty ----------- (hv) pstricks-add.tex ----------- (Dominik Rodriguez/hv) + v 3.51 2011-02-02 - add new Macro\psKiviat for Kiviat diagrams + v 3.50 2011-01-29 - add new optional argument colorTypeDef for \psMatrix v 3.49 2011-01-18 - add macro \psEllipseTangents for drawing tangent lines of a point and an ellipse. v 3.48 2010-12-18 - add macro \psCircleTangents for drawing tangent 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 Binary files differindex ba27a113b54..f1d8ec59ba0 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 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 88c43ec9e10..4f0ede49b5b 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 445 2011-01-18 18:43:16Z herbert $ +%% $Id: pstricks-add-doc.tex 454 2011-01-29 15:42:34Z herbert $ \documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings headexclude,footexclude,oneside]{pst-doc} \listfiles @@ -3362,7 +3362,7 @@ as starting values for another equation. %-------------------------------------------------------------------------------------- \clearpage -\section{\nxLcs{psMatrixPlot}} +\section{\nxLcs{psMatrixPlot}}\label{sec:psMatrix} %-------------------------------------------------------------------------------------- \begin{filecontents}{matrix.data} /dotmatrix [ % @@ -3421,7 +3421,7 @@ is the first plotted line ($y=1$). With the option \end{pspicture}}\quad \psscalebox{0.6}{% \begin{pspicture}(-0.5,-0.75)(11,11) - \psaxes{->}(11,11) + \psaxes[ticksize=-5pt 0]{->}(11,11) \psMatrixPlot[dotsize=1.1cm,dotstyle=square*,linecolor=magenta,XYoffset=-0.5]% {10}{10}{matrix.data} \psMatrixPlot[dotsize=.5cm,dotstyle=o,ChangeOrder,XYoffset=-0.5]{10}{10}{matrix.data} @@ -3431,7 +3431,7 @@ is the first plotted line ($y=1$). With the option \begin{lstlisting} \psscalebox{0.6}{% \begin{pspicture}(-0.5,-0.75)(11,11) - \psaxes{->}(11,11) + \psaxes[ticksize=-5pt 0]{->}(11,11) \psMatrixPlot[dotsize=1.1cm,dotstyle=square*,linecolor=magenta]% {10}{10}{matrix.data} \psMatrixPlot[dotsize=.5cm,dotstyle=o,ChangeOrder]{10}{10}{matrix.data} @@ -3447,7 +3447,7 @@ is the first plotted line ($y=1$). With the option \begin{LTXexample}[pos=t,preset=\centering] \begin{pspicture}(-0.5,-0.75)(11,11) - \psaxes{->}(11,11) + \psaxes[ticksize=-5pt 0]{->}(11,11) \psMatrixPlot[dotscale=3,dotstyle=*,linecolor=blue]{10}{8}{matrix.data} \end{pspicture} \end{LTXexample} @@ -3490,6 +3490,187 @@ matrix data, which is saved as /dotmatrix [...] in the file \LFile{pstricks-add- \egroup \clearpage +With the \Lkeyword{colorType}=5 the color setting can be user defined by the +optional argument \Lkeyword{colorTypeDef}. On the stack is the current value +which can be used for the setting but must be left on the stack when everything +is finished. The following example prints the 0 as color white, the value 1 as +black and all other values depending to the corresponding gray value. + +\begin{filecontents*}{matrix1.data} +/dotmatrix [ % <------------ important line +3 0 0 0 0 0 0 0 1 2 +0 0 0 0 0 0 0 1 2 1 +8 0 0 0 0 0 1 2 1 0 +0 0 0 0 0 1 2 1 0 0 +0 0 0 0 1 2 1 0 0 0 +9 0 0 1 2 1 3 0 0 0 +0 0 1 2 1 4 0 0 0 0 +0 1 2 1 5 0 0 0 0 0 +1 2 1 6 0 0 0 0 0 0 +2 1 7 0 0 0 0 0 0 3 +] def % <------------ important line +\end{filecontents*} + +\begin{center} +\psscalebox{0.7}{% +\begin{pspicture}(-0.5,-0.75)(11,11) +\psaxes[ticksize=-5pt 0]{->}(11,11) +\psMatrixPlot[ + colorType=5, + colorTypeDef={ + dup /value exch def % save value and leave one on the stack + value Min sub dMaxMin div neg 1 add 300 mul 400 add \pswavelengthToGRAY + value 0 eq \pslbrace 1 \psrbrace if % + value 1 eq \pslbrace 0 \psrbrace if + setgray + }, + dotsize=1.1cm,xStep=1,yStep=1,dotstyle=square*]{10}{10}{matrix1.data} +\end{pspicture}} +\end{center} + + +\begin{lstlisting} +\begin{filecontents}{matrix1.data} +/dotmatrix [ % <------------ important line +3 0 0 0 0 0 0 0 1 2 +0 0 0 0 0 0 0 1 2 1 +8 0 0 0 0 0 1 2 1 0 +0 0 0 0 0 1 2 1 0 0 +0 0 0 0 1 2 1 0 0 0 +9 0 0 1 2 1 3 0 0 0 +0 0 1 2 1 4 0 0 0 0 +0 1 2 1 5 0 0 0 0 0 +1 2 1 6 0 0 0 0 0 0 +2 1 7 0 0 0 0 0 0 3 +] def % <------------ important line +\end{filecontents} +\psscalebox{0.7}{% +\begin{pspicture}(-0.5,-0.75)(11,11) +\psaxes[ticksize=-5pt 0]{->}(11,11) +\psMatrixPlot[ + colorType=5, + colorTypeDef={ + dup /value exch def % save value and leave one on the stack + value Min sub dMaxMin div neg 1 add 300 mul 400 add \pswavelengthToGRAY + value 0 eq \pslbrace 1 \psrbrace if % + value 1 eq \pslbrace 0 \psrbrace if + setgray + }, + dotsize=1.1cm,xStep=1,yStep=1,dotstyle=square*]{10}{10}{matrix1.data} +\end{pspicture}} +\end{lstlisting} + + +\Lps{if} statements in the color definition must be enclosed with \Lcs{pslbrace} and \Lcs{psrbrace} +when they are parentheses used in PostScript. In the above example the color definition should be +modified when the matrix is a real big one, in such a case a nested \Lps{ifelse} makes more sense: + +\begin{lstlisting} + colorTypeDef={ + dup /value exch def + value 0 eq + \pslbrace 1 setgray \psrbrace + \pslbrace value 1 eq + \pslbrace 0 setgray \psrbrace + \pslbrace Min sub dMaxMin div neg 1 add 300 mul 400 add + \pswavelengthToGRAY setgray \psrbrace ifelse + \psrbrace ifelse + }, +\end{lstlisting} + +Replace the \Lcs{pslbrace} and \Lcs{psrbrace} with \{ and \} if it maybe confusing to read: + +\begin{lstlisting} + dup /value exch def + value 0 eq + { 1 setgray } + { value 1 eq + { 0 setgray } + { Min sub dMaxMin div neg 1 add 300 mul 400 add + \pswavelengthToGRAY setgray } ifelse + } ifelse +\end{lstlisting} + +Another possibility is to define the color procedure onside the data file, where +it \emph{must} be named \Lps{colorTypeDef}. If such a definition exists, the one from +the optional argument \Lkeyword{colorTypeDef} will be ignored. There can be no +\TeX-specific code inside this definition because it is read on PostScript level, +the reason why \Lcs{pswavelengthToGRAY} cannot be used. + +\begin{center} +\begin{filecontents}{matrix1.data} +/colorTypeDef { + dup /value exch def + value 0 eq + { 1 setgray } + { value 1 eq + { 0 setgray } + { Min sub dMaxMin div neg 1 add 300 mul 400 add +% \pswavelengthToGRAY not possible + tx@addDict begin wavelengthToRGB Red Green Blue end + setrgbcolor + } ifelse + } ifelse +} def +/dotmatrix [ % <------------ important line +3 0 0 0 0 0 0 0 1 2 +0 0 0 0 0 0 0 1 2 1 +8 0 0 0 0 0 1 2 1 0 +0 0 0 0 0 1 2 1 0 0 +0 0 0 0 1 2 1 0 0 0 +9 0 0 1 2 1 3 0 0 0 +0 0 1 2 1 4 0 0 0 0 +0 1 2 1 5 0 0 0 0 0 +1 2 1 6 0 0 0 0 0 0 +2 1 7 0 0 0 0 0 0 3 +] def % <------------ important line +\end{filecontents} +\psscalebox{0.7}{% +\begin{pspicture}(-0.5,-0.75)(11,11) +\psaxes[ticksize=-5pt 0]{->}(11,11) +\psMatrixPlot[ + colorType=5,dotsize=1.1cm,xStep=1,yStep=1,dotstyle=square*]{10}{10}{matrix1.data} +\end{pspicture}} +\end{center} + +\begin{lstlisting} +\begin{filecontents}{matrix1.data} +/colorTypeDef { + dup /value exch def + value 0 eq + { 1 setgray } + { value 1 eq + { 0 setgray } + { Min sub dMaxMin div neg 1 add 300 mul 400 add +% \pswavelengthToRGB not possible + tx@addDict begin wavelengthToRGB Red Green Blue end + setrgbcolor + } ifelse + } ifelse +} def +/dotmatrix [ % <------------ important line +3 0 0 0 0 0 0 0 1 2 +0 0 0 0 0 0 0 1 2 1 +8 0 0 0 0 0 1 2 1 0 +0 0 0 0 0 1 2 1 0 0 +0 0 0 0 1 2 1 0 0 0 +9 0 0 1 2 1 3 0 0 0 +0 0 1 2 1 4 0 0 0 0 +0 1 2 1 5 0 0 0 0 0 +1 2 1 6 0 0 0 0 0 0 +2 1 7 0 0 0 0 0 0 3 +] def % <------------ important line +\end{filecontents} +\psscalebox{0.7}{% +\begin{pspicture}(-0.5,-0.75)(11,11) +\psaxes[ticksize=-5pt 0]{->}(11,11) +\psMatrixPlot[colorType=5,dotsize=1.1cm,xStep=1,yStep=1, + dotstyle=square*]{10}{10}{matrix1.data} +\end{pspicture}} +\end{lstlisting} + + + %-------------------------------------------------------------------------------------- \section{Dashed Lines} %-------------------------------------------------------------------------------------- @@ -4852,7 +5033,18 @@ be seen with Acroread 7 or later. The syntax is easy: \end{pspicture} \end{LTXexample} +\section{Internal color macros} +The internal macros \Lcs{pswavelengthToRGB} and \Lcs{pswavelengthToRGB} can be used for own purposed. +They are defines as follows: + +\begin{lstlisting} +\def\pswavelengthToGRAY{ tx@addDict begin wavelengthToGRAY end } +\def\pswavelengthToRGB{ tx@addDict begin wavelengthToRGB Red Green Blue end } +\end{lstlisting} +both macros leave the value(s) on the stack which then can be used for further +manipulating or setting the color with \Lps{setgray} or \Lps{setrgbcolor}. +For an example see Section~\ref{sec:psMatrix}. \appendix |