[pstricks] Problems calculating the units in a diagramm with various plots

Herbert Voss LaTeX at zedat.fu-berlin.de
Sun Dec 4 14:27:03 CET 2005


Martin Buchmann wrote:
> Hi all,
> 
> i try to plot some data in one diagram which is comes on different 
> scales, i.e. concentration and temperature over distance using two y-axis.
> 
> I have two files which i want to plot via the fileplot command and 
> thought that i could manipulate the yunit of the second command so that 
> all data could fit in one plot but the scaling is always wrong. Is it 
> possible at all to do this or am I missing something in the basic logic 
> of my plot?

you have to manipulate the y-values, because your
y-axis starts at 540, which is only valid for the
\psaxes macro.


\documentclass[12pt,a4paper]{article}
\usepackage{pstricks-add}

\begin{filecontents*}{c_x.dat}
[67,6.5]
[9983,3.6]
\end{filecontents*}
\begin{filecontents*}{t_x.dat}
[80,553]
[9920,639]
\end{filecontents*}
\begin{document}

\begin{pspicture}(-0.5,-0.5)(12.5,10)
   \psaxes[axesstyle=frame](10,8)
   \psaxes[axesstyle=none,Oy=540,Dy=20,dy=1.333](10,0)(10,8)
   \fileplot[plotstyle=dots,xunit=0.001cm]{c_x.dat}
   \readdata{\data}{t_x.dat}
   \pstScalePoints(1,0.05){}{ 540 sub }
   \listplot[plotstyle=line,xunit=0.001cm]{\data}
\end{pspicture}

\end{document}


with \listplot you can use the macro \pstScalePoints, it
scales the y-values by 0.05=8/(120*1.333) and substracts
540 to each y-value.

Herbert




More information about the PSTricks mailing list