# [pstricks] plotting a data series with pstricks & psplot

Peter I. Hansen pih at xbase.dk
Wed Mar 29 10:46:33 CEST 2006

On Fri, 24 Mar 2006 22:36:40 +0100
Herbert Voss <LaTeX at zedat.fu-berlin.de> wrote:

> Andrew Enterline wrote:
>
> > however, i am experiencing difficulty wrapping my brain
> > around getting my data series values to match up with my
> > axis labels.  more precisely, i'm having difficulty
> > translating my data series into the proper plot
> > coordinates.  i am wondering if anybody has a nifty way to
> > translate data series values into the appropriate
> > coordinates in a plot. below, i'm pasting an illustration
> > of my problem. the axis labels are correct, but the line
> > plotted is incorrect.
>
> \documentclass[12pt]{article}
> \usepackage{pstricks}
> \usepackage{pst-plot}
>
> \begin{document}
> \def\data{
>   1 0.03  2 0.04  4 0.05  6 0.06
>   8 0.07 10 0.08 12 0.08 14 0.09
> 16 0.09 18 0.1  20 0.1  22 0.11
> 24 0.11 26 0.12 28 0.12 30 0.12
> 32 0.13 34 0.13 36 0.13 38 0.14
> 40 0.14 42 0.14 44 0.15 46 0.15
> 48 0.15 50 0.15}
>
> \psset{xunit=0.2, yunit=50}% to get 10cm x 10cm with the data
> values \begin{pspicture}(0,0)(50,0.2)
>    \psaxes[tickstyle=bottom,Dx=5,Dy=.02,dx=1cm,dy=1cm]{->}
> (0,0)(50,0.2) \listplot[linecolor=red]{\data}%
> \end{pspicture}
>
> \end{document}
>

How do I do this with an ascii datafile?

/Peter