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.

I am trying to use PsTricks to plot large numbers. In Herbert Voss's PSTricks: Graphics and PostScript for TeX and LaTeX book (German edition, 2007, 4th edition), there is the code:

\usepackage{pstricks-add}
\readdata{\data}{data.dat} \psset{xunit=0.11mm,yunit=0.00015mm}
\begin{pspicture}(-80,-30000) (1000,310000)
\psaxes[axesstyle=frame,Dx=100,dx=100,Dy=50000,dy=50000](1000,300000)
\listplot [linewidth=1pt,linecolor=black!30] {\data} %aIle
\listplot [nStep=50,linewidth=2pt,plotstyle=dots] {\data}% jeder 50.
\end{pspicture} 

Using the above, I have made a similar code:

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

\begin{document} 
\readdata{\data}{data.dat} \psset{xunit=0.11mm,yunit=0.00015mm}
\begin{pspicture}(-80,-30000) (1000,310000)
\psaxes[axesstyle=frame,Dx=100,dx=100,Dy=50000,dy=50000](1000,300000)
\listplot [linewidth=1pt,linecolor=red] {\data}
\end{pspicture}
\end{document}

with the contents of data.dat as

 0   0  
100 10000  
200 15000  
300 20000
400 50000
500 80000
600 100000
700 150000
800 160000

On compiling I get the error message:

! Dimension too large.
<to be read again> 
               =
l.8 \listplot
          [linewidth=1pt,linecolor=red] {\data}
? 

900 200000

What am I doing wrong?

Thanks a lot...


Update

The end of log file with Herbert's second code is:

(c:/texlive/2011/texmf-dist/tex/generic/multido/multido.tex
v1.42, 2010/05/14 <tvz>))
(c:/texlive/2011/texmf-dist/tex/generic/pst-plot/pst-plot.tex
 v1.34, 2011/11/07 (tvz,hv)))
No file withpstri6.aux.
)
*
share|improve this question

1 Answer 1

up vote 5 down vote accepted

the labels are set on TeX side and it is difficult to handle such large numbers. Use it this way:

\documentclass[12pt]{article}
\usepackage{filecontents}
\begin{filecontents*}{data.dat}
  0   0  
100 10000  
200 15000  
300 20000
400 50000
500 80000
600 100000
700 150000
800 160000
\end{filecontents*}

\usepackage{pst-plot}

\begin{document} 
\readdata{\data}{data.dat} 

\psset{xunit=0.11mm,yunit=0.15mm,
  ylabelFactor=$\times10^3$,labelFontSize=\footnotesize,mathLabel=false}
\pstScalePoints(1,1){}{1.e3 div}
\begin{pspicture}(-80,-30) (1000,310)
\psaxes[axesstyle=frame,Dx=100,dx=100,Dy=50,dy=50,ticksize=0 4pt](1000,300)
\listplot [linewidth=1.5pt,linecolor=red] {\data}
\end{pspicture}
\end{document}

enter image description here

and the same with a local unit change for y (without using \pstScalePoints:

\documentclass[12pt]{article}
\usepackage{filecontents}
\begin{filecontents*}{data.dat}
  0   0  
100 10000  
200 15000  
300 20000
400 50000
500 80000
600 100000
700 150000
800 160000
\end{filecontents*}

\usepackage{pst-plot}

\begin{document} 
\readdata{\data}{data.dat} 

\psset{xunit=0.11mm,yunit=0.15mm,
  ylabelFactor=$\times10^3$,labelFontSize=\footnotesize,mathLabel=false}
\begin{pspicture}(-80,-30) (1000,310)
\psaxes[axesstyle=frame,Dx=100,dx=100,Dy=50,dy=50,ticksize=0 4pt](1000,300)
\listplot [yunit=0.001,plotstyle=values,rot=90] {\data}
\listplot [yunit=0.001,linewidth=1.5pt,linecolor=red] {\data}
\end{pspicture}
\end{document}

enter image description here

share|improve this answer
    
@ Herbert Thanks. The problem with using pstScalePoints is that if one wants to display the yvalues in the graph using \listplot[plotstyle=values, rot=90]{\data.dat}, then one does no get the correct values. How to fix this? 1 vote up. – yCalleecharan –  yCalleecharan Nov 28 '11 at 8:13
    
@yCalleecharan: see edit –  Herbert Nov 28 '11 at 8:19
    
@ Herbert Thanks but the code is not compiling. See my updated post for the contents of the log file when compilation stops. –  yCalleecharan Nov 28 '11 at 8:25
    
@yCalleecharan: without a complete example I can say nothing. –  Herbert Nov 28 '11 at 8:31
    
@ Herbert. Ok It is working now. Thanks for the useful examples. –  yCalleecharan Nov 28 '11 at 9:00

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.