From a7553dae596be94abc6b71964d4383667f04b8e2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 23 Jul 2008 22:07:17 +0000 Subject: pstricks-add (18jul08) git-svn-id: svn://tug.org/texlive/trunk@9735 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/pstricks-add/Changes | 9 +- .../doc/generic/pstricks-add/pstricks-add-doc.pdf | Bin 1650157 -> 1700802 bytes .../doc/generic/pstricks-add/pstricks-add-doc.tex | 504 ++++++++---- .../source/generic/pstricks-add/Makefile | 29 +- .../tex/generic/pstricks-add/pstricks-add.tex | 882 +++++++++++++++------ 5 files changed, 1036 insertions(+), 388 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/generic/pstricks-add/Changes b/Master/texmf-dist/doc/generic/pstricks-add/Changes index 5c7229efbdb..a0a01b36512 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 25 2008-06-06 10:33:45Z herbert $ +%% $Id: Changes 36 2008-07-07 06:58:27Z herbert $ %% pstricks-add.pro ----------- (Dominik Rodriguez/hv) v 0.20 2008-01-12 - moved the AlgParser into pst-algparser.pro @@ -33,6 +33,13 @@ pstricks-add.sty ----------- (hv) pstricks-add.tex ----------- (Dominik Rodriguez/hv) + v 3.07 2008-07-18 - fix bug with \psdice + - new macro \psChart + - added setlinecap to linestyle dashed + - fix bug with \psGTriangle and fillstyle for \pspolygon + v 3.06 2008-06-20 - fix bug with vertical setting of the horizontal labels + - add option value inner for tickstyle + - add Makro \psCancel (Stefano Baroni) v 3.05 2008-06-06 - rewrote the axes-label setting for the psgraph environment - add \pst@mindim{#1}{#2}#3 - rewrote label setting for \psaxes 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 index 1230a783c89..6cba02293ea 100644 Binary files a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf and b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf differ 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 c67b049d350..3386f69ff9c 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 25 2008-06-06 10:33:45Z herbert $ +%% $Id: pstricks-add-doc.tex 36 2008-07-07 06:58:27Z herbert $ \documentclass[10pt]{article} \listfiles \usepackage{filecontents} @@ -984,6 +984,23 @@ \usepackage[svgnames,dvipsnames,table]{pstricks} \usepackage{framed,xspace,multirow,caption} \usepackage{pst-eucl,pst-fun} +\makeatletter +\define@key[psset]{}{PSfont}{\def\psk@PSfont{/#1 }} +\define@key[psset]{}{valuewidth}{\pst@getint{#1}\psk@valuewidth } +\define@key[psset]{}{fontscale}{\pst@checknum{#1}\psk@fontscale } +\define@key[psset]{}{decimals}{\pst@getint{#1}\psk@decimals } +\psset{PSfont=Times-Roman,fontscale=10,valuewidth=10,decimals=-1} +\def\psPrintValue{\pst@object{psPrintValue}} +\def\psPrintValue@i#1{% + \begin@SpecialObj + \addto@pscode{ + gsave \psk@PSfont findfont \psk@fontscale scalefont setfont + #1 \psk@decimals -1 gt { 10 \psk@decimals exp dup 3 1 roll mul cvi exch div } if + \psk@valuewidth string cvs 0 0 moveto show grestore + }% + \end@SpecialObj% +} +\makeatother \usepackage{pstricks-add} \let\pstricksaddFV\fileversion \def\PST{\texttt{PSTricks}} @@ -1093,6 +1110,8 @@ you have installed \verb+pst-xkey+ which is part of the \verb+xkeyval+-package a packages, that uses the old keyval interface are loaded \textbf{before} the \verb+xkeyval+.\cite{xkeyval} \item the option \verb+tickstyle+ from \verb+pst-plot+ is no more supported, use \verb+ticksize+ instead. \item the option \verb+xyLabel+ is no more supported, use the option \verb+labelFontSize+ instead. +\item if \verb+pstricks-add+ is load together with the package \texttt{pst-func} then the \texttt{InsideArrow} + of the \CMD{psbezier} macro doesn't work! \end{itemize} \end{abstract} @@ -1357,19 +1376,19 @@ macro. \clearpage %-------------------------------------------------------------------------------------- -\section{\CMD{psPie}: a pie chart} +\section{\CMD{psChart}: a pie chart} %-------------------------------------------------------------------------------------- \begin{lstlisting}[style=syntax] -\psPie[]{comma separated value list}{comma separated value list}{radius} +\psChart[]{comma separated value list}{comma separated value list}{radius} \end{lstlisting} -The special optional arguments for the \CMD{psPie} macro are as follows: +The special optional arguments for the \CMD{psChart} macro are as follows: \begin{tabularx}{\linewidth}{@{}>{\ttfamily}lX>{\ttfamily}l@{}} \textrm{\emph{name}} & \textrm{\emph{description}} & \textrm{\emph{default}}\\\hline -pieSep & distance from the pie chart center center to an outraged pie piece & 10pt\\ -pieColor & gray or colored pie (values are: \texttt{gray} or \texttt{color})& gray\\ +chartSep & distance from the pie chart center center to an outraged pie piece & 10pt\\ +chartColor & gray or colored pie (values are: \texttt{gray} or \texttt{color})& gray\\ userColor & a comma separated list of user defined colors for the pie & \{\} \end{tabularx} @@ -1378,38 +1397,38 @@ The first mandatory argument is the list of the values and may not be empty. The one is a list of outraged pieces, numbered consecutively from 1 to up the total number of values. The list of user defined colors must be enclosed in braces! -The macro \CMD{psPie} defines for every value three nodes at the half angle and +The macro \CMD{psChart} defines for every value three nodes at the half angle and in distances from 0.75, 1, and 1.25 times of the radius from the origin. The nodes -are named as \verb+psPieI?+, \verb+psPie?+, and \verb+psPieO?+, where ? is the number of +are named as \verb+psChartI?+, \verb+psChart?+, and \verb+psChartO?+, where ? is the number of the pie. The letter I leads to the inner node and the letter O to the outer node. The other one is the node on the circle line. The origin is by default \texttt{(0,0)}. Moving the pie to another position can be done as -usual with the \CMD{rput}-macro. The used colors are named internally as \verb+pieFillColor?+ +usual with the \CMD{rput}-macro. The used colors are named internally as \verb+chartFillColor?+ and can be used by the user for coloring lines or text. \begin{LTXexample}[width=6cm] \begin{pspicture}(-3,-3)(3,3) -\psPie{ 23, 29, 3, 26, 28, 14 }{}{2} +\psChart{ 23, 29, 3, 26, 28, 14 }{}{2} \multido{\iA=1+1}{6}{% - \psdot(psPie\iA)\psdot(psPieI\iA)\psdot(psPieO\iA)% - \psline[linestyle=dashed,linecolor=white](psPie\iA) - \psline[linestyle=dashed](psPie\iA)(psPieO\iA)} + \psdot(psChart\iA)\psdot(psChartI\iA)\psdot(psChartO\iA)% + \psline[linestyle=dashed,linecolor=white](psChart\iA) + \psline[linestyle=dashed](psChart\iA)(psChartO\iA)} \end{pspicture} \end{LTXexample} \begin{LTXexample}[width=6cm] \begin{pspicture}(-3,-3)(3,3) -\psPie[pieColor=color]{ 45, 90 }{ 1 }{2} -\ncline[linecolor=-pieFillColor1, - nodesepB=-20pt]{psPieO1}{psPie1} -\rput[l](psPieO1){% - \textcolor{pieFillColor1}{pie no 1}} -\ncline[linecolor=-pieFillColor2, - nodesepB=-20pt]{psPieO2}{psPie2} -\rput[lt](psPieO2){% - \textcolor{pieFillColor2}{pie no 2}} +\psChart[chartColor=color]{ 45, 90 }{ 1 }{2} +\ncline[linecolor=-chartFillColor1, + nodesepB=-20pt]{psChartO1}{psChart1} +\rput[l](psChartO1){% + \textcolor{chartFillColor1}{pie no 1}} +\ncline[linecolor=-chartFillColor2, + nodesepB=-20pt]{psChartO2}{psChart2} +\rput[lt](psChartO2){% + \textcolor{chartFillColor2}{pie no 2}} \end{pspicture} \end{LTXexample} @@ -1417,19 +1436,19 @@ and can be used by the user for coloring lines or text. \psframebox[fillcolor=black!20, fillstyle=solid]{% \begin{pspicture}(-3.5,-3.5)(4.25,3.5) -\psPie[pieColor=color]% +\psChart[chartColor=color]% {23, 29, 3, 26, 28, 14, 17, 4, 9}{}{2} \multido{\iA=1+1}{9}{% - \ncline[linecolor=-pieFillColor\iA, - nodesepB=-10pt]{psPieO\iA}{psPie\iA} - \rput[l](psPieO\iA){% - \textcolor{pieFillColor\iA}{pie no \iA}}} + \ncline[linecolor=-chartFillColor\iA, + nodesepB=-10pt]{psChartO\iA}{psChart\iA} + \rput[l](psChartO\iA){% + \textcolor{chartFillColor\iA}{pie no \iA}}} \end{pspicture}} \end{LTXexample} \begin{LTXexample}[width=6cm] \begin{pspicture}(-3,-3)(3,3) -\psPie[userColor={red!30,green!30, +\psChart[userColor={red!30,green!30, blue!40,gray,magenta!60,cyan}]% { 23, 29, 3, 26, 28, 14 }{1,4}{2} \end{pspicture} @@ -1439,11 +1458,13 @@ and can be used by the user for coloring lines or text. \begin{LTXexample}[width=6cm] \begin{pspicture}(-3,-3)(3,3) -\psPie{ 23, 29, 3, 26, 28, 14 }{}{2} -\multido{\iA=1+1}{6}{\rput*(psPieI\iA){\iA}} +\psChart{ 23, 29, 3, 26, 28, 14 }{}{2} +\multido{\iA=1+1}{6}{\rput*(psChartI\iA){\iA}} \end{pspicture} \end{LTXexample} + + \clearpage %-------------------------------------------------------------------------------------- \section{\CMD{psHomothetie}: central dilatation} @@ -1766,61 +1787,63 @@ name & default\\\hline \psset{unit=1cm} + +\clearpage + %-------------------------------------------------------------------------------------- +\section{Dice} + %-------------------------------------------------------------------------------------- +\CMD{psdice} creates the view of a dice. The number on the dice is the only parameter. +The optional parameters, like the color can be used as usual. The macro is a box of +dimension zero and is placed +at the current point. Use the \CMD{rput} macro to place it anywhere. The optional +argument \texttt{unit} can be used to scale the dice. the default size of +the dice $1\mathrm{cm}\times1\mathrm{cm}$. + +\begin{center} +\begin{pspicture}(-1,-1)(8,9) +\multido{\iA=1+1}{6}{% + \rput(\iA,7.5){\Huge\psdice[unit=0.75,linecolor=red!80]{\iA}} + \rput(! -0.5 7 \iA\space sub){\Huge\psdice[unit=0.75,linecolor=blue!70]{\iA}}% + \multido{\iB=1+1}{6}{% + \rput(! \iA\space 7 \iB\space sub){% + \rnode[c]{p\iA\iB}{\makebox[1em][l]{\strut\psPrintValue[fontscale=12]{\iA\space \iB\space add}}}% + }% + }% +} +% +\ncbox[linearc=0.35,nodesep=0.2,linestyle=dotted]{p11}{p66} +\ncbox[linearc=0.35,nodesep=0.2,linestyle=dashed]{p15}{p51} +\rput{90}(-1.5,3.5){1. dice} +\rput{0}(3.5,8.5){2. dice} +\psline[linewidth=1.5pt](0.25,0.5)(0.25,8) +\psline[linewidth=1.5pt](-1,6.75)(6.5,6.75) +% +\end{pspicture} +\end{center} + +\begin{lstlisting} +\begin{pspicture}(-1,-1)(8,8) +\multido{\iA=1+1}{6}{% + \rput(\iA,7.5){\Huge\psdice[unit=0.75,linecolor=red!80]{\iA}} + \rput(! -0.5 7 \iA\space sub){\Huge\psdice[unit=0.75,linecolor=blue!70]{\iA}}% + \multido{\iB=1+1}{6}{% + \rput(! \iA\space 7 \iB\space sub){% + \rnode[c]{p\iA\iB}{\makebox[1em][l]{\strut\psPrintValue[fontscale=12]{\iA\space \iB\space add}}}% + }% + }% +} +% +\ncbox[linearc=0.35,nodesep=0.2,linestyle=dotted]{p11}{p66} +\ncbox[linearc=0.35,nodesep=0.2,linestyle=dashed]{p15}{p51} +\rput{90}(-1.5,3.5){1. dice} +\rput{0}(3.5,8.5){2. dice} +\psline[linewidth=1.5pt](0.25,0.5)(0.25,8) +\psline[linewidth=1.5pt](-1,6.75)(6.5,6.75) +% +\end{pspicture} +\end{lstlisting} + \clearpage -%% %-------------------------------------------------------------------------------------- -%% \section{Dice} -%% %-------------------------------------------------------------------------------------- -%% \CMD{psdice} creates the view of a dice. The number on the dice is the only parameter. -%% The optional parameters, like the color can be used as usual. The macro is a box of -%% dimension zero and is placed -%% at the current point. Use the \CMD{rput} macro to place it anywhere. The only -%% special option name is \verb+dicescale+, with a default setting of \verb+1+. In this -%% case the dice has a size of $1\mathrm{cm}\times1\mathrm{cm}$. -%% -%% \begin{center} -%% \begin{pspicture}(-1,-1)(8,8) -%% \multido{\iA=1+1}{6}{% -%% \rput(\iA,7.5){\Huge\psdice[dicescale=0.75,linecolor=red]{\iA}} -%% \rput(! -0.5 7 \iA\space sub){\Huge\psdice[dicescale=0.75,linecolor=green]{\iA}}% -%% \multido{\iB=1+1}{6}{% -%% \fpAdd{\iA}{\iB}{\iSum} -%% \pnode(! \iA\space 7 \iB\space sub ){p\iA\iB} -%% \rput(! \iA\space 7 \iB\space sub){\iSum} -%% }} -%% % -%% \ncbox[linearc=0.35,nodesep=0.4,linestyle=dashed]{p15}{p51} -%% \ncbox[linearc=0.35,nodesep=0.4,linestyle=dotted]{p11}{p66} -%% \rput{90}(-1.5,3.5){1. dice} -%% \rput{0}(3.5,8.5){2. dice} -%% \psline[linewidth=1.5pt](0.25,0.5)(0.25,8) -%% \psline[linewidth=1.5pt](-1,6.75)(6.5,6.75) -%% % -%% \end{pspicture} -%% \end{center} -%% -%% \begin{lstlisting} -%% \begin{pspicture}(-1,-1)(8,8) -%% \multido{\iA=1+1}{6}{% -%% \rput(\iA,7.5){\Huge\psdice[dicescale=0.75,linecolor=red]{\iA}} -%% \rput(! -0.5 7 \iA\space sub){\Huge\psdice[dicescale=0.75,linecolor=green]{\iA}}% -%% \multido{\iB=1+1}{6}{% -%% \fpAdd{\iA}{\iB}{\iSum} -%% \pnode(! \iA\space 7 \iB\space sub ){p\iA\iB} -%% \rput(! \iA\space 7 \iB\space sub){\iSum} -%% }} -%% % -%% \ncbox[linearc=0.35,nodesep=0.4,linestyle=dashed]{p15}{p51} -%% \ncbox[linearc=0.35,nodesep=0.4,linestyle=dotted]{p11}{p66} -%% \rput{90}(-1.5,3.5){1. dice} -%% \rput{0}(3.5,8.5){2. dice} -%% \psline[linewidth=1.5pt](0.25,0.5)(0.25,8) -%% \psline[linewidth=1.5pt](-1,6.75)(6.5,6.75) -%% % -%% \end{pspicture} -%% \end{lstlisting} -%% -%% -%% \clearpage %-------------------------------------------------------------------------------------- \section{Arrows} %-------------------------------------------------------------------------------------- @@ -2278,6 +2301,7 @@ All examples are printed with \verb|\psset{arrowscale=2,linecolor=red}|. %-------------------------------------------------------------------------------------- % Bezier curves (\psbezier macro) +\resetOptions \begin{LTXexample}[width=3.5cm] \begin{pspicture}(3,3) \psset{arrowscale=2} @@ -2291,6 +2315,7 @@ All examples are printed with \verb|\psset{arrowscale=2,linecolor=red}|. \end{pspicture} \end{LTXexample} +\resetOptions \begin{LTXexample}[width=4.5cm] \begin{pspicture}(4,3) \psset{arrowscale=2} @@ -2308,7 +2333,7 @@ All examples are printed with \verb|\psset{arrowscale=2,linecolor=red}|. \end{pspicture} \end{LTXexample} - +\resetOptions \begin{LTXexample}[width=4.5cm] \begin{pspicture}(4,3) \psset{arrowscale=2} @@ -2509,7 +2534,9 @@ name & meaning\\\hline Only for the arrowtype \texttt{o} and \texttt{*} it is possible to set the arrowlinewidth with the optional keyword \texttt{arrowLW}. -Otherwise +When scaling an arrow by the keyword \verb+\arrowscale+ the width of borderline +is also scaled. With the optional argument \texttt{arrowLW} the line width +can be set separately and is not taken into account by the scaling value. \begin{LTXexample}[width=4cm] \begin{pspicture}(4,6) @@ -2556,10 +2583,10 @@ the names and syntax changed and you need to run \verb+ps2pdf+ with the option %-------------------------------------------------------------------------------------- -\subsection{,,Manipulating Transparent colors''} +\subsection{,,Manipulating transparent colors''} %-------------------------------------------------------------------------------------- -\verb+pstricks-add+ simulates transparency with hatch lines: +\verb+pstricks-add+ supports real transparency and a simulated one with hatch lines: \begin{lstlisting} \def\defineTColor{\@ifnextchar[{\defineTColor@i}{\defineTColor@i[]}} \def\defineTColor@i[#1]#2#3{% transparency "Colors" @@ -3293,7 +3320,8 @@ There is no special parameter here. \begin{LTXexample}[width=5.5cm] \psset{unit=0.5cm} \begin{pspicture}(-5,-4)(5,5) - \psaxes[labelFontSize=\scriptstyle]{->}(0,0)(-5,-4)(5,5) + \psaxes[labelFontSize=\scriptstyle, + dx=2,Dx=2,dy=2,Dy=2]{->}(0,0)(-5,-4)(5,5) \psline[linecolor=red,linewidth=2pt](-5,-1)(5,5) \psline[linecolor=blue,linewidth=2pt](-5,3)(5,-4) \qdisk(-5,-1){2pt}\uput[-90](-5,-1){A} @@ -3410,12 +3438,22 @@ the x-label and one for the y-label. If you want only a y-label, then leave the x one empty. A missing y label is possible. The following examples show how it can be used. +The option \verb+tickstyle=full|top|bottom+ is no more working in the usual way. +Only the additional value \texttt{inner} is valid for \verb+pstricks-add+, +because everything can be set by the \verb+ticksize+ option. When using the +\verb+comma+ or \verb+trigLabels+ option, the macros \verb+\pshlabel+ and \verb+\psvlabel+ +shouldn't be redefined, because the package does it itself internally in these cases. +However, if you need a redefinition, then do it for \CMD{pst@@hlabel} and \CMD{pst@@vlabel} +with + +\begin{lstlisting}[style=syntax] +\makeatletter +\def\ps@@hlabel#1{...} +\def\ps@@vlabel#1{...} +\makeatother +\end{lstlisting} -The option \verb+tickstyle=full|top|bottom+ is no more working in the \verb+pstricks-add+ -package, because everything can be set by the \verb+ticksize+ option. When using the -\verb+comma+ or \verb+trigLabels+ option, the macros \verb+\pshlabel+ and \verb+\psvlabel+ -shouldn't be redefined, because the package does it itself in these cases. { \ttfamily \rowcolors{1}{blue!20}{red!30} @@ -3444,8 +3482,8 @@ xyDecimals & or empty & \{\}\\%ok %xLabel & & \{\}\\%ok %yLabel & & \{\}\\%ok %xyLabel & & \{\}\\%ok -%tickstyle & full|top|bottom & full\\%ok ticks & & all\\%ok +tickstyle & full|top|bottom|inner & full\\%ok subticks & & 0\\ xsubticks & & 0\\ ysubticks & & 0\\ @@ -3583,7 +3621,7 @@ By default the labels for ticks are placed at the bottom (x axis) and left (y-ax In both axes are drawn into negative direction the default is top (x axis) and right (y axis). It be changed with the two options \texttt{xlabelPos} and \texttt{xlabelPos}. With the value \texttt{axis} the user can place the labels depending to the value of \texttt{labelsep}, -which is taken into account. +which is taken into account for \texttt{axis}. \resetOptions% \bigskip @@ -3602,7 +3640,8 @@ which is taken into account. \psaxes{->}(-3,-3) \end{pspicture}\hspace{2cm} \begin{pspicture}(3,3) -\psaxes[ylabelPos=axis, +\psaxes[labelsep=0pt, + ylabelPos=axis, xlabelPos=axis]{->}(3,3) \end{pspicture} \end{LTXexample} @@ -3642,7 +3681,7 @@ or \verb+\scriptscriptstyle+. \psaxes{->}(5,2.25)[$x$,0][$y$,90] \end{pspicture}\\[20pt] \begin{pspicture}(-0.25,-0.25)(5,2.25) -\psaxes[labelFontSize=\small]{->}(5,2.25) +\psaxes[labelFontSize=\footnotesize]{->}(5,2.25) \end{pspicture}\\[20pt] \begin{pspicture}(-0.25,-0.25)(5,2.25) \psaxes[labelFontSize=\footnotesize]{->}(5,2.25) @@ -3724,7 +3763,7 @@ The default setting \verb|{}| means, that you'll get the standard behaviour. \begin{LTXexample}[pos=t] -\psset{xunit=10cm,yunit=0.01cm,labelFontSize=\footnotesize} +\psset{xunit=10cm,yunit=0.01cm,labelFontSize=\scriptstyle} \begin{pspicture}(-0.3,-150)(1.5,550.0) \psaxes[Dx=0.25,Dy=100,ticksize=-4pt 0,comma=true,xDecimals=3,yDecimals=1]{->}% (0,0)(0,-100)(1.4,520)[\textbf{Amp\`ere},-90][\textbf{Voltage},0] @@ -3759,10 +3798,10 @@ here. For \textbf{all} following examples in this section we did a global -\lstinline[frame=single]|\psset{trigLabels=true,labelFontSize=\small}|. +\lstinline[frame=single]|\psset{trigLabels=true,labelFontSize=\scriptstyle}|. -\psset{trigLabels,labelFontSize=\small} +\psset{trigLabels,labelFontSize=\scriptstyle} Translating the decimal ticks to geometrical makes no real sense, because every 1 xunit (1cm) is a tick and the last one at 6cm. @@ -4124,6 +4163,32 @@ Single ticks can be set with the two macros \psyTick[linecolor=blue](1.7){$y_0$} \end{psgraph} \end{LTXexample} + + +% full= 0, top=1, bottom=-1, inner=2 => -1 0 1 2 +%-------------------------------------------------------------------------------------- +\subsection{\texttt{tickstyle}} +%-------------------------------------------------------------------------------------- +Syntax: +\begin{lstlisting}[style=syntax] +tickstyle=full|top|bottom|inner +\end{lstlisting} + +The value \texttt{inner} (not available with the basic \texttt{pstricks} package) is +only valid for the axes style \texttt{frame}. + +\medskip +\begin{LTXexample}[pos=t] +\psset{subticks=10} +\begin{pspicture}(-1,-1)(3,3) \psaxes[tickstyle=full]{->}(3,3) \end{pspicture} +\begin{pspicture}(-1,-1)(3,3) \psaxes[tickstyle=top]{->}(3,3) \end{pspicture} +\begin{pspicture}(-1,-1)(3,3) \psaxes[tickstyle=bottom]{->}(3,3)\end{pspicture} +\begin{pspicture}(-1,-1)(3,3) + \psaxes[axesstyle=frame, tickstyle=inner, ticksize=0 4pt]{->}(3,3) +\end{pspicture} +\end{LTXexample} + + %-------------------------------------------------------------------------------------- \subsection{\texttt{ticksize}, \texttt{xticksize}, \texttt{yticksize}} %-------------------------------------------------------------------------------------- @@ -4172,7 +4237,7 @@ A grid is also possible by setting the values to the max/min coordinates. \end{pspicture} \end{LTXexample} - +\clearpage %-------------------------------------------------------------------------------------- \subsection{\texttt{subticks}} %-------------------------------------------------------------------------------------- @@ -4250,14 +4315,14 @@ ysubtickcolor= \begin{LTXexample}[preset=\centering,pos=t] \begin{pspicture}(0,-0.75)(10,1) -\psaxes[yAxis=false,labelFontSize=\footnotesize,ticksize=0 10mm,subticks=10,subticksize=0.75, +\psaxes[yAxis=false,labelFontSize=\scriptstyle,ticksize=0 10mm,subticks=10,subticksize=0.75, tickcolor=red,subtickcolor=blue,tickwidth=1pt,subtickwidth=0.5pt](10.01,0) \end{pspicture} \end{LTXexample} \begin{LTXexample}[width=5cm] \begin{pspicture}(5,-0.75)(10,1) -\psaxes[yAxis=false,labelFontSize=\footnotesize,ticksize=0 -10mm,subticks=10,subticksize=0.75, +\psaxes[yAxis=false,labelFontSize=\scriptstyle,ticksize=0 -10mm,subticks=10,subticksize=0.75, tickcolor=red,subtickcolor=blue,tickwidth=1pt,subtickwidth=0.5pt,Ox=5](5,0)(5,0)(10.01,0) \end{pspicture} \end{LTXexample} @@ -4299,24 +4364,30 @@ Syntax: loglines=all|x|y \end{lstlisting} -\begin{LTXexample}[width=5.5cm] -\pspicture(0,-1)(5,5) - \psaxes[subticks=5,axesstyle=frame,xylogBase=10,logLines=all](5,5) +By default the option \texttt{logLines} sets the ticksize to the maximal length for x, y, or both. +It can be changed, when \emph{after} the option \texttt{logLines} the ticksize is set. + +\begin{LTXexample}[pos=t] +\pspicture(-1,-1)(5,5) + \psaxes[subticks=5,xylogBase=10,logLines=all](5,5) +\endpspicture\hspace{1cm} +\pspicture(-1,-1)(5,5) + \psaxes[subticks=10,axesstyle=frame,xylogBase=10,logLines=all,ticksize=0 5pt,tickstyle=inner](5,5) \endpspicture \end{LTXexample} \begin{LTXexample}[preset=\centering,pos=t] \psset{unit=4cm} -\pspicture(-0.15,-0.15)(2.5,3) - \psaxes[axesstyle=frame,logLines=y,xticksize=0 3,xsubticksize=1,ylogBase=10, - tickcolor=red,subtickcolor=blue,tickwidth=1pt,subticks=20,xsubticks=10](2.5,3) +\pspicture(-0.15,-0.15)(2.5,2) + \psaxes[axesstyle=frame,logLines=y,xticksize=max,xsubticksize=1,ylogBase=10, + tickcolor=red,subtickcolor=blue,tickwidth=1pt,subticks=20,xsubticks=10](2.5,2) \endpspicture \end{LTXexample} \begin{LTXexample}[preset=\centering,pos=t] \psset{unit=4} \pspicture(-0.5,-0.3)(3,1.2) - \psaxes[axesstyle=frame,logLines=x,xlogBase=10,Dy=0.5,tickcolor=red, + \psaxes[axesstyle=frame,tickstyle=inner,logLines=x,xlogBase=10,Dy=0.5,tickcolor=red, subtickcolor=blue,tickwidth=1pt,ysubticks=5,xsubticks=10](3,1) \endpspicture \end{LTXexample} @@ -4839,6 +4910,7 @@ big number for \verb+plotpoints+. \begin{center} +\psset{unit=0.75} \begin{pspicture}(-8,-8)(8,8) \psaxes{->}(0,0)(-8,-8)(8,8)[x,-90][y,0] \psset{plotpoints=1000,linewidth=1pt} @@ -4855,6 +4927,7 @@ big number for \verb+plotpoints+. \end{center} \begin{lstlisting} +\psset{unit=0.75} \begin{pspicture}(-8,-8)(8,8) \psaxes{->}(0,0)(-8,-8)(8,8)[x,-90][y,0] \psset{plotpoints=1000,linewidth=1pt} @@ -4913,7 +4986,7 @@ value of \verb+0.25cm+, which is the total width. \begin{LTXexample}[preset=\centering,pos=t] \psset{xunit=.44cm,yunit=.3cm} \begin{pspicture}(-2,-3)(29,13) - \psaxes[axesstyle=axes,Ox=1466,Oy=0,Dx=4,Dy=2,% + \psaxes[axesstyle=axes,Ox=1466,Oy=0,Dx=4,Dy=2,xticksize=-6pt 0, ylabelFactor={\,\%}]{-}(29,12) \listplot[shadow=true,linecolor=blue,plotstyle=bar,barwidth=0.3cm, fillcolor=red,fillstyle=solid]{\barData} @@ -4924,7 +4997,7 @@ value of \verb+0.25cm+, which is the total width. \begin{LTXexample}[preset=\centering,pos=t] \psset{xunit=.44cm,yunit=.3cm} \begin{pspicture}(-2,-3)(29,13) - \psaxes[axesstyle=axes,Ox=1466,Oy=0,Dx=4,Dy=2,% + \psaxes[axesstyle=axes,Ox=1466,Oy=0,Dx=4,Dy=2,ticksize=-4pt 0, ylabelFactor={\,\%}]{-}(29,12) \listplot[linecolor=blue,plotstyle=bar,barwidth=0.3cm, fillcolor=red,fillstyle=crosshatch]{\barData} @@ -4935,7 +5008,7 @@ value of \verb+0.25cm+, which is the total width. \begin{LTXexample}[preset=\centering,pos=t] \psset{xunit=.44cm,yunit=.3cm} \begin{pspicture}(-2,-3)(29,13) - \psaxes[axesstyle=axes,Ox=1466,Oy=0,Dx=4,Dy=2,% + \psaxes[axesstyle=axes,Ox=1466,Oy=0,Dx=4,Dy=2,ticksize=-4pt 0, ylabelFactor={\,\%}]{-}(29,12) \listplot[linecolor=blue,plotstyle=bar,barwidth=0.3cm, fillcolor=red,fillstyle=vlines]{\barData} @@ -5041,8 +5114,8 @@ of all records with the plotstyle option \verb|curve|. \psset{xunit=12.5cm,yunit=0.2mm} \begin{pspicture}(-0.080,-30)(1,270) \pstScalePoints(1,1){1000 div}{1000 div} -\psaxes[Dx=200,dx=2.5cm,Dy=100, - ylabelFactor=\cdot10^3,dy=2cm](0,0)(1,250) +\psaxes[Dx=200,dx=2.5cm,Dy=100,ticksize=0 5pt,tickstyle=inner, + subticks=10,ylabelFactor=\cdot10^3,dy=2cm](0,0)(1,250) \listplot[nStep=50,linewidth=3pt,linecolor=red,plotstyle=dots]{\data} \listplot[linewidth=1pt,linecolor=blue]{\data} \end{pspicture} @@ -5060,8 +5133,8 @@ of all records with the plotstyle option \verb|curve|. \psset{xunit=12.5cm,yunit=0.2mm} \begin{pspicture}(-0.080,-30)(1,270) \pstScalePoints(1,1){1000 div}{1000 div} -\psaxes[Dx=200,dx=2.5cm,Dy=100, - ylabelFactor=\cdot10^3,dy=2cm](0,0)(1,250) +\psaxes[Dx=200,dx=2.5cm,Dy=100,ticksize=0 5pt,tickstyle=inner, + subticks=10,ylabelFactor=\cdot10^3,dy=2cm](0,0)(1,250) \listplot[nStart=200,linewidth=3pt, linecolor=blue,plotstyle=dots]{\data} \listplot[linewidth=1pt,linecolor=blue]{\data} @@ -5078,8 +5151,8 @@ of all records with the plotstyle option \verb|curve|. \psset{xunit=12.5cm,yunit=0.2mm} \begin{pspicture}(-0.080,-30)(1,270) \pstScalePoints(1,1){1000 div}{1000 div} -\psaxes[axesstyle=frame,Dx=200,dx=2.5cm,Dy=100, - ylabelFactor=\cdot10^3,dy=2cm](0,0)(1,250) +\psaxes[axesstyle=frame,Dx=200,dx=2.5cm,Dy=100,ticksize=0 5pt,tickstyle=inner, + subticks=10,ylabelFactor=\cdot10^3,dy=2cm](0,0)(1,250) \listplot[nStart=200,linewidth=3pt, linecolor=blue]{\data} \listplot[linewidth=1pt,linecolor=blue]{\data} @@ -5098,7 +5171,7 @@ of all records with the plotstyle option \verb|curve|. \psset{xunit=12.5cm,yunit=0.2mm} \begin{pspicture}(-0.080,-30)(1,270) \pstScalePoints(1,1){1000 div}{1000 div} -\psaxes[axesstyle=frame,Dx=200,dx=2.5cm,Dy=100, +\psaxes[axesstyle=frame,Dx=200,dx=2.5cm,Dy=100,,ticksize=0 5pt,tickstyle=inner, ylabelFactor=\cdot10^3,dy=2cm](0,0)(1,250) \listplot[nStart=200, nEnd=800, nStep=50, linewidth=3pt,linecolor=blue,plotstyle=dots]{\data} @@ -5122,7 +5195,7 @@ possible to have a kind of a zoom to the original graphic. \readdata{\data}{data3.dat} \begin{pspicture}(-0.1,-100)(1.5,700.0) \psaxes[Dx=0.25,Dy=100,dy=100\psyunit,ticksize=-4pt 0,% - labelFontSize={\footnotesize}]{->}(0,0)(0,-100)(1.4,520) + labelFontSize={\scriptstyle}]{->}(0,0)(0,-100)(1.4,520) \uput[0](1.4,0){\textsf{t [s]}} \rput(-0.125,200){\psrotateleft{\small flow [ml/s]}} \listplot[linewidth=2pt, linecolor=blue]{\data} @@ -5148,7 +5221,7 @@ possible to have a kind of a zoom to the original graphic. \readdata{\data}{data3.dat} \begin{pspicture}(-0.1,-100)(1.5,700.0) \psaxes[Dx=0.25,Dy=100,dy=100\psyunit,ticksize=-4pt 0,% - labelFontSize={\footnotesize}]{->}(0,0)(0,-100)(1.4,520) + labelFontSize={\scriptstyle}]{->}(0,0)(0,-100)(1.4,520) \uput[0](1.4,0){\textsf{t [s]}} \rput(-0.125,200){\psrotateleft{\small flow [ml/s]}} \listplot[linewidth=2pt, linecolor=blue]{\data} @@ -5180,7 +5253,7 @@ possible to have a kind of a zoom to the original graphic. \psset{xunit=12.5cm,yunit=0.2mm} \begin{pspicture}(-0.080,-30)(1,270) \pstScalePoints(1,1){1000 div}{1000 div} -\psaxes[axesstyle=frame,Dx=200,dx=2.5cm,Dy=100, +\psaxes[axesstyle=frame,Dx=200,dx=2.5cm,Dy=100,ticksize=0 5pt,tickstyle=inner, ylabelFactor=\cdot10^3,dy=2cm](0,0)(1,250) \psset{linewidth=0.1pt, linestyle=dashed,linecolor=red} \psline(0,40)(1,40) @@ -5232,8 +5305,8 @@ without any modification to the data file: \readdata\Data{dataMul.dat} \psset{xunit=0.1cm, yunit=0.5cm,lly=-0.5cm} \begin{pspicture}(0,-7.5)(150,10) -\psaxes[Dx=10,Dy=2.5]{->}(0,0)(0,-7.5)(150,7.5) -\psset{linewidth=2pt,plotstyle=line} +\psaxes[Dx=10,Dy=2.5]{->}(0,0)(0,-7.5)(150,7.5)[$\mathbf{x}$,-90][$\mathbf{y}$,0] +\psset{linewidth=2pt,plotstyle=curve} \listplot[linecolor=green,plotNo=1,plotNoMax=3]{\Data} \listplot[linecolor=red,plotNo=2,plotNoMax=3]{\Data} \listplot[linecolor=blue,plotNo=3,plotNoMax=3]{\Data} @@ -5262,7 +5335,7 @@ the values are used in a reverse order: \psset{lly=-.5cm} \begin{psgraph}[axesstyle=frame,ticklinestyle=dotted,ticksize=0 10](0,0)(10,10){4in}{2in}% \readdata{\data}{test.dat}% - \pscustom[fillstyle=solid,fillcolor=gray]{% + \pscustom[fillstyle=solid,fillcolor=blue!40]{% \listplot[plotNo=2,plotNoMax=2]{\data}% \listplot[plotNo=1,plotNoMax=2,ChangeOrder]{\data}} \end{psgraph} @@ -5405,7 +5478,7 @@ x sin dup mul x cos dup mul add sqrt \psset{plotpoints=200,unit=0.75} \begin{pspicture}*(-5,-5)(3,3) \psaxes[arrowlength=1.75,ticksize=2pt,% - labelFontSize=\footnotesize,% + labelFontSize=\scriptstyle,% linewidth=0.17mm]{->}(0,0)(-4.99,-4.99)(3,3) \rput[Br](3,-.35){$x$} \rput[tr](-.15,3){$y$} @@ -5502,6 +5575,91 @@ macros. This is the reason why it is a good idea to reset the values at the end \part{New commands and environments} %-------------------------------------------------------------------------------------- +%-------------------------------------------------------------------------------------- +\section[\texttt{psCancel} environment]{\texttt{psCancel} environment\footnotemark} +%-------------------------------------------------------------------------------------- +\footnotetext{Thanks to by Stefano Baroni} +This macro works like the \CMD{cancel} macro from the package of the same name but +it allows as argument any contents, a letter also as a complex graphic. + +\begin{lstlisting}[style=syntax] +\psCancel*[line options]{contents}% +\end{lstlisting} + +All optional arguments for lines and boxes are valid and can be used in the usual way. +The star option fills the underlying box rectangle with the linecolor. This can be +transparent if \texttt{opacity} is set to a value less than 1. This can be used +in presentation to strike out words, equations, and graphic objects. Lines can also be +transparency when the option \texttt{strokeopacity} is used. + +\begingroup +\psCancel{A} \psCancel[linecolor=red]{Tikz :-)} \quad +\psCancel[linecolor=blue,doubleline=true]{% + \readdata{\data}{demo1.dat} + \psset{shift=*,xAxisLabel=x-Axis,yAxisLabel=y-Axis,llx=-13mm,lly=-7mm, + xAxisLabelPos={c,-1},yAxisLabelPos={-7,c}} + \pstScalePoints(1,0.00000001){}{} + \begin{psgraph}[axesstyle=frame,xticksize=0 7.5,yticksize=0 25,subticksize=1, + ylabelFactor=\cdot 10^8,Dx=5,Dy=1,xsubticks=2](0,0)(25,7.5){5.5cm}{5cm} + \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data} + \end{psgraph}} \qquad% end of Cancel +\psCancel[linewidth=3pt,linecolor=red, + strokeopacity=0.5]{\tabular[b]{c}first line\\second line\endtabular}\quad +\psCancel*[linecolor=red!50,opacity=0.5]{\tabular[b]{c}first line\\second line\endtabular} +\quad +\psCancel*[linecolor=blue!30,opacity=0.5]{% + \readdata{\data}{demo1.dat} + \psset{shift=*,xAxisLabel=x-Axis,yAxisLabel=y-Axis,llx=-15mm,lly=-7mm,urx=1mm, + xAxisLabelPos={c,-1},yAxisLabelPos={-7,c}} + \pstScalePoints(1,0.00000001){}{} + \begin{psgraph}[axesstyle=frame,xticksize=0 7.5,yticksize=0 25,subticksize=1, + ylabelFactor=\cdot 10^8,Dx=5,Dy=1,xsubticks=2](0,0)(25,7.5){5.5cm}{5cm} + \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data} + \end{psgraph}} \quad% end of Cancel +\psCancel[linewidth=4pt,strokeopacity=0.5]{\parbox{8cm}{\[ + \binom{x_R}{y_R} = \underbrace{r\vphantom{\binom{A}{B}}}_{\text{Scaling}}\cdot + \underbrace{\begin{pmatrix} + \sin\gamma & -\cos\gamma \\ + \cos \gamma & \sin \gamma \\ + \end{pmatrix}}_{\text{Rotation}} \binom{x_K}{y_K} + + \underbrace{\binom{t_x}{t_y}}_{\text{Translation}} \]} }% end of psCancel +\endgroup + +\bigskip +\begin{lstlisting} +\psCancel{A} \psCancel[linecolor=red]{Tikz :-)} \quad +\psCancel[linecolor=blue,doubleline=true]{% + \readdata{\data}{demo1.dat} + \psset{shift=*,xAxisLabel=x-Axis,yAxisLabel=y-Axis,llx=-13mm,lly=-7mm, + xAxisLabelPos={c,-1},yAxisLabelPos={-7,c}} + \pstScalePoints(1,0.00000001){}{} + \begin{psgraph}[axesstyle=frame,xticksize=0 7.5,yticksize=0 25,subticksize=1, + ylabelFactor=\cdot 10^8,Dx=5,Dy=1,xsubticks=2](0,0)(25,7.5){5.5cm}{5cm} + \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data} + \end{psgraph}} \qquad% end of Cancel +\psCancel[linewidth=3pt,linecolor=red, + strokeopacity=0.5]{\tabular[b]{c}first line\\second line\endtabular}\quad +\psCancel*[linecolor=red!50,opacity=0.5]{\tabular[b]{c}first line\\second line\endtabular} +\quad +\psCancel*[linecolor=blue!30,opacity=0.5]{% + \readdata{\data}{demo1.dat} + \psset{shift=*,xAxisLabel=x-Axis,yAxisLabel=y-Axis,llx=-15mm,lly=-7mm,urx=1mm, + xAxisLabelPos={c,-1},yAxisLabelPos={-7,c}} + \pstScalePoints(1,0.00000001){}{} + \begin{psgraph}[axesstyle=frame,xticksize=0 7.5,yticksize=0 25,subticksize=1, + ylabelFactor=\cdot 10^8,Dx=5,Dy=1,xsubticks=2](0,0)(25,7.5){5.5cm}{5cm} + \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data} + \end{psgraph}} \quad% end of Cancel +\psCancel[linewidth=4pt,strokeopacity=0.5]{\parbox{8cm}{\[ + \binom{x_R}{y_R} = \underbrace{r\vphantom{\binom{A}{B}}}_{\text{Scaling}}\cdot + \underbrace{\begin{pmatrix} + \sin\gamma & -\cos\gamma \\ + \cos \gamma & \sin \gamma \\ + \end{pmatrix}}_{\text{Rotation}} \binom{x_K}{y_K} + + \underbrace{\binom{t_x}{t_y}}_{\text{Translation}} \]} }% end of psCancel +\end{lstlisting} + + %-------------------------------------------------------------------------------------- \section{\texttt{psgraph} environment} %-------------------------------------------------------------------------------------- @@ -5601,10 +5759,9 @@ In the following example, the y unit gets the same value as the one for the x-ax \readdata{\data}{demo1.dat} \psset{llx=-0.5cm,lly=-1cm} \pstScalePoints(1,0.000001){}{} -\psgraph[arrows=->,Dx=5,dy=200\psyunit,Dy=200,% - subticks=5,ticksize=-10pt 0,tickwidth=0.5pt,% - subtickwidth=0.1pt](0,0)(25,750){5.5cm}{5cm} -\listplot[linecolor=red,linewidth=2pt,showpoints=true,]{\data} +\psgraph[arrows=->,Dx=5,dy=200\psyunit,Dy=200,subticks=5,ticksize=-10pt 0, + tickwidth=0.5pt,subtickwidth=0.1pt](0,0)(25,750){5.5cm}{5cm} +\listplot[linecolor=red,linewidth=2pt,showpoints=true,plotstyle=LineToYAxis]{\data} \endpsgraph \end{LTXexample} @@ -5636,7 +5793,7 @@ In the following example, the y unit gets the same value as the one for the x-ax \pstScalePoints(1,1){}{log} \begin{psgraph}[arrows=->,Dx=0.5,ylogBase=10,Oy=-1,xsubticks=10,% ysubticks=2](0,-3)(3,1){12cm}{4cm} - \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data} + \listplot[linecolor=red,linewidth=2pt,showpoints=true,plotstyle=LineToXAxis]{\data} \end{psgraph} \end{LTXexample} @@ -5646,7 +5803,7 @@ In the following example, the y unit gets the same value as the one for the x-ax \readdata{\data}{demo0.dat} \pstScalePoints(1,1){}{log} \psgraph[arrows=->,Dx=0.5,ylogBase=10,Oy=-1,subticks=4](0,-3)(3,1){6cm}{3cm} - \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data} + \listplot[linecolor=red,linewidth=2pt,showpoints=true,plotstyle=LineToXAxis]{\data} \endpsgraph \end{LTXexample} @@ -5679,36 +5836,66 @@ In the following example, the y unit gets the same value as the one for the x-ax \end{lstlisting} %----------------------------------------------------------------------------- -\begin{LTXexample}[pos=t,preset=\centering] +%\begin{LTXexample}[pos=t,preset=\centering] +\begin{center} \readdata{\data}{demo2.dat}% \readdata{\dataII}{demo3.dat}% -\psset{llx=-0.5cm,lly=-0.75cm} +\psset{llx=-0.5cm,lly=-0.75cm,plotstyle=LineToXAxis} \pstScalePoints(1,1){1989 sub}{2 sub} -\begin{psgraph}[axesstyle=frame,Dx=2,Ox=1989,Oy=2,subticks=2](0,0)(12,4){6in}{3in}% +\begin{psgraph}[axesstyle=frame,Dx=2,Ox=1989,Oy=2,subticks=2](0,0)(12,4){6in}{3in} \listplot[linecolor=red,linewidth=2pt]{\data} \listplot[linecolor=blue,linewidth=2pt]{\dataII} \listplot[linecolor=cyan,linewidth=2pt,yunit=0.5]{\dataII} \end{psgraph} -\end{LTXexample} +\end{center} +%\end{LTXexample} + +\begin{lstlisting} +\readdata{\data}{demo2.dat}% +\readdata{\dataII}{demo3.dat}% +\psset{llx=-0.5cm,lly=-0.75cm,plotstyle=LineToXAxis} +\pstScalePoints(1,1){1989 sub}{2 sub} +\begin{psgraph}[axesstyle=frame,Dx=2,Ox=1989,Oy=2,subticks=2](0,0)(12,4){6in}{3in} + \listplot[linecolor=red,linewidth=2pt]{\data} + \listplot[linecolor=blue,linewidth=2pt]{\dataII} + \listplot[linecolor=cyan,linewidth=2pt,yunit=0.5]{\dataII} +\end{psgraph} +\end{lstlisting} %\newpage -An example with ticks on every side of the frame: +An example with ticks on every side of the frame and filled areas: \begin{center} -\def\data{0 0 1 1 2 4 3 9} +\def\data{0 0 1 4 1.5 1.75 2.25 4 2.75 7 3 9} \psset{lly=-0.5cm} -\begin{psgraph}[axesstyle=frame,ticksize=0 4pt](0,0)(3.0,9.0){12cm}{5cm} - \psaxes[axesstyle=frame,labels=none,ticksize=-4pt 0](3,9)(0,0)(3,9) - \listplot[linecolor=red,linewidth=2pt]{\data} +\begin{psgraph}[axesstyle=none,ticks=none](0,0)(3.0,9.0){12cm}{5cm} + \pscustom[fillstyle=solid,fillcolor=red!40,linestyle=none]{% + \listplot{\data} + \psline(3,9)(3,0)} + \pscustom[fillstyle=solid,fillcolor=blue!40,linestyle=none]{% + \listplot{\data} + \psline(3,9)(0,9)} + \listplot[linewidth=2pt]{\data} + \psaxes[axesstyle=frame,ticksize=0 5pt,xsubticks=20,ysubticks=4, + tickstyle=inner,dy=2,Dy=2,tickwidth=1.5pt,subtickcolor=black](0,0)(3,9) + \rput*(2.5,3){level 1}\rput*(1,7){level 2} \end{psgraph} \end{center} \begin{lstlisting} -\def\data{0 0 1 1 2 4 3 9} +\def\data{0 0 1 4 1.5 1.75 2.25 4 2.75 7 3 9} \psset{lly=-0.5cm} -\begin{psgraph}[axesstyle=frame,ticksize=0 4pt](0,0)(3.0,9.0){12cm}{5cm} - \psaxes[axesstyle=frame,labels=none,ticksize=-4pt 0](3,9)(0,0)(3,9) - \listplot[linecolor=red,linewidth=2pt]{\data} +\begin{psgraph}[axesstyle=none,ticks=none](0,0)(3.0,9.0){12cm}{5cm} + \pscustom[fillstyle=solid,fillcolor=red!40,linestyle=none]{% + \listplot{\data} + \psline(3,9)(3,0)} + \pscustom[fillstyle=solid,fillcolor=blue!40,linestyle=none]{% + \listplot{\data} + \psline(3,9)(0,9)} + \listplot[linewidth=2pt]{\data} + \psaxes[axesstyle=frame,ticksize=0 5pt,xsubticks=20,ysubticks=4, + tickstyle=inner,dy=2,Dy=2,tickwidth=1.5pt,subtickcolor=black](0,0)(3,9) + \rput*(2.5,3){level 1}\rput*(1,7){level 2} \end{psgraph} \end{lstlisting} @@ -5836,7 +6023,7 @@ in postfix or algebraic notation (with \verb+algebraic=true+). \begin{LTXexample}[pos=t,preset=\centering] \begin{pspicture}(-0.5,-0.5)(10,3) - \psaxes[labelFontSize=\footnotesize]{->}(10,3) + \psaxes[labelFontSize=\scriptstyle]{->}(10,3) \psplot[plotpoints=100,linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)} \psStep[linecolor=magenta,StepType=upper,fillstyle=hlines](0,9){9}{x sqrt} \psStep[linecolor=blue,fillstyle=vlines](0,9){9}{x sqrt } @@ -5846,7 +6033,7 @@ in postfix or algebraic notation (with \verb+algebraic=true+). \begin{LTXexample}[pos=t,preset=\centering] \psset{plotpoints=200} \begin{pspicture}(-0.5,-2.25)(10,3) - \psaxes[labelFontSize=\footnotesize]{->}(0,0)(0,-2.25)(10,3) + \psaxes[labelFontSize=\scriptstyle]{->}(0,0)(0,-2.25)(10,3) \psplot[linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)*sin(x)} \psStep[algebraic,linecolor=magenta,StepType=upper](0,9){20}{sqrt(x)*sin(x)} \psStep[linecolor=blue,linestyle=dashed](0,9){20}{x sqrt x RadtoDeg sin mul} @@ -5856,7 +6043,7 @@ in postfix or algebraic notation (with \verb+algebraic=true+). \begin{LTXexample}[pos=t,preset=\centering] \psset{yunit=1.25cm,plotpoints=200} \begin{pspicture}(-0.5,-1.5)(10,1.5) - \psaxes[labelFontSize=\footnotesize]{->}(0,0)(0,-1.5)(10,1.5) + \psaxes[labelFontSize=\scriptstyle]{->}(0,0)(0,-1.5)(10,1.5) \psStep[algebraic,StepType=Riemann,fillstyle=solid,fillcolor=black!10](0,10){50}% {sqrt(x)*cos(x)*sin(x)} \psplot[linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)*cos(x)*sin(x)} @@ -5867,7 +6054,7 @@ in postfix or algebraic notation (with \verb+algebraic=true+). \begin{LTXexample}[pos=t,preset=\centering] \psset{yunit=1.25cm,plotpoints=200} \begin{pspicture}(-0.5,-1.5)(10,1.5) - \psaxes[labelFontSize=\footnotesize]{->}(0,0)(0,-1.5)(10,1.5) + \psaxes[labelFontSize=\scriptstyle]{->}(0,0)(0,-1.5)(10,1.5) \psStep[algebraic,StepType=infimum,fillstyle=solid,fillcolor=black!10](0,10){50}% {sqrt(x)*cos(x)*sin(x)} \psplot[linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)*cos(x)*sin(x)} @@ -5877,7 +6064,7 @@ in postfix or algebraic notation (with \verb+algebraic=true+). \begin{LTXexample}[pos=t,preset=\centering] \psset{yunit=1.25cm,plotpoints=200} \begin{pspicture}(-0.5,-1.5)(10,1.5) - \psaxes[labelFontSize=\footnotesize]{->}(0,0)(0,-1.5)(10,1.5) + \psaxes[labelFontSize=\scriptstyle]{->}(0,0)(0,-1.5)(10,1.5) \psStep[algebraic,StepType=supremum,fillstyle=solid,fillcolor=black!10](0,10){50}% {sqrt(x)*cos(x)*sin(x)} \psplot[linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)*cos(x)*sin(x)} @@ -5889,7 +6076,7 @@ in postfix or algebraic notation (with \verb+algebraic=true+). \begin{pspicture}[plotpoints=200](-0.5,-3)(10,2.5) \psStep[algebraic,fillstyle=solid,fillcolor=yellow](0.001,9.5){40}{2*sqrt(x)*cos(ln(x))*sin(x)} \psStep[algebraic,StepType=Riemann,fillstyle=solid,fillcolor=blue](0.001,9.5){40}{2*sqrt(x)*cos(ln(x))*sin(x)} - \psaxes[labelFontSize=\footnotesize]{->}(0,0)(0,-2.75)(10,2.5) + \psaxes[labelFontSize=\scriptstyle]{->}(0,0)(0,-2.75)(10,2.5) \psplot[algebraic,linecolor=white]{0.001}{9.75}{2*sqrt(x)*cos(ln(x))*sin(x)} \uput[90](6,1.2){$f(x)=2\cdot\sqrt{x}\cdot\cos{(\ln{x})}\cdot\sin{x}$} \end{pspicture} @@ -7562,7 +7749,8 @@ exch RadtoDeg sin -9.8 mul %% y' -gsin(y) \bgroup \def\Func{y[1]|-9.8*sin(y[0])} \psset{yunit=2,xunit=4,algebraic=true,linewidth=1.5pt} -\begin{pspicture}(0,-2.25)(3,2.25)\psgrid[subgriddiv=2,griddots=10] +\begin{pspicture}(0,-2.25)(3,2.25) + \psaxes{->}(0,0)(0,-2)(3,2) \psplot[linewidth=3\pslinewidth, linecolor=Orange]{0}{3}{.1*cos(sqrt(9.8)*x)} \psset{method=rk4,plotpoints=50,linecolor=blue} \psplotDiffEqn{0}{3}{.1 0}{\Func} @@ -7578,7 +7766,8 @@ exch RadtoDeg sin -9.8 mul %% y' -gsin(y) \begin{lstlisting}[label=fig:second] \def\Func{y[1]|-9.8*sin(y[0])} \psset{yunit=2,xunit=4,algebraic=true,linewidth=1.5pt} -\begin{pspicture}(0,-2.25)(3,2.25)\psgrid[subgriddiv=2,griddots=10] +\begin{pspicture}(0,-2.25)(3,2.25) + \psaxes{->}(0,0)(0,-2)(3,2) \psplot[linewidth=3\pslinewidth, linecolor=Orange]{0}{3}{.1*cos(sqrt(9.8)*x)} \psset{method=rk4,plotpoints=50,linecolor=blue} \psplotDiffEqn{0}{3}{.1 0}{\Func} @@ -7594,7 +7783,7 @@ exch RadtoDeg sin -9.8 mul %% y' -gsin(y) \subsubsection{$y''=-\frac{y'}{4}-2y$}% $ %-------------------------------------------------------------------------------------- -Pour $y_0=5$ et $y'_0=0$ la solution est : +For $y_0=5$ and $y'_0=0$ the solution is: \[ 5e^{-\frac{x}{8}}\left(\cos\left(\omega x\right)+\frac{\sin(\omega x)}{8\omega}\right) @@ -7618,7 +7807,7 @@ sub %% y' y'/-4-2y \bgroup \psset{xunit=.6,yunit=0.8,plotpoints=500} \begin{pspicture}(0,-4.25)(26,5.25) - \psgrid[subgriddiv=0,gridcolor=lightgray,linewidth=1.5pt] + \psaxes{->}(0,0)(0,-4)(26,5) \psplot[plotpoints=200,linewidth=4\pslinewidth,linecolor=gray]{0}{26}{% Euler x -8 div exp x 127 sqrt 8 div mul RadtoDeg dup cos 5 mul exch sin 127 sqrt div 5 mul add mul} \psplotDiffEqn[linecolor=red,linewidth=5\pslinewidth]{0}{26}{5 0} @@ -7635,7 +7824,7 @@ sub %% y' y'/-4-2y \begin{lstlisting} \psset{xunit=.6,yunit=0.8,plotpoints=500} \begin{pspicture}(0,-4.25)(26,5.25) - \psgrid[subgriddiv=0,gridcolor=lightgray,linewidth=1.5pt] + \psaxes{->}(0,0)(0,-4)(26,5) \psplot[plotpoints=200,linewidth=4\pslinewidth,linecolor=gray]{0}{26}{% Euler x -8 div exp x 127 sqrt 8 div mul RadtoDeg dup cos 5 mul exch sin 127 sqrt div 5 mul add mul} \psplotDiffEqn[linecolor=red,linewidth=5\pslinewidth]{0}{26}{5 0} @@ -7889,6 +8078,7 @@ PostScript uses the stack system and the LIFO system, "'Last In, First Out"`. \section{Credits} %-------------------------------------------------------------------------------------- {Hendri Adriaens | } +{Stefano Baroni | } {Martin Chicoine | } {Ulrich Dirr | } {Christophe Fourey | } diff --git a/Master/texmf-dist/source/generic/pstricks-add/Makefile b/Master/texmf-dist/source/generic/pstricks-add/Makefile index 23f8a938ded..9bddc79be2f 100644 --- a/Master/texmf-dist/source/generic/pstricks-add/Makefile +++ b/Master/texmf-dist/source/generic/pstricks-add/Makefile @@ -1,11 +1,11 @@ -# `Makefile' for `pst-tricks-doc.pdf', hv, 2006/11/06 +# `Makefile' for `pstricks-add-doc.pdf', hv, 2008/11/06 .SUFFIXES : .tex .dvi .ps .pdf .eps PACKAGE = pstricks-add -MAIN = pstricks-add-doc +MAIN = $(PACKAGE)-doc LATEX = latex @@ -13,6 +13,8 @@ ARCHNAME = $(MAIN)-$(shell date +%y%m%d) ARCHFILES = $(PACKAGE).sty $(PACKAGE).tex $(PACKAGE).pro $(MAIN).tex README Changes Makefile +TDS = ~/PSTricks/PSTricks-TDS + all : doc clean doc: $(MAIN).pdf @@ -37,13 +39,32 @@ $(MAIN).dvi : $(MAIN).tex clean : $(RM) *.dat - $(RM) $(addprefix $(MAIN), .log .aux .glg .glo .gls .ilg .idx .ind .tmp .toc .out ) + $(RM) $(addprefix $(MAIN), .log .aux .bbl .blg .glg .glo .gls .ilg .idx .ind .tmp .toc .out ) $(RM) $(addprefix $(MAIN), .dvi .ps) veryclean : clean - $(RM) $(addprefix $(MAIN), .pdf .bbl .blg) + $(RM) $(addprefix $(MAIN), .pdf ) arch : zip $(ARCHNAME).zip $(ARCHFILES) +tds: + cp -u Changes $(TDS)/doc/generic/$(PACKAGE)/ + cp -u README $(TDS)/doc/generic/$(PACKAGE)/ + cp -u $(MAIN).pdf $(TDS)/doc/generic/$(PACKAGE)/ +# + cp -u Changes $(TDS)/tex/latex/$(PACKAGE)/ + cp -u $(PACKAGE).sty $(TDS)/tex/latex/$(PACKAGE)/ +# + cp -u Changes $(TDS)/tex/generic/$(PACKAGE)/ + cp -u $(PACKAGE).tex $(TDS)/tex/generic/$(PACKAGE)/ +# + cp -u Changes $(TDS)/dvips/$(PACKAGE)/ + cp -u $(PACKAGE).pro $(TDS)/dvips/$(PACKAGE)/ +# + cp -u Changes $(TDS)/source/$(PACKAGE)/ + cp -u $(MAIN).tex $(TDS)/source/$(PACKAGE)/ + cp -u $(MAIN).bib $(TDS)/source/$(PACKAGE)/ + cp -u Makefile $(TDS)/source/$(PACKAGE)/ + # EOF 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 b4af4db6b5d..635b5af75d3 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 25 2008-06-06 10:33:45Z herbert $ +%% $Id: pstricks-add.tex 37 2008-07-11 13:39:23Z 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.05} -\def\filedate{2008/06/12} +\def\fileversion{3.07} +\def\filedate{2008/06/30} \message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)} % \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax @@ -163,6 +163,9 @@ \global#2=\the\pst@dimm% \endgroup% } +\def\pst@int#1{\expandafter\pst@@int#1..\@nil} +\def\pst@@int#1.#2.\@nil{#1} + % %--------------------------------------- small stuff ------------------------------- \define@boolkey[psset]{pstricks-add}[Pst@]{CMYK}[true]{} @@ -274,6 +277,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Begin patch TN; Date (YY-MM-DD): 04-07-17; 2nd part \def\psls@dashed{% + \psk@linecap\space setlinecap \ifpsdashadjust [ \psk@dash ] \pst@linetype\space \tx@DashLine \else @@ -1330,14 +1334,86 @@ %%%%%%%%%%% %%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % +% Euclide Algorithm (macro by Jean-Come Charpentier) +% #1 : numerator (number.unit) (e.g. 4.\pi or 3.\ell or 12.a) +% #2 : denominator +\def\psIrFrac#1#2{{% + % extrait le num'erateur et l'unit'e + \ps@extract@unit#1\@nil + % d'enominateur + \pst@cntb=#2\relax + \pst@cntc=\@ne + % test du signe et op'erandes toutes positives + \ifnum\pst@cnta<\z@ + \pst@cntc=-\pst@cntc + \pst@cnta=-\pst@cnta + \fi + \ifnum\pst@cntb<\z@ + \pst@cntc=-\pst@cntc + \pst@cntb=-\pst@cntb + \fi + \ifnum\pst@cntc=\@ne + \def\ps@ir@sign{}% + \else + \def\ps@ir@sign{-}% + \fi + % calcul pgcd + \loop + \pst@cntd=\pst@cnta + \pst@cntc=\pst@cnta + \divide\pst@cntd\pst@cntb + \multiply\pst@cntd\pst@cntb + \advance\pst@cntc-\pst@cntd + \ifnum\pst@cntc>\z@ + \pst@cnta=\pst@cntb + \pst@cntb=\pst@cntc + \repeat + % pgcd dans \ir@r + \pst@cntc=\pst@cntb + \pst@cnta=\ps@ir@num + \pst@cntb=#2\relax + % op'erandes toutes positives + \ifnum\pst@cnta<\z@ + \pst@cnta=-\pst@cnta + \fi + \ifnum\pst@cntb<\z@ + \pst@cntb=-\pst@cntb + \fi + % division par le pgcd + \divide\pst@cnta\pst@cntc + \divide\pst@cntb\pst@cntc + % affichage + \ifnum\pst@cnta=\z@ + 0% + \else\ifnum\pst@cnta=\@ne + \ifnum\pst@cntb=\@ne + \ps@ir@sign\ps@ir@unit% + \else + \frac{\ps@ir@sign\ps@ir@unit}{\the\pst@cntb}% + \fi + \else + \ifnum\pst@cntb=\@ne + \ps@ir@sign\the\pst@cnta\ps@ir@unit% + \else + \frac{\ps@ir@sign\the\pst@cnta\ps@ir@unit}{\the\pst@cntb}% + \fi + \fi\fi +}} +% +\def\ps@extract@unit#1.#2\@nil{% + \pst@cnta=#1\relax + \def\ps@ir@num{#1}% sauvegarde (le pgcd 'ecrase la valeur \ir@a) + \def\ps@ir@unit{#2}% +} +% \define@key[psset]{pstricks-add}{labelFontSize}{\def\psk@labelFontSize{#1}}% \define@boolkey[psset]{pstricks-add}[Pst@]{mathLabel}[true]{% - \ifPst@mathLabel + \ifPst@mathLabel% \def\pshlabel##1{$\psk@labelFontSize##1$}% - \def\psvlabel##1{$\psk@labelFontSize##1$} - \else + \def\psvlabel##1{$\psk@labelFontSize##1$}% + \else% \def\pshlabel##1{\psk@labelFontSize##1}% - \def\psvlabel##1{\psk@labelFontSize##1} + \def\psvlabel##1{\psk@labelFontSize##1}% \fi} %\psset{labelFontSize={},mathLabel} % @@ -1388,34 +1464,49 @@ % \define@key[psset]{pstricks-add}{trigLabelBase}{\pst@getint{#1}{\psk@trigLabelBase}} \psset{trigLabelBase=0} - +% +\define@boolkey[psset]{pstricks-add}[Pst@]{trigLabelsSimplify}[true]{} +\psset[pstricks-add]{trigLabelsSimplify=true} +% \define@boolkey[psset]{pstricks-add}[Pst@]{trigLabels}[true]{% \ifPst@trigLabels - \def\pst@@@hlabel##1{\pshlabel{##1}} + \def\pst@@@hlabel##1{\pshlabel{##1}}% + \ifPst@trigLabelsSimplify + \def\pshlabel##1{% + \ifPst@mathLabel + $\psk@labelFontSize\psIrFrac{##1.\pi}{\psk@trigLabelBase}$ + \else + \psk@labelFontSize$\psIrFrac{##1.\pi}{\psk@trigLabelBase}$ + \fi}% + \else \def\pshlabel##1{% - \ifnum\psk@trigLabelBase<2 - \def\de@nominator{\@ne}\else\def\de@nominator{\psk@trigLabelBase}\fi - \def\pst@tempA{##1} + \ifnum\psk@trigLabelBase<\tw@ + \def\de@nominator{\@ne}% + \else + \def\de@nominator{\psk@trigLabelBase}% + \fi + \def\pst@tempA{##1}% \pst@abs{\pst@tempA}\pst@cntm \pst@mod{\pst@cntm}{\de@nominator}\pst@cntp % cntb=##1 modulo trigLabelBase \ifnum\@ne>\pst@cntp % 1 > modulo -> then we have pi/x - \pst@cnto=\pst@cntm \divide\pst@cnto by \de@nominator - \ifPst@mathLabel + \pst@cnto=\pst@cntm + \divide\pst@cnto\de@nominator + \ifPst@mathLabel% $\psk@labelFontSize - \ifnum\pst@tempA<0 -\fi% + \ifnum\pst@tempA<\z@ -\fi \ifnum\pst@cnto=\@ne % #1 = trigLabelBase \pi % print pi \else \the\pst@cnto\pi % print \pst@cnto/\de@nominator pi - \fi$ + \fi$% \else - \psk@labelFontSize - \ifnum\pst@tempA<0 -\fi% - \ifnum\pst@cnto=\@ne % #1 = trigLabelBase - $\pi$ % print pi + \psk@labelFontSize% + \ifnum\pst@tempA<\z@ -\fi + \ifnum\pst@cnto=\@ne % #1 = trigLabelBase + $\pi$% % print pi \else - \the\pst@cnto$\pi$ % print \pst@cnto/\de@nominator pi - \fi + \the\pst@cnto$\pi$% % print \pst@cnto/\de@nominator pi + \fi \fi \else \ifPst@mathLabel @@ -1423,57 +1514,100 @@ \ifnum\pst@cntp=\@ne % < 1 pi? \if\pst@cntm=\@ne \frac{\pi}{\de@nominator} % pi/x - \else\ifnum\pst@tempA=-1 \frac{-\pi}{\de@nominator} - \else \ifnum\pst@tempA=1 \frac{\pi}{\de@nominator} - \else\frac{\pst@tempA\pi}{\de@nominator} % (x pi)/y - \fi\fi\fi + \else + \ifnum\pst@tempA=\m@ne + \frac{-\pi}{\de@nominator} + \else + \ifnum\pst@tempA=\@ne + \frac{\pi}{\de@nominator} + \else + \frac{\pst@tempA\pi}{\de@nominator} (x pi)/y + \fi + \fi + \fi \else - \ifnum\pst@tempA=1 \frac{\pi}{\de@nominator} - \else\ifnum\pst@tempA=\de@nominator \pi - \else\frac{\pst@tempA\pi}{\de@nominator} - \fi\fi\fi$ + \ifnum\pst@tempA=\@ne + \frac{\pi}{\de@nominator} + \else + \ifnum\pst@tempA=\de@nominator + \pi + \else + \frac{\pst@tempA\pi}{\de@nominator} + \fi + \fi + \fi$% \else - \psk@labelFontSize + \psk@labelFontSize% \ifnum\pst@cntp=\@ne % < 1 pi? - \if\pst@cntm=\@ne - $\frac{\pi}{\de@nominator}$ % pi/x - \else\ifnum\pst@tempA=-1 $\frac{-\pi}{\de@nominator}$ - \else \ifnum\pst@tempA=1 $\frac{\pi}{\de@nominator}$ - \else$\frac{\pst@tempA\pi}{\de@nominator}$ % (x pi)/y - \fi\fi\fi + \ifnum\pst@cntm=\@ne + $\frac{\pi}{\de@nominator}$% % pi/x + \else + \ifnum\pst@tempA=\m@ne + $\frac{-\pi}{\de@nominator}$% + \else + \ifnum\pst@tempA=\@ne + $\frac{\pi}{\de@nominator}$% + \else + $\frac{\pst@tempA\pi}{\de@nominator}$% (x pi)/y + \fi + \fi + \fi \else - \ifnum\pst@tempA=1 $\frac{\pi}{\de@nominator}$ - \else\ifnum\pst@tempA=\de@nominator $\pi$ - \else$\frac{\pst@tempA\pi}{\de@nominator}$ - \fi\fi\fi + \ifnum\pst@tempA=\@ne + $\frac{\pi}{\de@nominator}$% + \else + \ifnum\pst@tempA=\de@nominator + $\pi$% + \else + $\frac{\pst@tempA\pi}{\de@nominator}$% + \fi + \fi + \fi \fi - \fi% + \fi }% + \fi \else \def\pst@@@hlabel##1{% \edef\@xyDecimals{\psk@xDecimals}% - \ifnum\psk@ticks<\tw@ % ticks=all|x + \ifnum\psk@ticks<\tw@% ticks=all|x \ifx\psk@xlogBase\@empty - \pshlabel{\psk@labelFontSize\expandafter\@LabelComma##1..\@nil\psk@xlabelFactor}% - \else% - \pshlabel{\psk@labelFontSize\psk@xlogBase\textsuperscript{\expandafter\@stripDecimals##1..\@nil }} - \fi% - \fi% - } + \pshlabel{% + \psk@labelFontSize\expandafter\@LabelComma##1..\@nil\psk@xlabelFactor}% + \else + \pshlabel{% + \psk@labelFontSize\psk@xlogBase% + \textsuperscript{\expandafter\@stripDecimals##1..\@nil}}% + \fi + \fi + }% \ifPst@mathLabel - \def\pshlabel##1{$\psk@labelFontSize##1$}\else + \def\pshlabel##1{$\psk@labelFontSize##1$}% + \else \def\pshlabel##1{\psk@labelFontSize##1}% - \fi - \fi + \fi% + \fi% } \psset{trigLabels=false} % %logLines=all|x|y|none (0,1,2,3) \define@key[psset]{pstricks-add}{logLines}{\pst@expandafter\psset@@logLines{#1}\@nil\psk@logLines} \def\psset@@logLines#1#2\@nil#3{% - \ifx#1a\let#3\z@\else - \ifx#1x\let#3\@ne\else - \ifx#1y\let#3\tw@\else + \ifx#1a + \let#3\z@ + \Pst@maxxTickstrue\Pst@maxyTickstrue + \set@xticksize{0 4pt}\set@yticksize{0 4pt}% + \else + \ifx#1x + \let#3\@ne + \Pst@maxxTickstrue\Pst@maxyTicksfalse + \set@xticksize{0 4pt}% + \else + \ifx#1y + \let#3\tw@ + \Pst@maxyTickstrue\Pst@maxxTicksfalse + \set@yticksize{0 4pt}% + \else \ifx#1n\let#3\thr@@\else \@pstrickserr{Bad argument: `#1#2'}\@ehpa \fi\fi\fi\fi} @@ -1522,14 +1656,14 @@ \def\pst@@@vlabel#1{% \edef\@xyDecimals{\psk@yDecimals}% % \psk@yLabel% - \ifodd\psk@ticks % ticks=all||y (0,2) - \else - \ifx\psk@ylogBase\@empty + \ifodd\psk@ticks% ticks=all||y (0,2) + \else% + \ifx\psk@ylogBase\@empty% % \ifPst@comma \psvlabel{\expandafter\@LabelComma#1..\@nil\psk@ylabelFactor}% % \else\psvlabel{#1\psk@ylabelFactor}\fi% \else% - \psvlabel{\psk@ylogBase\textsuperscript{\expandafter\@stripDecimals#1..\@nil }} + \psvlabel{\psk@ylogBase\textsuperscript{\expandafter\@stripDecimals#1..\@nil }}% \fi% \fi% } @@ -1582,8 +1716,8 @@ } % \def\psxs@axes{{% - \ifPst@xAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{}\fi% - \ifPst@yAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{exch}\fi% + \ifPst@xAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{}{x}\fi% + \ifPst@yAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{exch}{y}\fi% }} \def\psaxes{\pst@object{psaxes}} \def\psaxes@i{\pst@getarrows\psaxes@ii} @@ -1601,8 +1735,8 @@ \begingroup% \pssetxlength\pst@dimc{#5}% ur-x \pssetylength\pst@dimd{#6}% ur-y - \ifdim\pst@dimc<\z@ \ifdim\pst@dimd<\z@ % axes show to left and down - \addbefore@par{xlabelPos=top,ylabelPos=right}\fi\fi + \ifdim\pst@dimc<\z@\ifdim\pst@dimd<\z@% axes show to left and down + \addbefore@par{xlabelPos=top,ylabelPos=right}\fi\fi% \setbox\pst@hbox=\hbox\bgroup% \use@par% now the same with an optional unit=... in par \pssetxlength\pst@dimg{#1}% o-x @@ -1611,15 +1745,15 @@ \pssetylength\pst@dimb{#4}% ll-y \pssetxlength\pst@dimc{#5}% ur-x \pssetylength\pst@dimd{#6}% ur-y - % If minimum values are negative in log mode, we modify Ox - % (respectively Oy) if this was not done by the user - % X axis labels (\psk@log = 0 or 1) +% If minimum values are negative in log mode, we modify Ox +% (respectively Oy) if this was not done by the user +% X axis labels (\psk@log = 0 or 1) % % Whole thing will be translated to origin: - \advance\pst@dima-\pst@dimg% Dist. from ll-x to o-x - \advance\pst@dimb-\pst@dimh% Dist. from ll-y to o-y - \advance\pst@dimc-\pst@dimg% Dist. from ur-x to o-x - \advance\pst@dimd-\pst@dimh% Dist. from ur-y to o-y + \advance\pst@dima by -\pst@dimg% Dist. from ll-x to o-x + \advance\pst@dimb by -\pst@dimh% Dist. from ll-y to o-y + \advance\pst@dimc by -\pst@dimg% Dist. from ur-x to o-x + \advance\pst@dimd by -\pst@dimh% Dist. from ur-y to o-y % Make lines/arrows or frame: \@nameuse{psxs@\psk@axesstyle}% \psxs@axes or \psxs@frame \ifPst@yAxis% @@ -1627,7 +1761,7 @@ \ifdim\pst@dima=\z@\else\showoriginfalse\fi% \ifnum\psk@dy=\z@% \pst@dimg=\psk@Dy\psyunit% - \ifdim\pst@dimg<\p@ \pst@cnta=\psk@Dy \edef\psk@Dy{-\the\pst@cnta}\fi % v.1.21 + \ifdim\pst@dimg<\p@\pst@cnta=\psk@Dy\edef\psk@Dy{-\the\pst@cnta}\fi% v.1.21 \edef\psk@dy{\number\pst@dimg}% \fi% \ifPst@xAxis\else\showorigintrue\fi% @@ -1641,8 +1775,8 @@ \ifdim\pst@dimb=\z@\else\showoriginfalse\fi% \ifnum\psk@dx=\z@% \pst@dimg=\psk@Dx\psxunit% - \ifdim\pst@dimg<\p@ \pst@cnta=\psk@Dx \edef\psk@Dx{-\the\pst@cnta} % v.1.21 - \fi % v.1.21 + \ifdim\pst@dimg<\p@\pst@cnta=\psk@Dx\edef\psk@Dx{-\the\pst@cnta}% v.1.21 + \fi% v.1.21 \edef\psk@dx{\number\pst@dimg}% \fi% \ifPst@yAxis\else\showorigintrue\fi% @@ -1656,7 +1790,7 @@ \pssetxlength\pst@dimg{#1}% \pssetylength\pst@dimh{#2}% \leavevmode\psput@cartesian\pst@hbox% - \endgroup + \endgroup% \ignorespaces% } % @@ -1700,25 +1834,50 @@ \pst@yticksizeC=\pst@dimo% left \fi% } -\define@key[psset]{}{ticksize}{\set@xticksize{#1}\set@yticksize{#1}} -\define@key[psset]{pstricks-add}{xticksize}{\set@xticksize{#1}} -\define@key[psset]{pstricks-add}{yticksize}{\set@yticksize{#1}}% overwrites the definition in pstricks +\newif\ifPst@maxxTicks +\newif\ifPst@maxyTicks +\define@key[psset]{}{ticksize}{% + \psDEBUG[key:ticksize]{setting ticksize} + \def\pst@tempA{max}% + \def\pst@tempB{#1}% + \ifx\pst@tempA\pst@tempB + \psDEBUG[key:ticksize]{setting ticksize to max} + \Pst@maxxTickstrue\Pst@maxyTickstrue + \set@xticksize{0 4pt}\set@yticksize{0 4pt}% + \else + \psDEBUG[key:ticksize]{setting ticksize to user values} + \Pst@maxxTicksfalse\Pst@maxyTicksfalse% + \set@xticksize{#1}\set@yticksize{#1}% + \fi} +\define@key[psset]{pstricks-add}{xticksize}{% + \def\pst@tempA{max}% + \def\pst@tempB{#1}% + \ifx\pst@tempA\pst@tempB + \Pst@maxxTickstrue\set@xticksize{0 4pt}% + \psDEBUG[key:xticksize]{setting ticksize to max} + \else\set@xticksize{#1}\Pst@maxxTicksfalse\fi} +\define@key[psset]{pstricks-add}{yticksize}{% + \def\pst@tempA{max}% + \def\pst@tempB{#1}% + \ifx\pst@tempA\pst@tempB + \psDEBUG[key:yticksize]{setting ticksize to max} + \Pst@maxyTickstrue\set@yticksize{0 4pt}% + \else\set@yticksize{#1}\Pst@maxyTicksfalse\fi}% overwrites the definition in pstricks %\psset{ticksize=-4pt 4pt} % -% full= 0, top=1, bottom=-1 => 0 1 2 +% full= 0, top=1, bottom=-1, inner=2 => -1 0 1 2 \def\psset@tickstyle#1{\pst@expandafter\psset@@tickstyle{#1}\@nil}% overwrite it \def\psset@@tickstyle#1#2\@nil{% - \ifx#1f\let\psk@tickstyle\z@\else - \ifx#1t\let\psk@tickstyle\@ne + \ifx#1f\let\psk@tickstyle\z@\else % full + \ifx#1t\let\psk@tickstyle\@ne % top \edef\psk@xticksize{0 \pst@number\pst@xticksizeB}% \edef\psk@yticksize{0 \pst@number\pst@yticksizeB}% - \else - \ifx#1b\let\psk@tickstyle\m@ne + \else\ifx#1b\let\psk@tickstyle\m@ne % bottom \edef\psk@xticksize{\pst@number\pst@xticksizeA 0}% \edef\psk@yticksize{\pst@number\pst@yticksizeA 0}% - \else - \@pstrickserr{Bad tick style: `#1#2'}\@ehpa - \fi\fi\fi + \else\ifx#1i\let\psk@tickstyle\tw@% % inner (for frame) + \else\@pstrickserr{Bad tick style: `#1#2'}\@ehpa + \fi\fi\fi\fi } % \define@key[psset]{pstricks-add}{subticks}{\def\psk@xsubticks{#1}\def\psk@ysubticks{#1}} @@ -1784,11 +1943,10 @@ % \newif\ifis@yAxis% % -\def\psxs@@axes#1#2#3#4#5{% llx,lly,urx,ury,exch,arrowA,arrowB +\def\psxs@@axes#1#2#3#4#5#6{% llx,lly,urx,ury,exch,x|y,arrowA,arrowB \pst@killglue% \begin@SpecialObj% - \def\pst@tempA{#5}% - \ifx\pst@tempA\@empty\relax% + \ifx#6x\relax% % x-axis? \is@yAxisfalse% \ifnum\psk@dx=\z@% \pst@dimg=\psk@Dx\psxunit% @@ -1797,7 +1955,7 @@ \else% \is@yAxistrue% \ifnum\psk@dy=\z@% - \pst@dimg=\psk@Dy\psyunit% + \pst@dimg=\psk@Dy\psyunit% \def\psk@dy{\number\pst@dimg}% \fi% \fi% @@ -1848,11 +2006,11 @@ /MinValue { \ifis@yAxis yStart \else xStart \fi \ifx\psk@arrowA\@empty\else \psk@arrowsize\space CLW mul add \psk@arrowlength\space mul - viceversa { sub epsilon add } { add epsilon sub } ifelse \fi } def - /MaxValue { \ifis@yAxis yEnd \else xEnd \fi + viceversa { sub epsilon add }{ add epsilon sub } ifelse \fi } def + /MaxValue { \ifis@yAxis yEnd \else xEnd \fi \ifx\psk@arrowB\@empty\else \psk@arrowsize\space CLW mul add \psk@arrowlength\space mul - viceversa { add epsilon sub } { sub epsilon add } ifelse \fi } def + viceversa { add epsilon sub }{ sub epsilon add } ifelse \fi } def /logLines { \ifnum\psk@logLines=\z@ true \else % all axes \ifnum\psk@logLines<\tw@ % x axis @@ -1874,7 +2032,7 @@ \else\@nameuse{psls@\psxsubticklinestyle}\fi stroke} def %\iffalse % start ticks --------------------------------------------------------- - 0 dT MaxValue { % the positive part of the axes + 0 dT MaxValue 1 add{ % the positive part of the axes /cntTick exch def % the index logLines { % log lines? gsave @@ -1882,8 +2040,15 @@ /dx exch def % save index /x cntTick dT dx log mul add def % x abs MaxValue abs le { % out of range? - x minTickline #5\space moveto - x maxTickline #5\space lineto + \ifis@yAxis + \ifPst@maxyTicks true \else false \fi + \else + \ifPst@maxxTicks true \else false \fi + \fi + { x minTickline #5 moveto + x maxTickline #5 lineto } + { x tickstart STsize mul #5 moveto + x tickend STsize mul #5 lineto } ifelse } if } for subTwidth SLW subTColor % set line width and subtick color @@ -1891,27 +2056,41 @@ grestore % restore main tick status stroke /dsubT 0 def % no other subticks - } if + } if % end logLines dsubT abs 0 gt { % du we have subticks? gsave % save graphic state % start subticks ---------------------------------------------------------- /cntsubTick cntTick dsubT add def subTNo 1 sub { cntsubTick abs MaxValue abs le { % out of range? - cntsubTick tickstart STsize mul #5\space moveto - cntsubTick tickend STsize mul #5\space lineto + \ifis@yAxis + \ifPst@maxyTicks true \else false \fi + \else + \ifPst@maxxTicks true \else false \fi + \fi + { cntsubTick minTickline STsize mul #5 moveto + cntsubTick maxTickline STsize mul #5 lineto } + { cntsubTick tickstart STsize mul #5 moveto + cntsubTick tickend STsize mul #5 lineto } ifelse }{ exit } ifelse /cntsubTick cntsubTick dsubT add def } repeat - subTwidth SLW subTColor % set line width and subtick color + subTwidth SLW subTColor % set line width and subtick color subLSstroke % end subticks ---------------------------------------------------------- - grestore % restore tick status + grestore % restore tick status } if gsave - cntTick tickstart #5\space moveto % line begin main Tick - cntTick tickend #5\space lineto % lineto tick end - Twidth SLW TColor % set line width and tick color + \ifis@yAxis + \ifPst@maxyTicks true \else false \fi + \else + \ifPst@maxxTicks true \else false \fi + \fi + { cntTick minTickline #5 moveto + cntTick maxTickline #5 lineto } + { cntTick tickstart #5 moveto % line begin main Tick + cntTick tickend #5 lineto } ifelse % lineto tick end + Twidth SLW TColor % set line width and tick color LSstroke grestore } for @@ -1930,8 +2109,15 @@ /dx exch def % save index /x cntTick dT dx log mul add def % x abs MinValue abs le { % out of range? - x minTickline #5\space moveto - x maxTickline #5\space lineto + \ifis@yAxis + \ifPst@maxyTicks true \else false \fi + \else + \ifPst@maxxTicks true \else false \fi + \fi + { x minTickline #5 moveto + x maxTickline #5 lineto } + { x tickstart STsize mul #5 moveto + x tickend STsize mul #5 lineto } ifelse } if } for /dsubT 0 def @@ -1945,8 +2131,8 @@ /cntsubTick cntTick dsubT add def subTNo 1 sub { cntsubTick abs MinValue abs le { % out of range? - cntsubTick tickstart STsize mul #5\space moveto - cntsubTick tickend STsize mul #5\space lineto + cntsubTick tickstart STsize mul #5 moveto + cntsubTick tickend STsize mul #5 lineto }{ exit } ifelse /cntsubTick cntsubTick dsubT add def } repeat % for @@ -1956,8 +2142,8 @@ grestore % restore main state } if gsave - cntTick tickstart #5\space moveto % line begin main Tick - cntTick tickend #5\space lineto % lineto tick end + cntTick tickstart #5 moveto % line begin main Tick + cntTick tickend #5 lineto % lineto tick end Twidth SLW TColor % set line width and tick color LSstroke grestore @@ -1965,27 +2151,38 @@ % end ticks ---------------------------------------------------------- %\fi } if% - }% + }% end of \pscode \end@SpecialObj% \ignorespaces% }% % +% \def\psxs@frame{% \begin@SpecialObj% - \addto@pscode{% - \pst@number\pst@dima \pst@number\pst@dimb moveto \pst@number\pst@dimc \pst@number\pst@dimb L - \pst@number\pst@dimc \pst@number\pst@dimd L \pst@number\pst@dima \pst@number\pst@dimd L - closepath}% + \addto@pscode{ % the frame + \pst@number\pst@dima \pst@number\pst@dimb moveto % lower left + \pst@number\pst@dimc \pst@number\pst@dimb L % upper left + \pst@number\pst@dimc \pst@number\pst@dimd L % upper right + \pst@number\pst@dima \pst@number\pst@dimd L % lower right + closepath + }% \pst@stroke% \psk@fillstyle% \end@SpecialObj% \let\psk@arrowA\@empty% \let\psk@arrowB\@empty% -% \pst@dima=0pt\pst@dimb=0pt% -% \psset{xticksize=0 \pst@dimd,yticksize=0 \pst@dimc}% \pst@xticksizeC=\z@\pst@yticksizeC=\z@% - \psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{}% - \psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{exch}% + \psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{}{x}% x axis + \psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{ exch }{y}% y axis + \ifnum\psk@tickstyle=\tw@ % llx,lly,urx,ury,exch,x|y,arrowA,arrowB + \psDEBUG[psxs@frame]{psk@tickstyle=2 (inner)}% + \psDEBUG[psxs@frame]{pst@dima=\pst@number\pst@dima}% + \psDEBUG[psxs@frame]{pst@dimb=\pst@number\pst@dimb}% + \psDEBUG[psxs@frame]{pst@dimc=\pst@number\pst@dimc}% + \psDEBUG[psxs@frame]{pst@dimd=\pst@number\pst@dimd}% + \psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{ neg \pst@number\pst@dimd add }{x}% % upper x axis + \psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{ neg \pst@number\pst@dimc add exch }{y}% right y axis + \fi% } % % #1:Max/Min in pt from origin; #2:arrow; #3:min; #4:max @@ -1997,7 +2194,7 @@ \ifnum\pst@cnta=\z@\else% \pst@dimb=\psk@dx sp% % Space between ticks. \ifPst@yAxis\else\showorigintrue\fi% - \ifnum\psk@labels<\tw@ \ifPst@xAxis\pst@@hlabels\fi\fi% + \ifnum\psk@labels<\tw@\ifPst@xAxis\pst@@hlabels\fi\fi% \showoriginfalse% \fi% \fi% @@ -2005,30 +2202,32 @@ % Knows \pst@dimb and \pst@cnta \def\pst@@hlabels{% \psDEBUG[pst@@hlabels]{xticksizeC=\the\pst@xticksizeC}% - \vbox to\z@{% + \setbox\z@=\vbox{% save all in a box \ifcase\psk@xlabelPos \vskip-\pst@xticksizeA\vskip\pslabelsep\or - \vskip-1ex\or% - \vskip-\pst@xticksizeB\vskip-\pslabelsep\vskip-1ex% - \fi% + \vskip-1ex\or + \vskip-\pst@xticksizeB\vskip-\pslabelsep\vskip-1ex + \fi + \ifnum\pst@cnta<\z@ \pst@dimb=-\pst@dimb\fi \hbox to\z@{% - \ifnum\pst@cnta<\z@\pst@dimb=-\pst@dimb\fi% \ifshoworigin\hbox to \z@{\hss\pst@@@hlabel{\psk@Ox}\hss}\fi% \mmultido{\nA=\psk@Ox+\psk@Dx}{\pst@cnta}{% \hskip\pst@dimb\hbox to \z@{\hss% - \ifdim\nA pt=\z@ \pst@@@hlabel{0}\else\expandafter\pst@@@hlabel{\nA}\fi% prevent -0, doesn't work with \ifnum + \ifdim\nA pt=\z@ \pst@@@hlabel{0}% + \else\expandafter\pst@@@hlabel{\nA}% + \fi% prevent -0, doesn't work with \ifnum \hss}% }\hss% - } -}}% - + }% + }\ht\z@\z@ \dp\z@\z@ \box\z@}% set all values to zero +% % #1:Max/Min in pt from origin; #2:arrow; #3:min; #4:max % \psk@labels 0:all; 1:x; 2:y; 3:none \def\pst@vlabels#1#2#3#4{% \ifdim#1=\z@\else% \ifx#2\empty\else\advance#1\ifdim#1>\z@-\fi7\pslinewidth\fi% - \pst@cnta=#1\relax % % Distance (in sp) to end. - \divide\pst@cnta\psk@dy\relax % % Number of ticks/labels + \pst@cnta=#1\relax% % % Distance (in sp) to end. + \divide\pst@cnta\psk@dy\relax% % Number of ticks/labels \ifnum\pst@cnta=\z@\else% \pst@dima=\psk@dy sp% % Space between ticks. % \ifPst@xAxis\else\showorigintrue\fi% @@ -2049,8 +2248,8 @@ \offinterlineskip% \ifshoworigin% \vbox to \z@{\vss\hbox to\z@{% - \ifcase\psk@ylabelPos - \hss\pst@@@vlabel{\psk@Oy}\hskip\pslabelsep\hskip-\pst@yticksizeA\or + \ifcase\psk@ylabelPos% + \hss\pst@@@vlabel{\psk@Oy}\hskip\pslabelsep\hskip-\pst@yticksizeA\or% \hskip\pslabelsep\hss\pst@@@vlabel{\psk@Oy}\hss\or % right labels \hskip\pst@yticksizeB\hskip\pslabelsep\pst@@@vlabel{\psk@Oy}% \fi}\vss}% @@ -2060,10 +2259,11 @@ \vbox to \z@{% \vss\hbox to\z@{% \ifcase\psk@ylabelPos% and also check for -0 - \hss\ifdim\nA pt=\z@ \pst@@@vlabel{0}\else\pst@@@vlabel{\nA}\fi\hskip\pslabelsep\hskip-\pst@yticksizeA\or - \hskip\pslabelsep\hss\ifdim\nA pt=\z@ \pst@@@vlabel{0}\else\pst@@@vlabel{\nA}\fi\hss\or % right labels - \hskip\pst@yticksizeB\hskip\pslabelsep\ifdim\nA pt=\z@ \pst@@@vlabel{0}\else\pst@@@vlabel{\nA}\fi% - \fi}\vss} + \hss\ifdim\nA pt=\z@% + \pst@@@vlabel{0}\else\pst@@@vlabel{\nA}\fi\hskip\pslabelsep\hskip-\pst@yticksizeA\or% + \hskip\pslabelsep\hss\ifdim\nA pt=\z@\pst@@@vlabel{0}\else\pst@@@vlabel{\nA}\fi\hss\or% % right labels + \hskip\pst@yticksizeB\hskip\pslabelsep\ifdim\nA pt=\z@\pst@@@vlabel{0}\else\pst@@@vlabel{\nA}\fi% + \fi}\vss}% }\vss}% } % @@ -3093,28 +3293,26 @@ [ \pst@colorA ] aload length 1 eq { dup dup } if 3 array astore tx@addDict begin GTriangle end % PS part }% - \if@star\pspolygon(#1)(#2)(#3)\fi% draw borderline + \if@star\pspolygon[fillstyle=none](#1)(#2)(#3)\fi% draw borderline \def\pst@linetype{2}% \end@ClosedObj% -}} +}\ignorespaces} % -\define@key[psset]{pstricks-add}{dicescale}{\def\psk@dicescale{#1}} \def\psdice{\pst@object{psdice}} \def\psdice@i#1{{% - \pst@killglue - \psset{framearc=0.3,linewidth=1pt,dicescale=1.0}% + \pst@killglue% + \addbefore@par{framearc=0.3,linewidth=1pt}% \use@par% - \psscalebox{\psk@dicescale}{% \psframe(-0.5,-0.5)(0.5,0.5)% + \ifodd#1 \qdisk(0,0){0.1\psunit}\else\qdisk(-0.3,-0.3){0.1\psunit}\qdisk(0.3,0.3){0.1\psunit}\fi \ifcase#1% - \or\qdisk(0,0){3pt}% - \or\qdisk(-0.3,-0.3){3pt}\qdisk(0.3,0.3){3pt}% - \or\psdice@i{1}\psdice@i{2}% - \or\qdisk(-0.3,0.3){3pt}\qdisk(-0.3,-0.3){3pt}% - \qdisk(0.3,0.3){3pt}\qdisk(0.3,-0.3){3pt}% - \or\psdice@i{1}\psdice@i{4}% - \or\psdice@i{4}\qdisk(-0.3,0){3pt}\qdisk(0.3,0){3pt}% - \fi}% + \or\or\or\qdisk(-0.3,-0.3){0.1\psunit}\qdisk(0.3,0.3){0.1\psunit}% 3 + \or\qdisk(-0.3,0.3){0.1\psunit}\qdisk(0.3,-0.3){0.1\psunit}% 4 + \or\qdisk(-0.3,-0.3){0.1\psunit}\qdisk(0.3,0.3){0.1\psunit}% 5 + \qdisk(-0.3,0.3){0.1\psunit}\qdisk(0.3,-0.3){0.1\psunit} + \or\qdisk(-0.3,0.3){0.1\psunit}\qdisk(0.3,-0.3){0.1\psunit}% 6 + \qdisk(-0.3,0){0.1\psunit}\qdisk(0.3,0){0.1\psunit}% + \fi% \ignorespaces% }} % @@ -3152,100 +3350,333 @@ \ignorespaces% } % -\newdimen\pie@ColorIndex -\newdimen\pie@ColorStep -\newcount\pie@Toggle -\newif\if@pieSep -\newif\if@pieUserColor -% -\define@key[psset]{pstricks-add}{pieColor}{\pst@expandafter\psk@@pieColor{#1}\@nil} -\def\psk@@pieColor#1#2\@nil{% - \ifx#1r\def\psk@pieColor{2}\else - \ifx#1c\def\psk@pieColor{380}\else\def\psk@pieColor{0}\fi\fi} -\psset[pstricks-add]{pieColor=gray}% gray, color, randomColor -% -\define@key[psset]{pstricks-add}{pieSep}{\pst@getlength{#1}\psk@pieSep} -\psset[pstricks-add]{pieSep=10pt} +\newdimen\chart@ColorIndex +\newdimen\chart@ColorStep +\newdimen\pst@chartHeight +\newdimen\pst@chartStackDepth +\newdimen\pst@chartStackWidth +\newcount\chart@Toggle +\newif\if@chartSep +\newif\if@chartUserColor +% +\define@key[psset]{pstricks-add}{chartStyle}{\def\psk@chartStyle{#1}} +\psset[pstricks-add]{chartStyle=pie}% p)ie P)ie-3d-view h)istogram H)istogram-3dview +% +\define@key[psset]{pstricks-add}{chartColor}{\pst@expandafter\psk@@chartColor{#1}\@nil} +\def\psk@@chartColor#1#2\@nil{% + \ifx#1r\def\psk@chartColor{2}\else + \ifx#1c\def\psk@chartColor{380}\else\def\psk@chartColor{0}\fi\fi} +\psset[pstricks-add]{chartColor=gray}% gray, color, randomColor +% +\define@key[psset]{pstricks-add}{chartSep}{\pst@getlength{#1}\psk@chartSep} +\define@key[psset]{pstricks-add}{chartStack}{\pst@getint{#1}\psk@chartStack} +\define@key[psset]{pstricks-add}{chartStackDepth}{\pssetylength\pst@chartStackDepth{#1}} +\define@key[psset]{pstricks-add}{chartStackWidth}{\pssetxlength\pst@chartStackWidth{#1}} +\define@key[psset]{pstricks-add}{chartHeight}{\pssetylength\pst@chartHeight{#1}} +\psset[pstricks-add]{chartSep=10pt,chartStack=0,chartStackDepth=2cm,chartStackWidth=2cm, + chartHeight=5mm} % \define@key[psset]{pstricks-add}{userColor}{% - \pie@Toggle=0 - \def\pie@option{#1} - \ifx\pie@option\@empty\@pieUserColorfalse + \chart@Toggle=0 + \def\chart@option{#1} + \ifx\chart@option\@empty\@chartUserColorfalse \else - \@pieUserColortrue - \expandafter\psk@@pieUserColor#1,,\@nil + \@chartUserColortrue + \expandafter\psk@@chartUserColor#1,,\@nil \fi} -\def\psk@@pieUserColor#1,#2,#3\@nil{% - \advance\pie@Toggle by \@ne% - \xglobal\colorlet{pieFillColor\the\pie@Toggle}{#1}% -% \typeout{pie:colorlet:pieFillColor\the\pie@Toggle=#1} - \def\pie@option{#2} - \ifx\pie@option\@empty\else\psk@@pieUserColor#2,#3,\@nil\fi}% +\def\psk@@chartUserColor#1,#2,#3\@nil{% + \advance\chart@Toggle by \@ne% + \xglobal\colorlet{chartFillColor\the\chart@Toggle}{#1}% + \def\chart@option{#2} + \ifx\chart@option\@empty\else\psk@@chartUserColor#2,#3,\@nil\fi}% \psset[pstricks-add]{userColor={}} -\def\psPie{\pst@object{psPie}} -\def\psPie@i#1#2#3{% #1:values #2:separated pies #3:radius - \pst@killglue - \begingroup - \pst@dimm=0pt\pst@cnta=1% - \psforeach{\pie@tempA}{#1}{% + +\def\psChart{\pst@object{psChart}} +\def\psChart@i#1#2#3{% +% #1:values #2:separated charts +% #3 radius->pie; max height->histogram + \pst@killglue% + \global\pssetylength\pst@chartHeight{#3}% + \global\let\pst@chartRadius\pst@chartHeight% + \begingroup% + \def\psk@chartValues{#1}% + \def\psk@chartSepValues{#2}% only valid for a pie chart + \pst@dimm=\z@% sum of all entries (for a pie) + \pst@cnta=1% number of entries + \pst@dimn=\z@% greatest entry + \psforeach{\chart@tempA}{#1}{% \global\advance\pst@cnta by \@ne % no of entries - \global\advance\pst@dimm by \pie@tempA pt} + \global\advance\pst@dimm by \chart@tempA pt % sum of all entries + \pst@dima=\chart@tempA pt + \ifdim\pst@dima>\pst@dimn \global\pst@dimn=\pst@dima\fi}% \addbefore@par{dimen=outer}% + \typeout{: pst@par=\pst@par}% \begin@SpecialObj% - \pst@getlength{#3}\pie@Radius - \ifnum\psk@pieColor>0 - \pie@ColorStep=400\p@\else\pie@ColorStep=\p@\fi % the "numerical color" - \divide\pie@ColorStep by \pst@cnta% % step =1/no or 400/no -% \typeout{psPie:colorStep: \pst@number\pie@ColorStep}% - \pie@ColorIndex=\psk@pieColor pt% % the start color (gray or wave) + \ifnum\psk@chartColor>0 + \chart@ColorStep=400\p@\else\chart@ColorStep=\p@\fi % the "numerical color" + \divide\chart@ColorStep by \pst@cnta% % step =1/no or 400/no + \chart@ColorIndex=\psk@chartColor pt% % the start color (gray or wave) + \psDEBUG[psChart]{psk@chartStack=\psk@chartStack}% + \@nameuse{pscs@\psk@chartStyle}% + \end@SpecialObj% + \endgroup% + \ignorespaces% +} +% +\def\pscs@pie{% \degrees[\pst@number\pst@dimm]% % instead of 360 degrees - \def\pie@alpha{0}% + \def\chart@alpha{0}% \pst@dimm=0pt\pst@dimn=0pt\pst@dimo=0pt\pst@cnta=0% - \global\pie@Toggle=1 - \psforeach{\pie@tempA}{#1}{% - \global\advance\pst@dimm by \pie@tempA pt% - \global\advance\pst@dimn by \pie@alpha pt% - \def\pst@tempB{\pst@number\pie@ColorIndex}% -% \typeout{psPie:wave:color: \pst@tempB}% + \global\chart@Toggle=1 + \ifpsshadow% create shadow first + \psforeach{\chart@tempA}{\psk@chartValues}{% + \global\advance\pst@dimm by \chart@tempA pt% + \global\advance\pst@dimn by \chart@alpha pt% + \global\advance\pst@cnta by \@ne% + \pst@dimo=0.5\pst@dimn\advance\pst@dimo by 0.5\pst@dimm% half angle of the chart + \global\@chartSepfalse% + \psforeach{\chart@tempC}{\psk@chartSepValues}{\ifnum\chart@tempC=\the\pst@cnta + \global\@chartSeptrue\fi}% + \if@chartSep + \pswedge(\psk@chartSep pt;\pst@number\pst@dimo){\pst@chartRadius}{\pst@number\pst@dimn}{\pst@number\pst@dimm}% + \else + \pswedge{\pst@chartRadius}{\pst@number\pst@dimn}{\pst@number\pst@dimm} + \fi% + \global\let\chart@alpha\chart@tempA% + } + \psshadowfalse% + \fi% + \def\chart@alpha{0}% + \pst@dimm=0pt\pst@dimn=0pt\pst@dimo=0pt\pst@cnta=0% + \psforeach{\chart@tempA}{\psk@chartValues}{% + \global\advance\pst@dimm by \chart@tempA pt% + \global\advance\pst@dimn by \chart@alpha pt% + \def\pst@tempB{\pst@number\chart@ColorIndex}% + \psDEBUG[psChart:wave:color]{\pst@tempB}% \global\advance\pst@cnta by \@ne% - \if@pieUserColor\else - \def\pie@FillColor{pieFillColor\the\pst@cnta} - \ifnum\psk@pieColor>0 \xglobal\definecolor{\pie@FillColor}{wave}{\pst@tempB}% - \else\xglobal\definecolor{\pie@FillColor}{gray}{\pst@tempB}\fi% + \if@chartUserColor\else + \def\chart@FillColor{chartFillColor\the\pst@cnta} + \ifnum\psk@chartColor>0 \xglobal\definecolor{\chart@FillColor}{wave}{\pst@tempB}% + \else\xglobal\definecolor{\chart@FillColor}{gray}{\pst@tempB}\fi% \fi - \pst@dimo=0.5\pst@dimn\advance\pst@dimo by 0.5\pst@dimm% half angle of the pie - \global\@pieSepfalse% - \psforeach{\pie@tempC}{#2}{\ifnum\pie@tempC=\the\pst@cnta - \global\@pieSeptrue\fi}% - \if@pieSep - \pswedge[linecolor={pieFillColor\the\pst@cnta},fillstyle=solid,fillcolor={pieFillColor\the\pst@cnta}]% - (\psk@pieSep pt;\pst@number\pst@dimo){#3}{\pst@number\pst@dimn}{\pst@number\pst@dimm}% - \pst@dima=\pie@Radius pt \advance\pst@dima by \psk@pieSep pt - \pnode(\pst@dima;\pst@number\pst@dimo){psPie\the\pst@cnta}% - \pnode(.75\pst@dima;\pst@number\pst@dimo){psPieI\the\pst@cnta}% - \pnode(1.5\pst@dima;\pst@number\pst@dimo){psPieO\the\pst@cnta}% + \pst@dimo=0.5\pst@dimn\advance\pst@dimo by 0.5\pst@dimm% half angle of the chart + \global\@chartSepfalse% + \psforeach{\chart@tempC}{\psk@chartSepValues}{\ifnum\chart@tempC=\the\pst@cnta + \global\@chartSeptrue\fi}% + \if@chartSep + \pswedge[linecolor={chartFillColor\the\pst@cnta},fillstyle=solid,fillcolor={chartFillColor\the\pst@cnta}]% + (\psk@chartSep pt;\pst@number\pst@dimo){\pst@chartRadius}{\pst@number\pst@dimn}{\pst@number\pst@dimm}% + \pst@dima=\pst@chartRadius\advance\pst@dima by \psk@chartSep pt + \pnode(\pst@dima;\pst@number\pst@dimo){psChart\the\pst@cnta}% + \pnode(.75\pst@dima;\pst@number\pst@dimo){psChartI\the\pst@cnta}% + \pnode(1.5\pst@dima;\pst@number\pst@dimo){psChartO\the\pst@cnta}% \else - \pswedge[linecolor={pieFillColor\the\pst@cnta},fillstyle=solid,fillcolor={pieFillColor\the\pst@cnta}]% - {#3}{\pst@number\pst@dimn}{\pst@number\pst@dimm} - \pnode(#3;\pst@number\pst@dimo){psPie\the\pst@cnta}% - \pst@dima=\pie@Radius pt - \pnode(.75\pst@dima;\pst@number\pst@dimo){psPieI\the\pst@cnta}% - \pnode(1.5\pst@dima;\pst@number\pst@dimo){psPieO\the\pst@cnta}% + \pswedge[linecolor={chartFillColor\the\pst@cnta},fillstyle=solid,fillcolor={chartFillColor\the\pst@cnta}]% + {\pst@chartRadius}{\pst@number\pst@dimn}{\pst@number\pst@dimm} + \pnode(\pst@chartRadius;\pst@number\pst@dimo){psChart\the\pst@cnta}% + \pst@dima=\pst@chartRadius + \pnode(.75\pst@dima;\pst@number\pst@dimo){psChartI\the\pst@cnta}% + \pnode(1.5\pst@dima;\pst@number\pst@dimo){psChartO\the\pst@cnta}% \fi% - \global\let\pie@alpha\pie@tempA% - \global\advance\pie@Toggle by \@ne - \ifnum\pie@Toggle<3 - \global\advance\pie@ColorIndex by 2\pie@ColorStep + \global\let\chart@alpha\chart@tempA% + \global\advance\chart@Toggle by \@ne + \ifnum\chart@Toggle<3 + \global\advance\chart@ColorIndex by 2\chart@ColorStep \else - \global\pie@Toggle=0 - \global\advance\pie@ColorIndex by -\pie@ColorStep% + \global\chart@Toggle=0 + \global\advance\chart@ColorIndex by -\chart@ColorStep% \fi% }% end foreach - \end@SpecialObj% - \endgroup% - \ignorespaces% } +% +\def\pscs@histogram{% + \def\chart@maxValue{\pst@number\pst@dimn}% max of the data + \pst@@divide\pst@dimn\pst@chartHeight% maxValue/maxHeight + \psDEBUG[pscs@histogram]{chart@maxValue=\chart@maxValue} + \psDEBUG[pscs@histogram]{(maxValue/maxHeight)pst@dimg=\pst@number\pst@dimg} + \psDEBUG[pscs@histogram]{pst@chartHeight=\the\pst@chartHeight} + \pst@dimo=28.46\pst@dimg + \edef\pst@chartUnit{\pst@number\pst@dimo} +% \psaxes[axesstyle=frame, +% dy=1cm,Dy=\pst@number\pst@dimo](\the\pst@cnta,\the\pst@chartHeight) + \pst@dimm=0pt\pst@dimn=0pt\pst@dimo=0pt\pst@cnta=0% + \global\chart@Toggle=1 + \psforeach{\chart@tempA}{\psk@chartValues}{% + \global\advance\pst@dimm by \chart@tempA pt% + \def\pst@tempB{\pst@number\chart@ColorIndex}% + \psDEBUG[psChart:wave:color]{\pst@tempB}% + \global\advance\pst@cnta by \@ne% + \if@chartUserColor\else + \def\chart@FillColor{chartFillColor\the\pst@cnta} + \ifnum\psk@chartColor>0 \xglobal\definecolor{\chart@FillColor}{wave}{\pst@tempB}% + \else\xglobal\definecolor{\chart@FillColor}{gray}{\pst@tempB}\fi% + \fi + \psframe[linecolor={chartFillColor\the\pst@cnta},fillstyle=solid,fillcolor={chartFillColor\the\pst@cnta}]% + (!\the\pst@cnta\space \psk@chartSep\space 28.46 div sub 0) + (!\the\pst@cnta\space \psk@chartSep\space 28.46 div add \chart@tempA\space \pst@chartUnit\space div) + \pnode(!\the\pst@cnta\space 0){psChart\the\pst@cnta}% + \pnode(!\the\pst@cnta\space \chart@tempA\space 2 div \pst@chartUnit\space div){psChartM\the\pst@cnta}% + \pnode(!\the\pst@cnta\space \chart@tempA\space \pst@chartUnit\space div){psChartT\the\pst@cnta}% + \global\advance\chart@Toggle by \@ne + \ifnum\chart@Toggle<3 + \global\advance\chart@ColorIndex by 2\chart@ColorStep + \else + \global\chart@Toggle=0 + \global\advance\chart@ColorIndex by -\chart@ColorStep% + \fi% + }% end foreach +} +% +\def\pst@stackList{} +\def\addbefore@stackList#1{% + \ifx\pst@stackList\@empty + \xdef\pst@stackList{#1}% + \else + \toks@{#1}% + \pst@toks\expandafter{\pst@stackList}% + \xdef\pst@stackList{\the\toks@,\the\pst@toks}% + \fi% +} +% +\def\pscs@Histogram{% + \psDEBUG[pscs@Histogram]{psk@chartStack=\psk@chartStack}% + \def\chart@maxValue{\pst@number\pst@dimn}% max of the data + \pst@@divide\pst@dimn\pst@chartHeight% maxValue/maxHeight + \psDEBUG[pscs@Histogram]{chart@maxValue=\chart@maxValue}% + \psDEBUG[pscs@Histogram]{(maxValue/maxHeight)pst@dimg=\pst@number\pst@dimg}% + \psDEBUG[pscs@Histogram]{pst@chartHeight=\the\pst@chartHeight}% + \pst@dimo=28.46\pst@dimg% + \edef\pst@chartUnit{\pst@number\pst@dimo}% +% \psaxes[axesstyle=frame, +% dy=1cm,Dy=\pst@number\pst@dimo](\the\pst@cnta,\the\pst@chartHeight) + \pst@dimm=0pt\pst@dimn=0pt\pst@dimo=0pt\pst@cnta=0% + \global\chart@Toggle=1 % for color toggling + \pst@cntn=0 % stacked step + \pst@cnto=0 % for a stacked view + \pst@cntp=\psk@chartStack % for a stacked view + \def\pst@stackList{} + \psDEBUG[pscs@Histogram]{psk@chartStack=\the\pst@cntp}% + \psforeach{\chart@tempA}{\psk@chartValues}{% the loop + \ifnum\pst@cntp>0 % stacked version? + \advance\pst@cnto by \@ne % increase + \psDEBUG[pscs@Histogram]{chart@tempA=\chart@tempA}% + \expandafter\addbefore@stackList\expandafter{\chart@tempA}% + \psDEBUG[pscs@Histogram]{stack list=\pst@stackList}% + \ifnum\pst@cnto=\pst@cntp % draw? + \pst@cnto=\psk@chartStack\advance\pst@cnto by \m@ne + \psforeach{\chart@tempB}{\pst@stackList}{% the stack loop + \global\pst@cnta=\pst@cntn % we do not need the value + \psDEBUG[pscs@Histogram]{pst@cnto=\the\pst@cnto}% + \psDEBUG[pscs@Histogram]{pst@chartStackDepth=\the\pst@chartStackDepth}% + \psDEBUG[pscs@Histogram]{pst@chartStackWidth=\the\pst@chartStackWidth}% + \edef\pst@tempA{\the\pst@cnto}% + \psDEBUG[pscs@Histogram]{pst@tempA=\pst@tempA}% + \ifnum\pst@cnto>0 + \pst@dima=\pst@chartStackDepth% + \pst@dimb=\pst@chartStackWidth% + \divide \pst@dima by \pst@tempA% + \divide \pst@dimb by \pst@tempA% + \else\pst@dima=\z@ \pst@dimb=\z@% + \fi% + \rput(\the\pst@dima, \the\pst@dimb){\pscs@Histogram@i{\chart@tempB}} + \advance\pst@cnto by \m@ne % decrease stack counter + }% + \advance\pst@cntn by \tw@ % increase + \def\pst@stackList{}% reset stack list + \pst@cnto=0 % reset stack counter + \fi% + \else% + \pscs@Histogram@i{\chart@tempA}% non stacked version + \fi% + }% end foreach +} +% +\def\pscs@Histogram@i#1{% draw the 3d-like bar + \def\pst@tempB{\pst@number\chart@ColorIndex}% + \global\advance\pst@cnta by \@ne% + \if@chartUserColor\else + \def\chart@FillColor{chartFillColor\the\pst@cnta} + \ifnum\psk@chartColor>0 \xglobal\definecolor{\chart@FillColor}{wave}{\pst@tempB}% + \else\xglobal\definecolor{\chart@FillColor}{gray}{\pst@tempB}\fi% + \fi + \pspolygon[fillstyle=solid,fillcolor={chartFillColor\the\pst@cnta}]% + (!\the\pst@cnta\space \psk@chartSep\space 28.46 div sub 0)% ll + (!\the\pst@cnta\space \psk@chartSep\space 28.46 div add 0)% lr + (!\the\pst@cnta\space \psk@chartSep\space 28.46 div 1.5 mul add \psk@chartSep\space 56.92 div)% 'lr + (!\the\pst@cnta\space \psk@chartSep\space 28.46 div 1.5 mul add + \psk@chartSep\space 56.92 div #1 \pst@chartUnit\space div add )% 'ur + (!\the\pst@cnta\space \psk@chartSep\space 56.92 div sub + \psk@chartSep\space 56.92 div #1 \pst@chartUnit\space div add )% 'ul + (!\the\pst@cnta\space \psk@chartSep\space 28.46 div sub #1 \pst@chartUnit\space div)%ul + \psline% + (!\the\pst@cnta\space \psk@chartSep\space 28.46 div add 0)% lr + (!\the\pst@cnta\space \psk@chartSep\space 28.46 div add #1 \pst@chartUnit\space div) + (!\the\pst@cnta\space \psk@chartSep\space 28.46 div sub #1 \pst@chartUnit\space div)%ul + \psline% + (!\the\pst@cnta\space \psk@chartSep\space 28.46 div add #1 \pst@chartUnit\space div) + (!\the\pst@cnta\space \psk@chartSep\space 28.46 div 1.5 mul add + \psk@chartSep\space 56.92 div #1 \pst@chartUnit\space div add )% 'ur + \pnode(!\the\pst@cnta\space 0){psChart\the\pst@cnta}% + \pnode(!\the\pst@cnta\space #1 2 div \pst@chartUnit\space div){psChartM\the\pst@cnta}% + \pnode(!\the\pst@cnta\space #1 \pst@chartUnit\space div){psChartT\the\pst@cnta}% + \global\advance\chart@Toggle by \@ne + \ifnum\chart@Toggle<3 + \global\advance\chart@ColorIndex by 2\chart@ColorStep + \else + \global\chart@Toggle=0 + \global\advance\chart@ColorIndex by -\chart@ColorStep% + \fi% + \global\advance\chart@ColorIndex by 1pt +} +% +\def\psCancel{\pst@object{psCancel}}% by Stefano Baroni 2008-06-21 +\def\psCancel@i{\pst@makebox\psCancel@ii} +\def\psCancel@ii{% + \begingroup + \solid@star + \use@par + \pst@dima=\pslinewidth + \advance\pst@dima by \psframesep + \pst@dimc=\wd\pst@hbox\advance\pst@dimc by \pst@dima + \pst@dimb=\dp\pst@hbox\advance\pst@dimb by \pst@dima + \pst@dimd=\ht\pst@hbox\advance\pst@dimd by \pst@dima + \setbox\pst@hbox=\hbox{% + \ifpsboxsep\kern\pst@dima\fi + \begin@ClosedObj + \addto@pscode{ + \psk@cornersize % arcradius boolean + \pst@number\pst@dima neg + \pst@number\pst@dimb neg + \pst@number\pst@dimc + \pst@number\pst@dimd + .5 + \if@star \tx@Frame \else + CLW mul /a ED % the middle of the line + 3 -1 roll 2 copy gt { exch } if + a sub /y2 ED + a add /y1 ED + 2 copy gt { exch } if + a sub /x2 ED + a add /x1 ED + pop pop % delete arc values + x1 y1 moveto + x2 y2 lineto + x2 y1 moveto + x1 y2 lineto + \fi + }% + \def\pst@linetype{2}% + \showpointsfalse + \end@ClosedObj + \box\pst@hbox + \ifpsboxsep\kern\pst@dima\fi% + }% + \ifpsboxsep\dp\pst@hbox=\pst@dimb\ht\pst@hbox=\pst@dimd\fi + \leavevmode\box\pst@hbox + \endgroup% +} +% \def\resetOptions{% \@zero=0% \def\pst@linetype{0}% @@ -3325,7 +3756,6 @@ arcsep=0,radius=.25cm,% ref=c,rot=0,labelsep=5pt,refangle=0,% intSeparator={,},% - dicescale=1.0,% %%%%%%%%% pst-plot %%%%%%%%%%%%% labelFontSize={},% StepType=lower, % alternative SumType=upper -- cgit v1.2.3