diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex | 504 |
1 files changed, 347 insertions, 157 deletions
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[<options>]{comma separated value list}{comma separated value list}{radius} +\psChart[<options>]{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 & <number> or empty & \{\}\\%ok %xLabel & <anything> & \{\}\\%ok %yLabel & <anything> & \{\}\\%ok %xyLabel & <anything> & \{\}\\%ok -%tickstyle & full|top|bottom & full\\%ok ticks & <all|x|y|none> & all\\%ok +tickstyle & full|top|bottom|inner & full\\%ok subticks & <number> & 0\\ xsubticks & <number> & 0\\ ysubticks & <number> & 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=<color> \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$} @@ -5503,6 +5576,91 @@ macros. This is the reason why it is a good idea to reset the values at the end %-------------------------------------------------------------------------------------- %-------------------------------------------------------------------------------------- +\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} %-------------------------------------------------------------------------------------- This new environment does the scaling, it expects as parameter the values (without units!) for the @@ -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 | } |