[pstricks] pstricks-add

Alan Ristow ristow at ece.gatech.edu
Tue Jul 6 17:05:47 CEST 2004


I had been toying with something similar (in concept, anyway --
certainly not in execution!), albeit for different reasons. I often need
to plot data over ranges like 0.0001 to 0.0005, or 1989 to 2001. Since
PSTricks works with lengths rather than dimensionless numbers, ranges
like the former cause \psunit to overflow, and values like the latter
are simply too large for TeX to handle at all.

Previously, my solution has been to alter my data and fake the axis
labels, but this is far from desirable. Lately, I had been looking into
writing some macros that would either not use TeX dimension registers
(and would therefore likely require the fp package) or would draw the
plots directly in Postscript. Then this came up.

It looks like \psgraph might be able to be modified to perform the
scaling *and* fake the axis labels so the data files don't have to be
altered. I plan to have a closer look at it this evening, but I thought
I'd ask for comments first -- any better ideas about how I should (or
should not) handle this?

I've attached an example below that fails with 

! Dimension too large. 
<recently read> \@psunit

when it encounters (1989,2001).

\begin{filecontents}{cost.d}
  1989 3.08
  1990 3.84
  1991 4.08
  1992 3.21
  1993 5.23
  1994 2.97
  1995 2.53
  1996 2.8
  1997 2.78
  1998 3.15
  1999 2.32
  2000 2.4
  2001 2.46
\end{filecontents}

\documentclass{article}
\usepackage{pstricks-add}

\begin{document}
  \psset{xunit=0.308in,yunit=0.32in}%
  \readdata{\data}{cost.d}%
  \psgraph[axesstyle=frame,Ox=1989][linecolor=black]{\data}%
    (1989,2001)(2.00,6.25){1}{0.25}{4in}{2in}%
\end{document}


Regards,

Alan



On Tue, 06 Jul 2004 12:06:58 +0200, Herbert Voss
<Herbert.Voss at alumni.TU-Berlin.DE> wrote:

>Hello,
>
>only for your interest:
>
>http://perce.de/LaTeX/pstricks-add/pst-graph.pdf
>
>shows what is possible at this time. It is only
>at a experimental status and you need pstricks-add,
>version 1.61 if you want to test it.
>
>http://perce.de/LaTeX/pstricks-add/pst-graph.tex
>http://perce.de/LaTeX/pstricks-add/pstricks-add.tex
>
>Herbert





More information about the PSTricks mailing list