diff options
author | Karl Berry <karl@freefriends.org> | 2007-09-06 00:04:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-09-06 00:04:41 +0000 |
commit | ead5e3fc51a4bb838c6501f0b5629ee4bdb05f1e (patch) | |
tree | 00b04f0de00e602f7f857b111019580d52ee0885 /Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex | |
parent | 7bd5c6b234d7f277435ed89938e39422878e640b (diff) |
pstricks-add 2.88 (5sep07)
git-svn-id: svn://tug.org/texlive/trunk@4888 c570f23f-e606-0410-a88d-b1316a301751
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 | 429 |
1 files changed, 204 insertions, 225 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 36f38c09905..25a3ff2df72 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 @@ -93,7 +93,7 @@ \usepackage{graphicx,ragged2e} \usepackage[svgnames,dvipsnames]{pstricks} \usepackage{framed,xspace,multirow,caption} -\usepackage{pst-eucl} +\usepackage{pst-eucl,pst-fun} \usepackage{pstricks-add} \let\pstricksaddFV\fileversion \def\PST{\texttt{PSTricks}} @@ -402,89 +402,70 @@ macro. \psarc[linecolor=red,linewidth=0.4pt,showpoints=true] {->}(2,1){3}{0}{60} \pspolygon[linecolor=green,linewidth=1pt](2,1)(5,1.1)(6,-1)(2,-2) - \psrotate[linecolor=blue,linewidth=1pt](2,1){60}{ - \pspolygon(2,1)(5,1.1)(6,-1)(2,-2)} + \psrotate(2,1){60}{% + \pspolygon[linecolor=blue,linewidth=1pt](2,1)(5,1.1)(6,-1)(2,-2)} \end{pspicture} \end{LTXexample} -\clearpage -\iffalse -%-------------------------------------------------------------------------------------- -\section{\CMD{pslineII}: Colored lines} -%-------------------------------------------------------------------------------------- -The dashed lines are by default black and white lines. The new macro \verb|\pslineII| -offers two-color lines and has the same syntax as \verb|\psline|. - -\begin{LTXexample}[width=8cm] -\begin{pspicture}(0,-0.5)(7,0.5) -\pslineII[linewidth=5pt,arrowscale=2]{o-o}(0,0)(7,0) +\begin{LTXexample}[width=6cm] +\def\canne{% Idea by Manuel Luque + \psgrid[subgriddiv=0](-1,0)(1,5) + \pscustom[linewidth=2mm]{\psline(0,4)\psarcn(0.3,4){0.3}{180}{360}}% + \pscircle*(0.6,4){0.1}\pstriangle*(0,0)(0.2,-0.3)} +\def\Object{} +\begin{pspicture}(-1,-1)(3,6) + \canne + \psrotate(0.3,4){45}{\psset{linecolor=red!50}\canne} + \psrotate(0.3,4){90}{\psset{linecolor=blue!50}\canne} + \psrotate(0.3,4){360}{\psset{linecolor=cyan!50}\canne} + \psdot[linecolor=red](0.3,4) \end{pspicture} \end{LTXexample} -%-------------------------------------------------------------------------------------- -\subsection{The options} -%-------------------------------------------------------------------------------------- - -\begin{center} -\begin{tabular}{l|p{6cm}} -name & meaning\\\hline -\verb|dashColorI| & first color, default is \verb|black|\tabularnewline -\verb|dashColorII| & second color, default is \verb|red|\tabularnewline -\verb|dashNo| & the difference in per cent of the colored lines, default is $0.2$\tabularnewline -\verb|linecap| & \parbox[t]{6cm}{how two lines are connected.\\ - 0: no modification\\ - 1: rounded edges\\ - 2: an additional half square at both ends} -\end{tabular} -\end{center} - -\verb|dashNo| can have values greater than $1$. In this case the value will be taken as an absolute width in the pt unit. Only this unit is possible! - -\begin{LTXexample}[width=3.5cm] -\psset{linewidth=2pt} -\begin{pspicture}(3,3) - \pslineII{->}(0,0)(3,3) +\begin{LTXexample}[pos=t,wide] +\def\majorette{\psline[linewidth=0.5mm](0,2)% Idea by Manuel Luque + \pscircle[fillstyle=solid]{0.1} + \pscircle[fillstyle=solid](0,2){0.1}} +\begin{pspicture}(0,-6)(15,5) + \psaxes[linewidth=0.5pt]{->}(0,0)(0,-5)(15,5) + \pstVerb{/V0 10 def /Alpha 45 def}% vitesse initiale, angle de lancement + \multido{\nT=0.0+0.05,\iA=0+40}{41}{% + \pstVerb{/nT \nT\space def}% + \rput(!V0 Alpha cos mul nT mul -9.81 2 div nT dup mul mul V0 Alpha sin mul nT mul add){% + \psrotate(0,1){\iA}{\majorette\psdot[linecolor=red](0,1)\psdot[linecolor=green](0,2)}}} + \parametricplot[linecolor=red]{0}{2}{% trajectoire du milieu + V0 Alpha cos mul t mul -9.81 2 div t dup mul mul V0 Alpha sin mul t mul add 1 add} + \parametricplot[linecolor=green,plotpoints=360]{0}{2}{% d'une extrémité + V0 Alpha cos mul t mul 800 t mul sin sub % x(t) + -9.81 2 div t dup mul mul V0 Alpha sin mul t mul add 1 add 800 t mul cos add }%y(t) \end{pspicture} \end{LTXexample} -\begin{LTXexample}[width=3.5cm] -\psset{linewidth=2pt} -\begin{pspicture}(3,3) - \pslineII[dashColorI=blue]{->}(0,0)(3,3) -\end{pspicture} -\end{LTXexample} +\clearpage +%-------------------------------------------------------------------------------------- +\section{\CMD{psHomothetie}: central dilatation} +%-------------------------------------------------------------------------------------- -\begin{LTXexample}[width=3.5cm] -\psset{linewidth=2pt} -\begin{pspicture}(3,3) - \pslineII[dashColorI=blue,dashNo=15]{->}(0,0)(3,3) -\end{pspicture} -\end{LTXexample} +\begin{verbatim} +\psHomothetie[<options>](<center>){<factor>}{<object>} +\end{verbatim} -\begin{LTXexample}[width=3.5cm] -\psset{linewidth=2pt} -\begin{pspicture}(3,3) - \pslineII[dashColorI=blue,linecap=1,% - dashNo=0.3,linewidth=0.5](0,0)(2,3) +\begin{LTXexample}[width=9cm] +\begin{pspicture}[showgrid=true](-5,-4)(4,8) +\psBill% needs package pst-fun +\psHomothetie[linecolor=blue](4,-3){2}{\psBill} +\psdots[dotsize=3pt,linecolor=red](4,-3) +\pstVerb{ /m -3 -0.85 sub 4 0.6 sub div def } +\psplot[linestyle=dashed,linecolor=red]{-5}{4}{ m x mul m 4 mul sub 3 sub } +\psHomothetie[linecolor=green](4,-3){-0.2}{\psBill} \end{pspicture} \end{LTXexample} -\begin{LTXexample}[pos=t] -\psset{linewidth=15pt,dashNo=10} -\begin{pspicture}(0,1)(10,-6) - \pslineII[linecap=2](0,0)(5,0)(5,-5)(0,-5)(0,0) - \rput{45}(7,-2.5){% - \pslineII[linecap=1,dashColorI=yellow,% - dashColorII=cyan](0,0)(5,0)(5,-5)(0,-5)(0,0)% -} -\end{pspicture} -\end{LTXexample} -\clearpage -\fi +\clearpage %-------------------------------------------------------------------------------------- \section{\CMD{psbrace}} @@ -492,37 +473,68 @@ name & meaning\\\hline \subsection{Syntax} \begin{verbatim} \psbrace[<options>](<A>)(<B>){<text>} +\psbrace*[<options>](<A>)(<B>){<text>} \end{verbatim} + \begin{LTXexample}[width=4.5cm] \begin{pspicture}(4,4) \psgrid[subgriddiv=0,griddots=10] \pnode(0,0){A} \pnode(4,4){B} \psbrace[linecolor=red,ref=lC](A)(B){Text I} -\psbrace[linecolor=blue,ref=lC](3,4)(0,1){Text II} +\psbrace*[linecolor=blue,ref=lC](3,4)(0,1){Text II} +\psbrace[fillcolor=white](3,0)(3,4){III} \end{pspicture} \end{LTXexample} \bigskip -The option \verb|\specialCoor| is enabled, so that all types of coordinates are possible, (nodename), ($x,y$), ($nodeA|nodeB$), ... - +The option \verb|\specialCoor| is enabled, so that all types of coordinates +are possible, (nodename), ($x,y$), ($nodeA|nodeB$), \ldots +The star version fills the inner of the brace with the current linecolor. +With the fillcolor \verb+white+ or any other background color the brace can +be "`unfilled"'. %-------------------------------------------------------------------------------------- \subsection{Options} %-------------------------------------------------------------------------------------- -Additional to all other available options from \verb|pstricks| or the other related packages, there are two new option, named \verb|braceWidth| and \verb|bracePos|. All important ones are shown in the following table. +Additional to all other available options from \verb|pstricks| or the other +related packages, there are two new option, named \verb|braceWidth| and +\verb|bracePos|. All important ones are shown in the following graphics +and table. + +\begin{center} +\begin{pspicture}[showgrid=true](10,5) + \psbrace[braceWidth=1cm,braceWidthInner=1cm, + braceWidthOuter=1cm,bracePos=0.6,fillcolor=white, + nodesepA=10mm,nodesepB=10mm](0,5)(10,5){\fbox{Label}} +\pcline{<->}(3,3)(3,4)\ncput*{\footnotesize\ttfamily braceWidth} +\pcline{<->}(3,4)(3,5)\ncput*{\footnotesize\ttfamily braceWidthInner} +\pcline{<->}(3,2)(3,3)\ncput*{\footnotesize\ttfamily braceWidthOuter} +\pcline{<->}(6,1)(6,2)\ncput{\footnotesize\ttfamily nodesepB} +\pcline{<->}(6,1)(7,1)\ncput*{\footnotesize\ttfamily A} +\pcline{<->}(0,0.5)(6,0.5)\ncput*{\footnotesize\ttfamily bracePos} +\psdot[dotscale=2](0,5)\uput[0](0,5){\textbf{A}} +\psdot[dotscale=2](10,5)\uput[180](10,5){\textbf{B}} +\end{pspicture} +\end{center} + +A positive value for \verb+nodesepA+ and \verb+B+ shifts the label to the right +(\verb+nodesepA+) and down (\verb+nodesepB+). This does not depends the the +value for the rotating of the label! \begin{center} \begin{tabular}{l|l} name & meaning\\\hline -\verb|braceWidth| & default is $0.35$\\ +\verb|braceWidth| & default is \verb+2\pslinewidth+\\ +\verb|braceWidthInner| & default is \verb+10\pslinewidth+\\ +\verb|braceWidthOuter| & default is \verb+10\pslinewidth+\\ \verb|bracePos| & relative position (default is $0.5$)\\ -\verb|linearc| & absolute value for the arcs (default is $2$mm)\\ \verb|nodesepA| & x-separation (default is $0pt$)\\ \verb|nodesepB| & y-separation (default is $0pt$)\\ \verb|rot| & additional rotating for the text (default is $0$)\\ -\verb|ref| & reference point for the text (default is c) +\verb|ref| & reference point for the text (default is c)\\ +\verb|fillcolor| & default is black \end{tabular} \end{center} @@ -539,7 +551,7 @@ or \verb|t| (top), where the default is \verb|c|, the center of the object. \begin{LTXexample} \begin{pspicture}(8,2.5) \psbrace(0,0)(0,2){\fbox{Text}}% -\psbrace[nodesepA=20pt](2,0)(2,2){\fbox{Text}} +\psbrace[nodesepA=10pt](2,0)(2,2){\fbox{Text}} \psbrace[ref=lC](4,0)(4,2){\fbox{Text}} \psbrace[ref=lt,rot=90,nodesepB=-15pt](6,0)(6,2){\fbox{Text}} \psbrace[ref=lt,rot=90,nodesepA=-5pt,nodesepB=15pt](8,2)(8,0){\fbox{Text}} @@ -550,8 +562,8 @@ or \verb|t| (top), where the default is \verb|c|, the center of the object. \begin{LTXexample} \def\someMath{$\int\limits_1^{\infty}\frac{1}{x^2}\,dx=1$} \begin{pspicture}(8,2.5) -\psbrace(0,0)(0,2){\someMath}% -\psbrace[nodesepA=30pt](2,0)(2,2){\someMath} +\psbrace[ref=lC](0,0)(0,2){\someMath}% +\psbrace[rot=90](2,0)(2,2){\someMath} \psbrace[ref=lC](4,0)(4,2){\someMath} \psbrace[ref=lt,rot=90,nodesepB=-30pt](6,0)(6,2){\someMath} \psbrace[ref=lt,rot=90,nodesepB=30pt](8,2)(8,0){\someMath} @@ -563,8 +575,8 @@ or \verb|t| (top), where the default is \verb|c|, the center of the object. \begin{LTXexample} \begin{pspicture}(\linewidth,5) \psbrace(0,0.5)(\linewidth,0.5){\fbox{Text}}% -\psbrace[bracePos=0.25,nodesepB=-10pt,rot=90](0,2)(\linewidth,2){\fbox{Text}} -\psbrace[ref=lC,nodesepA=-3.5cm,nodesepB=-15pt,rot=90](0,4)(\linewidth,4){% +\psbrace[bracePos=0.25,nodesepB=10pt,rot=90](0,2)(\linewidth,2){\fbox{Text}} +\psbrace[ref=lC,nodesepA=-3.5cm,nodesepB=15pt,rot=90](0,4)(\linewidth,4){% \fbox{some very, very long wonderful Text}} \end{pspicture} \end{LTXexample} @@ -578,19 +590,19 @@ or \verb|t| (top), where the default is \verb|c|, the center of the object. \pnode(4,6){B} \psbrace[ref=lC](A)(B){One} \psbrace[rot=180,nodesepA=-5pt,ref=rb](B)(A){Two} -\psbrace[linecolor=blue,bracePos=0.25,braceWidth=1,ref=lB](8,1)(1,7){Three} -\psbrace[braceWidth=-1,rot=180,ref=rB](8,1)(1,7){Four} -\psbrace[linearc=0.5,linecolor=red,linewidth=3pt,braceWidth=1.5,% +\psbrace[linecolor=blue,bracePos=0.25,ref=lB](8,1)(1,7){Three} +\psbrace[braceWidth=-1mm,rot=180,ref=rB](8,1)(1,7){Four} +\psbrace*[linearc=0.5,linecolor=red,linewidth=3pt,braceWidth=1.5pt, bracePos=0.25,ref=lC](8,1)(8,9){A} \psbrace(4,9)(6,9){} \psbrace(6,9)(6,7){} \psbrace(6,7)(4,7){} \psbrace(4,7)(4,9){} \psset{linecolor=red} -\psbrace[ref=lb](7,10)(3,10){I} -\psbrace[ref=lb,bracePos=0.75](3,10)(3,6){II} -\psbrace[ref=lb](3,6)(7,6){III} -\psbrace[ref=lb](7,6)(7,10){IV} +\psbrace*[ref=lb](7,10)(3,10){I} +\psbrace*[ref=lb,bracePos=0.75](3,10)(3,6){II} +\psbrace*[ref=lb](3,6)(7,6){III} +\psbrace*[ref=lb](7,6)(7,10){IV} \end{pspicture} \end{LTXexample} @@ -607,8 +619,8 @@ or \verb|t| (top), where the default is \verb|c|, the center of the object. &&&&& \Rnode[href=2]{D}{0}~ \\ \end{pmatrix} \] -\psbrace[linewidth=0.1pt,rot=-90,nodesep=0.2](B)(A){\small n times} -\psbrace[linewidth=0.1pt,rot=-90,nodesep=0.2](D)(C){\small n times} +\psbrace[rot=-90,nodesepB=-0.5,nodesepA=-0.2](B)(A){\small n times} +\psbrace[rot=-90,nodesepB=-0.5,nodesepA=-0.2](D)(C){\small n times} \end{LTXexample} @@ -633,14 +645,12 @@ Some nonsense text, which is nothing more than nonsense. Some nonsense text, which is nothing more than nonsense. Some nonsense text, which is nothing more than nonsense. -\vspace*{-2ex} -\noindent\rnode{B}{}\psbrace[linecolor=red](A)(B){} +\vspace*{-2ex}\noindent\rnode{B}{}\psbrace*[linecolor=red](A)(B){} Some nonsense text, which is nothing more than nonsense. Some nonsense text, which is nothing more than nonsense. -\medskip -\hfill\begin{minipage}{0.95\linewidth} +\medskip\hfill\begin{minipage}{0.95\linewidth} \noindent\rnode{A}{} \vspace*{-1ex} @@ -675,14 +685,12 @@ Some nonsense text, which is nothing more than nonsense. Some nonsense text, which is nothing more than nonsense. Some nonsense text, which is nothing more than nonsense. -\vspace*{-2ex} -\noindent\rnode{B}{}\psbrace[linecolor=red](A)(B){} +\vspace*{-2ex}\noindent\rnode{B}{}\psbrace[linecolor=red](A)(B){} Some nonsense text, which is nothing more than nonsense. Some nonsense text, which is nothing more than nonsense. -\medskip -\hfill\begin{minipage}{0.95\linewidth} +\medskip\hfill\begin{minipage}{0.95\linewidth} \noindent\rnode{A}{} \vspace*{-1ex} @@ -695,8 +703,7 @@ Some nonsense text, which is nothing more than nonsense. Some nonsense text, which is nothing more than nonsense. Some nonsense text, which is nothing more than nonsense. -\vspace*{-2ex} -\noindent\rnode{B}{}\psbrace[linecolor=red](A)(B){} +\vspace*{-2ex}\noindent\rnode{B}{}\psbrace[linecolor=red](A)(B){} \end{minipage} \end{framed} \end{lstlisting} @@ -1501,7 +1508,21 @@ name & meaning\\\hline \end{pspicture} \end{LTXexample} +\subsection{Special arrow option \texttt{arrowLW}} + +Only for the arrowtype \texttt{o} and \texttt{*} it is possible to +set the arrowlinewidth with the optional keyword \texttt{arrowLW}. +Otherwise +\begin{LTXexample}[width=4cm] +\begin{pspicture}(4,6) +\psline[arrowscale=3,arrows=*-o](0,5)(4,5) +\psline[arrowscale=3,arrows=*-o, + arrowLW=0.5pt](0,3)(4,3) +\psline[arrowscale=3,arrows=*-o, + arrowLW=0.3333\pslinewidth](0,1)(4,1) +\end{pspicture} +\end{LTXexample} \clearpage @@ -1809,82 +1830,27 @@ or younger. Die Syntax is easy: \part{\texttt{pst-node}} %-------------------------------------------------------------------------------------- -\iffalse -\section{\CMD{nclineII}} -%-------------------------------------------------------------------------------------- -The dashed lines are black and white by default. The new macro \verb|\nclineII| -offers two-color lines and has the same syntax as \verb|\ncline|: -\begin{verbatim} -\ncline[<options>]{<Node A>}{<Node B>} -\end{verbatim} - -\begin{LTXexample}[width=0.2\linewidth] -\circlenode[linecolor=blue,linewidth=2pt]{A}{A}% -\hspace{9cm}\circlenode[linecolor=cyan,linewidth=2pt]{B}{B} -\nclineII[linewidth=5pt]{A}{B} -\end{LTXexample} - - -%-------------------------------------------------------------------------------------- -\subsection{The options} -%-------------------------------------------------------------------------------------- - -These options are all defined in the package \verb|pstricks-add|. - -\medskip -\begin{tabularx}{\linewidth}{l|X} -name & meaning\\\hline -\verb|dashColorI| & first color, default is \verb|black|\tabularnewline -\verb|dashColorII| & second color, default is \verb|red|\tabularnewline -\verb|dashNo| & The ratio of dashColorI to dashColorII, the default is $0.2$\tabularnewline -\end{tabularx} -\medskip - -\verb|dashNo| can have values greater than $1$. In this case the value will be taken as an absolute width in the pt unit. Only this unit is possible! - -%-------------------------------------------------------------------------------------- -\subsection{Examples} -%-------------------------------------------------------------------------------------- -\begin{LTXexample}[width=4.5cm] -\circlenode{A}{A}\hspace*{3cm}\dianode{B}{B}% -\nclineII[linewidth=8pt,dashColorI=blue]{A}{B} -\end{LTXexample} - -\begin{LTXexample}[width=4.5cm] -\circlenode{A}{A}\hspace*{3cm}\circlenode{B}{B}% -\nclineII[dashColorI=blue,linewidth=3pt,dashNo=15]{->}{A}{B} -\end{LTXexample} - -\begin{LTXexample}[width=4.5cm] -\dianode{A}{A}\hspace*{3cm}\circlenode{B}{B}% -\nclineII[dashColorI=blue,linecap=1,dashNo=0.3,linewidth=0.5]{A}{B} -\end{LTXexample} - -\psset{unit=1cm} - %-------------------------------------------------------------------------------------- -\section{\CMD{pclineII}} +\section{Relative nodes with \CMD{psGetNodeCenter}} %-------------------------------------------------------------------------------------- -This is nearly the same macro as \verb|\psline| from the main \pnode{C}\verb|pstricks| package. -\begin{verbatim} -\pcline[<options>](<Node A>)(<Node B>) -\end{verbatim} +The command \CMD{psGetNodeCenter}\verb+{node}+ makes only sense on PostScript level, it defines +the two variables \verb+node.x+ and \verb+node.y+ which can be used to define relative +nodes. The following example defines the node \verb+MyNode+ and a second one relative +to the first one, with 4 units left and 4 units up. \verb+node+ must be an +existing node name. -\begin{LTXexample} -\circlenode[linecolor=blue,linewidth=2pt]{A}{A}% -\hspace*{6cm}\circlenode[linecolor=cyan,linewidth=2pt]{B}{B} -\pclineII[linewidth=5pt](A)(B) +\begin{LTXexample}[width=5cm] +\begin{pspicture}[showgrid=true,arrowscale=2](5,5) +\pnode(4.5,0.5){MyNode} +\psdot(MyNode) +\pnode(! \psGetNodeCenter{MyNode} + MyNode.x 4 sub MyNode.y 4 add){MySecondNode} +\psdot(MySecondNode) +\ncline[linecolor=red]{<->}{MyNode}{MySecondNode} +\end{pspicture} \end{LTXexample} -\begin{LTXexample} -\RaggedRight This macro makes only sense when connecting two ''invisible`` nodes, -like this connection from here\pnode{D}\pclineII{->}(D)(C){} -to the above word \verb|pstricks|. -\end{LTXexample} - -\fi - %-------------------------------------------------------------------------------------- \section{\CMD{ncdiag} and \CMD{pcdiag}} %-------------------------------------------------------------------------------------- @@ -2433,6 +2399,21 @@ two given points, starting from the first one. %-------------------------------------------------------------------------------------- \section{ New options} %-------------------------------------------------------------------------------------- + +The axes macro has now two additional optional arguments for placing labels at +the end of the axes: + +\begin{verbatim} +\psaxes[settings]{arrows}(x0,y0)(x1,y1)(x2,y2)[Xlabel,Xangle][Ylabel,Yangle] +\end{verbatim} + +It has now four optional arguments, one for the setting, one for the arrows, one for +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 \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+ @@ -2523,7 +2504,7 @@ It will be overwritten when another package or a user defines \begin{LTXexample}[width=6cm] \begin{pspicture}(-0.25,-0.25)(5,2.25) -\psaxes{->}(5,2.25) +\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) @@ -2532,7 +2513,7 @@ It will be overwritten when another package or a user defines \psaxes[labelFontSize=\footnotesize]{->}(5,2.25) \end{pspicture}\\[20pt] \begin{pspicture}(-0.25,-0.25)(5,2.25) -\psaxes[labelFontSize=\tiny]{->}(5,2.25) +\psaxes[labelFontSize=\tiny]{->}(5,2.25)[\textbf{x},-90][\textbf{y},0] \end{pspicture}% \end{LTXexample} @@ -2592,7 +2573,7 @@ For the \verb+\parametricplot+ the two parts must be divided by the \verb+|+ cha %\begin{LTXexample}[pos=t] \psset{lly=-0.5cm} \psgraph(-10,-3)(10,2){\linewidth}{6cm} - \psset{algebraic=true, plotpoints=101} + \psset{algebraic, plotpoints=101} \psplot[linecolor=yellow, linewidth=4\pslinewidth]{-10}{10}{2*sin(x)}% \psplot[linecolor=red, showpoints=true]{-10}{10}{2*sin(x)} \endpsgraph @@ -2602,7 +2583,7 @@ For the \verb+\parametricplot+ the two parts must be divided by the \verb+|+ cha \begin{lstlisting} \psset{lly=-0.5cm} \psgraph(-10,-3)(10,2){\linewidth}{6cm} - \psset{algebraic=true, plotpoints=101} + \psset{algebraic,plotpoints=101} \psplot[linecolor=yellow, linewidth=4\pslinewidth]{-10}{10}{2*sin(x)}% \psplot[linecolor=red, showpoints=true]{-10}{10}{2*sin(x)} \endpsgraph @@ -2649,7 +2630,7 @@ $\displaystyle\sum_{n=0}^{+\infty}\frac{(-1)^nx^{2n}}{n!}$. \begin{center} \bgroup -\psset{algebraic=true,plotpoints=501, yunit=3} +\psset{algebraic, plotpoints=501, yunit=3} \def\getColor#1{\ifcase#1 black\or red\or magenta\or yellow\or green\or Orange\or blue\or DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\fi} \begin{pspicture}(-7,-1.5)(7,1.5) @@ -2664,7 +2645,7 @@ $\displaystyle\sum_{n=0}^{+\infty}\frac{(-1)^nx^{2n}}{n!}$. \egroup \end{center} \begin{lstlisting} -\psset{algebraic=true,plotpoints=501, yunit=3} +\psset{algebraic, plotpoints=501, yunit=3} \def\getColor#1{\ifcase#1 black\or red\or magenta\or yellow\or green\or Orange\or blue\or DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\fi} \begin{pspicture}(-7,-1.5)(7,1.5) @@ -2833,52 +2814,13 @@ The default setting \verb|{}| means, that you'll get the standard behaviour. \psset{xunit=10cm,yunit=0.01cm,labelFontSize=\footnotesize} \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) + xDecimals=3,yDecimals=1]{->}(0,0)(0,-100)(1.4,520)% + [\textbf{Amp\`ere},-90][\textbf{Voltage},0] \end{pspicture} \end{LTXexample} \resetOptions -\iffalse - -%-------------------------------------------------------------------------------------- -\subsection{\texttt{tickstyle}} -%-------------------------------------------------------------------------------------- -Syntax: -\begin{verbatim} -tickstyle=full|bottom|top -\end{verbatim} - -This option is already in the \verb+pst-plot+ package and only mentioned here for -some completness. - -\begin{LTXexample}[width=3.5cm] -\begin{pspicture}(-1,-1)(2,2) -\psaxes[tickstyle=bottom,subticks=5]{->}(0,0)(-1,-1)(2,2) -\end{pspicture}\\[0.5cm] -\begin{pspicture}(-1,-1)(2,2) -\psaxes[tickstyle=bottom,subticks=5]{->}(0,0)(2,2)(-1,-1) -\end{pspicture} -\end{LTXexample} - -\begin{LTXexample}[width=3.5cm] -\begin{pspicture}(-1,-1)(2,2) -\psaxes[ticksize=0 4pt,subticks=5]{->}(0,0)(-1,-1)(2,2) -\end{pspicture}\\[0.5cm] -\begin{pspicture}(-1,-1)(2,2) -\psaxes[ticksize=0 4pt,subticks=5]{->}(0,0)(2,2)(-1,-1) -\end{pspicture} -\end{LTXexample} - - -The \verb+tickstyle+ option changes the position of the labels by default. -If you want the labels on the other side of an axis, then use the options -\verb+labelsep+ or set the ticks with \verb+ticksize+. - - -\fi - - %-------------------------------------------------------------------------------------- \subsection{\texttt{ticks}} %-------------------------------------------------------------------------------------- @@ -2915,6 +2857,20 @@ some completness. \end{pspicture} \end{LTXexample} +Single ticks can be set with the two macros +% +\begin{verbatim} +\psxTick[options](x value){label} +\psyTick[options](y value){label} +\end{verbatim} + + +\begin{LTXexample}[width=.5\linewidth] +\begin{psgraph}[Dx=2,Dy=2](0,0)(-4,-2.2)(4,2.2){.5\textwidth}{!} + \psxTick[linecolor=red](1.5){$x_0$} + \psyTick[linecolor=blue](1.7){$y_0$} +\end{psgraph} +\end{LTXexample} %-------------------------------------------------------------------------------------- \subsection{\texttt{labels}} @@ -4854,7 +4810,7 @@ in postfix or algebraic notation (with \verb+algebraic=true+). %-------------------------------------------------------------------------------------- -\section[\CMD{psplotTangent}]{\CMD{psplotTangent}} +\section{\CMD{psplotTangent} and option \texttt{Tnormal}} %-------------------------------------------------------------------------------------- There is an additional option, named \verb+Derive+ vor an alternative function (see following example) to calculate the slope of the tangent. This will be in general the @@ -4882,7 +4838,7 @@ radian unit! \bgroup \def\F{x RadtoDeg dup dup cos exch 2 mul cos add exch 3 mul cos add} \def\Fp{x RadtoDeg dup dup sin exch 2 mul sin 2 mul add exch 3 mul sin 3 mul add neg} -\psset{plotpoints=1001} +\psset{plotpoints=1001,algebraic=false} \begin{pspicture}(-7.5,-2.5)(7.5,4)%X\psgrid \psaxes{->}(0,0)(-7.5,-2)(7.5,3.5) \psplot[linewidth=3\pslinewidth]{-7}{7}{\F} @@ -4947,6 +4903,21 @@ tangent. \end{pspicture} \end{LTXexample} +With setting the optional argument \texttt{Tnormal} one can plot the normal of +the tangent line. It always starts at the given point. + +%\resetOptions +\begin{LTXexample}[width=8cm,wide] +\begin{pspicture}(-0.5,-0.5)(7.25,7.25) + \def\Func{10 x div} + \psaxes[arrowscale=1.5]{->}(7,7) + \psplot[linewidth=2pt]{1.5}{5}{\Func} + \psplotTangent[linewidth=1.5\pslinewidth,linecolor=red]{3}{2}{\Func} + \psplotTangent[linewidth=1.5\pslinewidth,linecolor=blue,Tnormal]{3}{2}{\Func} + \psline[linestyle=dashed](!0 /x 3 def \Func)(!3 /x 3 def \Func)(3,0) +\end{pspicture} +\end{LTXexample} + %-------------------------------------------------------------------------------------- \subsection{A \texttt{polarplot} example} @@ -4971,6 +4942,7 @@ where $x=r\cdot\cos\theta$ and $y=r\cdot\sin\theta$ \end{pspicture} \end{LTXexample} +\psset{algebraic=false} \begin{LTXexample}[width=6cm,wide] \begin{pspicture}(-1,-3)(5,3)%\psgrid[subgridcolor=lightgray] \psaxes{->}(0,0)(-1,-3)(5,3) @@ -5060,19 +5032,20 @@ and of its 15 first derivatives. It is the sequence definition of the cosine. \begin{pspicture}[showgrid=true](0,-1.2)(7,1.5) \psclip{\psframe[linestyle=none](0,-1.1)(7,1.1)} \multido{\in=0+1}{16}{% - \psplot[linewidth=1pt,algebraic=true,linecolor=\getColor{\in},linewidth=1pt]{0}{7} + \psplot[linewidth=1pt,algebraic,linecolor=\getColor{\in}]{0}{7} {Derive(\in,1-x^2/2+x^4/24-x^6/720+x^8/40320-x^10/3628800+x^12/479001600-x^14/87178291200)}} \endpsclip \end{pspicture} \end{LTXexample} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \subsection{Other examples} \begin{LTXexample}[width=3.5cm] \begin{pspicture}[shift=-2.5,showgrid=true,linewidth=1pt](0,-2)(3,3) - \psplot[algebraic=true]{.001}{3}{x*ln(x)} % f(x) - \psplot[algebraic=true,linecolor=red]{.05}{3}{Derive(1,x*ln(x))} % f'(x)=1+ln(x) + \psplot[algebraic]{.001}{3}{x*ln(x)} % f(x) + \psplot[algebraic,linecolor=red]{.05}{3}{Derive(1,x*ln(x))} % f'(x)=1+ln(x) \end{pspicture} \end{LTXexample} @@ -5101,6 +5074,8 @@ $M_2(f)$ is a majorant of the second derivative of $f$ in the interval $[x_i;x_{ \rput*(3,1.8){$\varepsilon$} \end{pspicture}} + + The parameter \verb$VarStep$ (\verb$false$ by default) activates the variable step algorithm. It is set to a tolerance defines by the parameter \verb$VarStepEpsilon$ (\verb+default+ by default, accept real value). If this parameter is not set by the @@ -5118,7 +5093,7 @@ means that the step is constant for a second order polynomials. \begin{center} \bgroup -\psset{algebraic=true, VarStep=true, unit=2, showpoints=true, linecolor=red} +\psset{algebraic, VarStep=true, unit=2, showpoints=true, linecolor=red} \begin{pspicture}(-0,-1)(3.14,2)\psgrid \psplot[VarStepEpsilon=.01]{0}{3.14}{cos(x)} \psplot[VarStepEpsilon=.001]{0}{3.14}{cos(x)+.15} @@ -5130,7 +5105,7 @@ means that the step is constant for a second order polynomials. \end{center} \begin{lstlisting} -\psset{algebraic=true, VarStep=true, unit=2, showpoints=true, linecolor=red} +\psset{algebraic, VarStep=true, unit=2, showpoints=true, linecolor=red} \begin{pspicture}[showgrid=true](-0,-1)(3.14,2) \psplot[VarStepEpsilon=.01]{0}{3.14}{cos(x)} \psplot[VarStepEpsilon=.001]{0}{3.14}{cos(x)+.15} @@ -5147,7 +5122,7 @@ A really classical example wich gives a bad beginning, the tolerance is set to $ \begin{center} \bgroup -\psset{algebraic=true, VarStep=true, linecolor=red, showpoints=true} +\psset{algebraic, VarStep=true, linecolor=red, showpoints=true} \begin{pspicture}[showgrid=true](0,-5)(16,4) \psplot[VarStep=false, linecolor=black]{.01}{16}{ln(x)+1} \psplot[linecolor=magenta]{.51}{16}{ln(x-1/2)+1/2} @@ -5158,7 +5133,7 @@ A really classical example wich gives a bad beginning, the tolerance is set to $ \end{center} \begin{lstlisting} -\psset{algebraic=true, VarStep=true, linecolor=red, showpoints=true} +\psset{algebraic, VarStep=true, linecolor=red, showpoints=true} \begin{pspicture}[showgrid=true](0,-5)(16,4) \psplot[VarStep=false, linecolor=black]{.01}{16}{ln(x)+1} \psplot[linecolor=magenta]{.51}{16}{ln(x-1/2)+1/2} @@ -5242,7 +5217,7 @@ Just appreciate the difference between the normal behavior and the plotting with \begin{center} \bgroup -\psset{algebraic=true, showpoints=true, unit=0.75} +\psset{algebraic, showpoints=true, unit=0.75} \begin{pspicture}(-5,-4)(9,6) \psplot[linecolor=black]{-5}{1.8}{(x-1)/(x-2)} \psplot[VarStep=true, VarStepEpsilon=.001, linecolor=red]{2.2}{9}{(x-1)/(x-2)} @@ -5252,7 +5227,7 @@ Just appreciate the difference between the normal behavior and the plotting with \end{center} \begin{lstlisting} -\psset{algebraic=true, showpoints=true, unit=0.75} +\psset{algebraic, showpoints=true, unit=0.75} \begin{pspicture}(-5,-4)(9,6) \psplot[linecolor=black]{-5}{1.8}{(x-1)/(x-2)} \psplot[VarStep=true, VarStepEpsilon=.001, linecolor=red]{2.2}{9}{(x-1)/(x-2)} @@ -5260,6 +5235,10 @@ Just appreciate the difference between the normal behavior and the plotting with \end{pspicture} \end{lstlisting} + + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Successive derivatives of a polynom} |