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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
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