[pstricks] Axes and huge numbers

Martin Chicoine martin.chicoine at umontreal.ca
Tue Apr 7 23:20:42 CEST 2009


auto-pst-pdf does not work because of psgraph. As a workaround you can use
the following preamble but I think there are problems.

 

\documentclass{article}

 

\usepackage{auto-pst-pdf}

\usepackage{pstricks-add}

 

\usepackage{ifpdf}

\ifpdf

  \let\psgraph=\postscript

  \let\endpsgraph=\endpostscript

\else

  \PreviewEnvironment{psgraph}

\fi

 

\begin{document}


.

 

De : pstricks-bounces at tug.org [mailto:pstricks-bounces at tug.org] De la part
de Mikel Catania
Envoyé : 7 avril 2009 17:07
À : Graphics with PSTricks
Objet : Re: [pstricks] Axes and huge numbers

 

Thanks a lot Martin, looks great. However, for some reason the auto-pst-pdf
package does not work, which is really annoying me. Anyway, it's good to
know that solution, thanks! :)

Mikel 

On Tue, Apr 7, 2009 at 9:19 PM, Martin Chicoine
<martin.chicoine at umontreal.ca> wrote:

De : pstricks-bounces at tug.org [mailto:pstricks-bounces at tug.org] De la part
de Mikel Catania
Envoyé : 7 avril 2009 14:43
À : Graphics with PSTricks
Objet : [pstricks] Axes and huge numbers


> Hi all,
>
> I'm plotting a function with x-values ranging from 0 to 1500000, and
y-values from 0 to 160000.
> The plot has to be around 12cm wide, so I set xunit=.00008mm. The plot
works fine, but only if
> I set "labels=none" in the \psaxes options. The following example shows
that clearly:
>
> \documentclass{article}
>
> \usepackage{pstricks}
> \usepackage{pst-plot}
>
> \begin{document}
>
> \psset{unit=.00008mm,xunit=.00008mm,yunit=.0004mm}
>
> \begin{pspicture}(0,0)(1500000,160000)
> % Axes
> \psaxes[Dx=250000,Dy=50000,labels=none]{->}(0,0)(1500000,160000)
> % Functions
> \psplot[showpoints=true,plotpoints=15]{0}{1500000}{0.08615 x mul 18000
add}
>
\psplot[showpoints=true,dotstyle=square*,plotpoints=15]{0}{1500000}{0.05468
x mul 42000 add}
> % Captions
>
\rput[l](1000000,70000){\psline(0,2000)(100000,2000)\psdot(50000,2000)\qquad
\quad graph one}
>
\rput[l](1000000,50000){\psline(0,2000)(100000,2000)\psdot[dotstyle=square*]
(50000,2000)\qquad\quad graph two}
> \end{pspicture}
>
> \end{document}
>
> Anytime I change the options of \psaxes to "labels=all", I get an error
"Dimension too large". I could \rput all values, but it is tedious and I'd
like to know how to make this work.
>
> Thanks in advance,
>
> Mikel

With pstricks-add you can divide everything by 1000 and use xlabelFactor and
ylabelFactor. The only problem is that you have to use showorigin=false,
otherwise you get "0000" at the origin. Maybe Herbert has a fix for that?

\documentclass{article}

\usepackage{pstricks-add}

\begin{document}

\begin{psgraph}[arrows=->,Dx=250,Dy=50,xlabelFactor={000},ylabelFactor={000}
,
 showorigin=false](0,0)(1500,160){11.2cm}{6.4cm}
% Functions
\psplot[showpoints=true,plotpoints=15]{0}{1500}{0.08615 x mul 18 add}
\psplot[showpoints=true,dotstyle=square*,plotpoints=15]{0}{1500}{0.05468 x
mul 42 add}
% Captions
\rput[l](1000,70){\psline(0,2)(100,2)\psdot(50,2)\qquad\quad graph one}
\rput[l](1000,50){\psline(0,2)(100,2)\psdot[dotstyle=square*](50,2)\qquad\qu
ad graph two}
\end{psgraph}

\vspace{1cm}

\psset{unit=.00008mm,xunit=.00008mm,yunit=.0004mm}

\begin{pspicture}(0,0)(1500000,160000)
% Axes
\psaxes[Dx=250000,Dy=50000,labels=none]{->}(0,0)(1500000,160000)
% Functions
\psplot[showpoints=true,plotpoints=15]{0}{1500000}{0.08615 x mul 18000 add}
\psplot[showpoints=true,dotstyle=square*,plotpoints=15]{0}{1500000}{0.05468
x mul 42000 add}
% Captions
\rput[l](1000000,70000){\psline(0,2000)(100000,2000)\psdot(50000,2000)\qquad
\quad graph one}
\rput[l](1000000,50000){\psline(0,2000)(100000,2000)\psdot[dotstyle=square*]
(50000,2000)\qquad\quad graph two}
\end{pspicture}


\end{document}

_______________________________________________
PSTricks mailing list
PSTricks at tug.org
http://tug.org/mailman/listinfo/pstricks

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20090407/1546b466/attachment-0001.html 


More information about the PSTricks mailing list