[pstricks] psgraph

Alan Ristow ristow at ece.gatech.edu
Tue Jul 13 15:22:52 CEST 2004


Herbert,

One problem I've found with the current psgraph. The following code
produces an arithmetic overflow with 0.06 as my ymax coordinate. Larger
values work fine, but 0.06 does not. The error seems to occur after a
division operation in the psgraph code, and I am able to plot this data
the "old" way (i.e., without psgraph) with no trouble. I have provided
examples of each.

Incidentally, the working code also illustrates a problem that I have
been meaning to post about for awhile. You will notice that my \psaxes
command uses an x dimension of 4.001in, compared to 4in for the
pspicture environment. I have found that this is necessary in order to
have the final tick label appear. Do you know of a better way to deal
with this?

Alan



\documentclass{article}
\usepackage{filecontents}

\begin{filecontents*}{test.dat}
0.0 0.143184
0.1 0.14414
0.2 0.145074
0.3 0.146064
0.4 0.147126
0.5 0.148283
0.6 0.14957
0.7 0.151043
0.8 0.152873
0.9 0.155053
1.0 0.158049
\end{filecontents*}


\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{pstricks-add}
\pagestyle{empty}
\parindent=0pt

\begin{document}

\psset{xunit=4in,yunit=33.3333in}%
\psset{xAxisLabel=\relax,yAxisLabel=\relax}%

%
% The routine below -- not using psgraph -- plots this data without
% trouble.
%
\begin{figure}
  \begin{pspicture}(4in,2in)
    \pstScalePoints(1,1){}{0.11 sub}%

\psaxes[axesstyle=frame,Dx=0.1,Dy=0.01,tickstyle=bottom,Ox=0.0,Oy=0.11]%
      (4.001in,2in)%
    \readdata{\data}{test.dat}%
    \listplot{\data}%
  \end{pspicture}
\end{figure}


%
% The routine below -- using psgraph -- produces an arithmetic overflow.
%
\begin{figure}
  \centering%
  \begin{psgraph}[axesstyle=frame,Oy=0.11,Dy=0.01,tickstyle=bottom,%
      llx=-30pt,lly=-30pt](0,0.00)(1,0.06){4in}{2in}%
    \pstScalePoints(1,1){}{0.11 sub}%
    \readdata{\data}{test.dat}%
    \listplot[linecolor=black,plotstyle=line]{\data}%
  \end{psgraph}
\end{figure}

\end{document}




On Mon, 12 Jul 2004 10:44:29 +0200, Herbert Voss
<Herbert.Voss at alumni.TU-Berlin.DE> wrote:

>Hello Alan,
>
>I changed the environment \psgraph again, to get a better
>handling of the borders. There are now some new options
>and it is called in the same way as pspicture.
>
>Look at the example. For more informations see the docs, which
>I updated. This environment is still experimental code.
>
>http://perce.de/LaTex/pstricks-add/
>Version 1.63
>
>Herbert
>
>
>
>\documentclass[a4paper]{article}
>\usepackage{filecontents}
>
>\begin{filecontents*}{demo.dat}
>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*}
>
>\usepackage{pstricks}
>\usepackage{pst-plot}
>\usepackage{pstricks-add}% v1.63 !!
>\pagestyle{empty}
>\parindent=0pt
>
>\begin{document}
>   \centering%
>   \psframebox[linecolor=blue,linestyle=dashed]{%
>   \begin{psgraph}[axesstyle=frame,Ox=1989,Oy=2.00,Dy=0.5,tickstyle=bottom,%
>       llx=-0.9cm,lly=-0.5cm,urx=0.25cm,ury=0.3cm](0,0)(12,4.50){4in}{2in}%
>     \pstScalePoints(1,1){1989 sub}{2 sub}%
>     \readdata{\data}{demo.dat}%
>     \listplot[linecolor=black,showpoints=true,plotstyle=line,dotstyle=o]%
>       {\data}%
>   \end{psgraph}
>}
>\end{document}





More information about the PSTricks mailing list