[pstricks] Sketching the graph of the tangent function
Paul Smith
phhs80 at gmail.com
Sat Oct 14 12:14:51 CEST 2006
On 10/10/06, Eduardo <eduardo.morais at videotron.ca> wrote:
> Try this: (you have to use pstricks-add)
>
> \begin{figure}[H]
> \begin{center}
> \begin{pspicture}(-5.0,-2.5)(5.0,3.5)
>
> \uput[-90](4.9,-0.1){$x$} \uput[0](0.05,2.6){$y$}
> \uput[0](-0.5,0.666666){$\scriptstyle 1$}
> \uput[0](-0.5,1.333333){$\scriptstyle 2$}
> \uput[0](-0.5,2.0){$\scriptstyle 3$}
> \uput[0](0.0,-0.666666){$\scriptstyle -1$}
> \uput[0](0.0,-1.333336){$\scriptstyle -2$}
> \uput[0](0.0,-2.0){$\scriptstyle -3$}
>
> \uput[-90](4.3,-0.05){${\scriptstyle2}\pi$}
> \uput[90](3.45,-0.05){$\frac{3\pi}{2}$}
> \uput[-90](2.1,-0.05){$\pi$}
> \uput[90](1.25,-0.05){$\frac{\pi}{2}$}
> \uput[90](-4.35,-0.01){${\scriptstyle-2}\pi$}
> \uput[-90](-3.55,-0.01){${\scriptstyle-}\frac{3\pi}{2}$}
> \uput[90](-2.2,-0.01){${\scriptstyle-}\pi$}
> \uput[-90](-1.35,-0.01){${\scriptstyle-}\frac{\pi}{2}$}
>
> \psset{algebraic=true, unit=0.666667, labelFontSize={\footnotesize}}
> \psline[linestyle=dashed, dash=3pt 2pt](-4.712389,-3.5)(-4.712389,3.5)
> \psline[linestyle=dashed, dash=3pt 2pt](-\psPiH,-3.5)(-\psPiH,3.5)
> \psline[linestyle=dashed, dash=3pt 2pt](\psPiH,-3.5)(\psPiH,3.5)
> \psline[linestyle=dashed, dash=3pt 2pt](4.712389,-3.5)(4.712389,3.5)
>
> \psplot[linewidth=1.0pt]{-6.5}{-5.0}{sin(x)/cos(x)}
> \psplot[linewidth=1.0pt]{-4.425}{-1.858}{sin(x)/cos(x)}
> \psplot[linewidth=1.0pt]{-1.283}{1.283}{sin(x)/cos(x)}
> \psplot[linewidth=1.0pt]{1.858}{4.425}{sin(x)/cos(x)}
> \psplot[linewidth=1.0pt]{5.0}{6.5}{sin(x)/cos(x)}
>
> \psaxes[labels=none, dx=\psPiH, xunit=\psPi, arrowscale=1.5, labelsep=3pt,%
> showorigin=false, ticksize=-3pt 0]{->}(0,0)(2.3,4.0)
> \psaxes[labels=none, dx=\psPiH, xunit=\psPi, arrowscale=1.5, labelsep=3pt,%
> showorigin=false, ticksize=0 3pt](0,0)(-2.3,-3.5)
> \end{pspicture}
> \caption{Graph of $\tan$.}\label{graph:tan}
> \end{center}
> \end{figure}
The above example works fine with latex+dvips. However, with
pst-pdf+ps4pdf, I get the following error:
«(/usr/share/texmf/tex/context/base/supp-mis.tex
loading : Context Support Macros / Miscellaneous (2004.10.26)
)
loading : Context Support Macros / PDF (2004.03.26)
)
Preview: Fontsize 12pt
Preview: PDFoutput 1
! Undefined control sequence.
\c at lor@to at ps ...name c at lor@ps@#1\endcsname #2 \@@
l.30 \psline[linestyle=dashed, dash=3pt 2pt](
-4.712389,-3.5)(-4.712389,3.5)
?
! Emergency stop.
\c at lor@to at ps ...name c at lor@ps@#1\endcsname #2 \@@
l.30 \psline[linestyle=dashed, dash=3pt 2pt](
-4.712389,-3.5)(-4.712389,3.5)
No pages of output.
Transcript written on lixo.log.»
My file list is:
*File List*
article.cls 2004/02/16 v1.4f Standard LaTeX document class
size12.clo 2004/02/16 v1.4f Standard LaTeX file (size option)
graphics.sty 2001/07/07 v1.0n Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2005/02/03 v1.3 graphics configuration of teTeX/TeXLive
dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
pstricks-add.sty 2005/03/03 package wrapper for pstricks-add.tex (hv)
pstricks.sty 2006/01/01 v0.32 LaTeX wrapper for `PSTricks' (RN,HV)
pstricks.tex 2006/04/20 v1.14b `PSTricks' (tvz)
xcolor.sty 2004/07/04 v2.00 LaTeX color extensions (UK)
color.cfg 2005/02/03 v1.3 color configuration of teTeX/TeXLive
pstricks-add.tex 2006/10/03 v2.81 `PSTricks-add' (hv)
pst-xkey.tex 2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
xkeyval.sty 2005/11/25 v2.5e package option processing (HA)
xkeyval.tex 2005/11/25 v2.5e key=value parser (HA)
pst-pdf.sty 2006/08/31 v1.1o PS graphics for pdfLaTeX (RN,HjG)
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
preview.sty 2006/05/25 11.83 (AUCTeX/preview-latex)
prtightpage.def
pdftex.def 2002/06/19 v0.03k graphics/color for pdftex
***********
Any ideas?
Thanks in advance,
Paul
More information about the PSTricks
mailing list