Graphics, Figures & TablesTrouble with pst-plot

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
white_owl
Posts: 12
Joined: Wed Apr 21, 2010 6:56 pm

Trouble with pst-plot

Post by white_owl »

I just downloaded and successfully installed TexLive 2012.
Trying to use pst-plot package (tlmgr info pst-plot reports it of version 1.44).

Code: Select all

\documentclass{article}
\usepackage{pst-plot}
\begin{document}
\psset{unit=1cm}
\begin{pspicture}(-4,-0.5)(4,8)
\psgrid[subgriddiv=0,griddots=5,gridlabels=7pt](-4,-0.5)(4,8)
\psline[linewidth=1pt]{->}(-4,0)(+4,0)   % line #7, error: undefined \psline
\psline[linewidth=1pt]{->}(0,-0.5)(0,8)
\psplot[plotstyle=curve,linewidth=1.5pt]{-4}{0.9}{10 x exp}% postscript function
\rput[l](1,7.5){$10^x$}
\end{pspicture}
\end{document}
This gives me an error:

Code: Select all

! Undefined control sequence.
<recently read> \c@lor@to@ps 
                             
l.7 \psline
           [linewidth=1pt]{->}(-4,0)(+4,0)
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
\XC@usec@lor ...string \color@ #1#2\endcsname \@@ 
                                                  \fi \space 
l.7 \psline
           [linewidth=1pt]{->}(-4,0)(+4,0)
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
... and a few other repeating messages about undefined \psline in the 7th line.

What am I doing wrong?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Re: Trouble with pst-plot

Post by Stefan Kottwitz »

You are using pdfLaTeX. Use LaTeX in DVI mode instead, with dvips, or XeLaTeX to compile.

Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Trouble with pst-plot

Post by localghost »

To allow PSTricks code with PDFLaTeX use the auto-pst-pdf package and pay special attention to Section 3 of its manual.


Thorsten
Post Reply