Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The following code seems to work (I'm using Texmaker and MiKTeX):

\documentclass[12pt,letterpaper]{article}
\usepackage{pstricks}
\usepackage{pst-plot}

\begin{document}

\begin{center}
\psset{unit=.4cm}
\begin{pspicture}(-11,-11)(11,11)
\psaxes[Dx=5,Dy=5](0,0)(-11,-11)(11,11)
\psplot[plotstyle=curve,linecolor=red]{-2}{2}{2 x 2 exp mul} 
\end{pspicture}
\end{center}

\begin{center}
\psset{unit=.4cm}
\begin{pspicture}(-11,-11)(11,11)
\psaxes[Dx=5,Dy=5](0,0)(-11,-11)(11,11)
\psplot[plotstyle=curve,linecolor=red]{-2}{2}{x 3 exp} 
\end{pspicture}
\end{center}

\end{document}

I get two graphs on one page. BUT if I change the psset commands to .5cm, so that the second graph is forced to appear on page 2, I get a MiKTeX problem report, as follows:

MiKTeX Problem Report
Message: Some PostScript specials could not be rendered.
Data: Error: /undefined in tx@Dict
Operand stack:
   --nostringval--   PermitFileReading   --nostringval--   PermitFileWriting   --nostringval--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--
   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false
   1   %stopped_push   1914   1   3   %oparray_pop   1913   1   3   %oparray_pop
   1897   1   3   %oparray_pop   1787   1   3   %oparray_pop   --nostringval--
   %errorexec_pop   .runexec2   --nostringval--   --nostringval--  --nostringval--
   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1166/1684(ro)(G)--   --dict:0/20(G)--   --dict:78/200(L)--
   --dict:95/300(L)--   --dict:37/200(L)--
Current allocation mode is local
MiKTeX GPL Ghostscript  9.00: Unrecoverable error, exit code 1

Source: Libraries\MiKTeX\Dvi\Ghostscript.cpp
Line: 372
MiKTeX: 2.9
OS: Microsoft Windows 7 Business Edition, 64-bit Service Pack 1 (build 7601)
Invokers: explorer/texmaker
SystemAdmin: yes
PowerUser: no
Root0: C:\Users\Ken\AppData\Roaming\MiKTeX\2.9
Root1: C:\Users\Ken\AppData\Local\MiKTeX\2.9
Root2: C:\ProgramData\MiKTeX\2.9
Root3: C:\Program Files (x86)\MiKTeX 2.9
UserInstall: C:\Users\Ken\AppData\Roaming\MiKTeX\2.9
UserConfig: C:\Users\Ken\AppData\Roaming\MiKTeX\2.9
UserData: C:\Users\Ken\AppData\Local\MiKTeX\2.9
CommonInstall: C:\Program Files (x86)\MiKTeX 2.9
CommonConfig: C:\ProgramData\MiKTeX\2.9
CommonData: C:\ProgramData\MiKTeX\2.9

I'm new to this. Can anybody help me understand what is going on?

share|improve this question
    
Welcome to TeX.sx! –  Werner Nov 21 '11 at 4:30
    
It works for me. Can you add \listfiles before \documentclass - it puts the versions of the packages used in the log - and edit your answer? –  Boris Nov 21 '11 at 4:41
    
it looks like that your MiKTeX installtion is not correct configured –  Herbert Nov 21 '11 at 7:11
    
Boris: here's the file list –  Ken Y Nov 21 '11 at 9:53
    
File List article.cls 2007/10/19 v1.4h Standard LaTeX document class size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option) pstricks.sty 2011/10/31 v0.52 LaTeX wrapper for PSTricks' (RN,HV) pstricks.tex 2011/09/04 v2.23 PSTricks' (tvz,hv) pst-xkey.tex 2005/11/25 v1.6 PSTricks specialization of xkeyval (HA) xkeyval.sty 2008/08/13 v2.6a package option processing (HA) xkeyval.tex 2008/08/13 v2.6a key=value parser (HA) pst-fp.tex 2011/09/04 v2.23 `PST-fp' (hv) –  Ken Y Nov 21 '11 at 10:05
show 5 more comments

1 Answer 1

I have no problem when compiling your MWE with 0.5cm. Anyway, you can use algebraic option to write 2*x^2 instead of 2 x 2 exp mul. Use \newpage to obtain a new page. And use figure to obtain floating figures in your document.

\documentclass[12pt,letterpaper]{article}
%\usepackage{pstricks} 
\usepackage{pst-plot} % loads pstricks automatically

\begin{document}

\begin{figure}
\centering
\psset{unit=.4cm}
\begin{pspicture}(-11,-11)(11,11)
\psaxes[Dx=5,Dy=5](0,0)(-11,-11)(11,11)
\psplot[plotstyle=curve,linecolor=red,algebraic]{-2}{2}{2*x^2} 
\end{pspicture}
\caption{Quadratic}
\label{fig:Quadratic}
\end{figure}

\newpage
\begin{figure}
\centering
\psset{unit=.4cm}
\begin{pspicture}(-11,-11)(11,11)
\psaxes[Dx=5,Dy=5](0,0)(-11,-11)(11,11)
\psplot[plotstyle=curve,linecolor=red,algebraic]{-2}{2}{x^3} 
\end{pspicture}
\caption{Cubic}
\label{fig:Cubic}
\end{figure}

\end{document}
share|improve this answer
    
I copied the above edited version into Texmaker and got the same error. –  Ken Y Nov 21 '11 at 9:59
1  
You can specify \psset{algebraic=true} at the beginning of the document, which means that you don't have to say it every plot –  cmhughes Nov 22 '11 at 4:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.