[pstricks] pstricks-add
Alan Ristow
ristow at ece.gatech.edu
Thu Jul 8 18:12:36 CEST 2004
On Thu, 08 Jul 2004 08:25:43 +0200, Herbert Voss
<Herbert.Voss at alumni.TU-Berlin.DE> wrote:
>\readdata{\data}{demo1.dat}
>\pstScalePoints(1,0.000001){}{}
>\begin{center}
>\psframebox[linecolor=red,linestyle=dashed]{%
>\psgraph%
> [axesstyle=frame, ticklines=all,ylabelFactor=$\cdot 10^6$,%
> Dx=5, Dy= 100](-1,25)(0,750){10cm}{8cm} % parameters
> \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data}
>\endpsgraph
>}
>
>\vspace{1cm}
>\psframebox[linecolor=red,linestyle=dashed]{%
>\begin{pspicture}(-1,-1)(0.2,8.5)% this seems to be a bug !!!!!
I'm not entirely sure what bug you are referring to here, but the reason
that I have avoided nesting pspicture environments is that the outer
environment never seems to have the dimensions I expect. An example is
below. The intent is to have a red line around the psgraph and a blue
line around the pspicture containing the psgraph. In my mind, the top
and right borders of the red and blue lines coincide; in reality, they
do not (in fact, the blue line extends off the right side of the page).
I figure either this is the bug you are talking about, or it is a new
one, or I just don't understand what coordinate system the outer
pspicture environment is working with. At any rate, it is this sort of
behavior that led me to believe that pspicture environments should not
be nested.
Alan
\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}
\pagestyle{empty}
\parindent=0pt
\begin{document}
\centering%
\psset{xunit=0.3333in,yunit=0.4444in}%
\psframebox[linecolor=blue,linestyle=dashed]{%
\begin{pspicture}(-30pt,-36pt)(12,4.50)
\psframebox[linecolor=red,linestyle=dashed]{%
\begin{psgraph}[axesstyle=frame,Ox=1989,Oy=2.00,tickstyle=bottom]%
(0,12)(0,4.50){1}{0.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{pspicture}
}
\end{document}
More information about the PSTricks
mailing list