[pstricks] pstricks-add
Herbert Voss
Herbert.Voss at alumni.TU-Berlin.DE
Tue Jul 6 21:07:49 CEST 2004
Alan Ristow wrote:
> 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 suppose that this new \psgraph needs some time to understand
how it works. It has, from my point of view, a major disadvantage:
too many parameters ...
An important macro is \pstScalePoints, e.g.
\pstScalePoints(1,1){1989 sub}{2 sub}
(1,1) : all x|y Values are not scaled
{1989 sub}: from every x data record 1989 is substracted
{2 sub} : from every y data record 2 is substracted
There is now no need for setting the units, this is
done internally by psgraph.
have a look at the examples, I suppose that they show
what you want.
Herbert
\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}
\usepackage{pstricks-add}
\begin{document}
\readdata{\data}{cost.d}%
\pstScalePoints(1,1){1989 sub}{}
\psset{xAxesLabel=Year,yAxesLabel=Whatever,%
xAxesLabelPos={2in,-0.4in},yAxesLabelPos={-0.4in,1in}}
%
\psgraph[axesstyle=frame,Ox=1989][linecolor=red,linewidth=2pt]{\data}%
(0,12)(0,6){1}{1}{4in}{2in}%
\vspace{2cm}
\pstScalePoints(1,1){1989 sub}{2 sub}
\psgraph[axesstyle=frame,Ox=1989,Oy=2][linecolor=red,linewidth=2pt]{\data}%
(0,12)(0,4){1}{1}{4in}{2in}%
\end{document}
--
http://TeXnik.de/
http://PSTricks.de/
ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes
More information about the PSTricks
mailing list