GeneralProblem with pst-plot

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
Bozack
Posts: 117
Joined: Wed Feb 06, 2008 4:21 pm

Problem with pst-plot

Post by Bozack »

I'm having trouble with plotting with psplot. Below is a minimal example that gives me the error: I compile to a DVI file (it compiles with no error), but when I open the file in Yap it gives me the error "The page could not be rendered", and simply shows an empty page.

If I comment out the line with psplot, the code compiles as it should, and Yap shows it fine. (Note that I use pst-infixplot to be able to write in normal mathematical notation instead of RPN.)

Code: Select all

\documentclass[a4paper,12pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[danish]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[dvipsnames]{xcolor}
\usepackage{pstricks,pst-plot,pst-infixplot}

\begin{document}

\psset{xunit=5mm, yunit=5mm}
\begin{pspicture}(0,-5)(8,3) \psgrid
 \psplot[linecolor=Blue]{0}{2}{- 0.5* 0.1/( (x-2)^2 + 0.1^2 )}
 \psline[linecolor=Red](0,-1.5)(8,-1.5)
\end{pspicture}

\end{document}
If I try to compile LaTeX -> DVI -> PDF, Ghostscript gives me an unrecoverable error and no document comes out of it.

I have a fully upgraded MikTeX 2.7 installation, and I use TeXnicCenter.

Am I the only one getting the error? Can anyone figure out what the problem is?


Ps. The error doesn't show up if I only plot something like

Code: Select all

\psplot[linecolor=Red]{0}{8}{-2}
Last edited by Bozack on Thu May 27, 2010 3:40 pm, edited 1 time in total.
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit

Recommended reading 2024:

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

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

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Problem with pst-plot

Post by CrazyHorse »

Bozack wrote:I'm having trouble with plotting with psplot. Below is a minimal example that gives me the error: I compile to a DVI file (it compiles with no error), but when I open the file in Yap it gives me the error "The page could not be rendered", and simply shows an empty page.

If I comment out the line with psplot, the code compiles as it should, and Yap shows it fine. (Note that I use pst-infixplot to be able to write in normal mathematical notation instead of RPN.)

If I try to compile LaTeX -> DVI -> PDF, Ghostscript gives me an unrecoverable error and no document comes out of it.

I have a fully upgraded MikTeX 2.7 installation, and I use TeXnicCenter.

Am I the only one getting the error? Can anyone figure out what the problem is?


Ps. The error doesn't show up if I only plot something like

Code: Select all

\psplot[linecolor=Red]{0}{8}{-2}
with the pst-infixplot you have to convert your expression yourself.
Use the internal algebraic option instead:

Code: Select all

\documentclass{article}
\usepackage[dvipsnames]{pstricks}
\usepackage{pst-plot}

\begin{document}

\psset{xunit=5mm, yunit=5mm,algebraic}
\begin{pspicture}[showgrid](0,-5)(8,3)
\psplot[linecolor=Blue]{0}{2}{-0.5*0.1/( (x-2)^2 + 0.1^2 )}
\psline[linecolor=Red](0,-1.5)(8,-1.5)
\end{pspicture}

\end{document}
Herbert
User avatar
Bozack
Posts: 117
Joined: Wed Feb 06, 2008 4:21 pm

Problem with pst-plot

Post by Bozack »

CrazyHorse wrote:With the pst-infixplot you have to convert your expression yourself. Use the internal algebraic option instead:
Wow, thank you so much for the quick reply! I definitely wouldn't have found out about that myself! Now it works just as it should! :D
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit
Post Reply