1 Feb 2010 16:38
Re: using pgfplots to modify columns before plotting
Christian Feuersaenger <feuersaenger <at> ins.uni-bonn.de>
2010-02-01 15:38:04 GMT
2010-02-01 15:38:04 GMT
Hello Paul,
If I understand correctly, the following snippet might help:
\begin{tikzpicture}
\begin{axis}[options]
\addplot [plot_options]
table [x = colname1, y expr=\thisrow{colname2} * -1] {datafile.dat}
\end{axis}
\end{tikzpicture}
It sets y by an expression where `\thisrow{<colname>}' refers to the
actual row of the input table.
Best regards
Christian
Original message:
I'm trying to plot a set of data from a file containing columns of space
separated numbers with headings. I can plot the data really nicely using
pgfplots, but I would like to multiply all the data in a particular column
by -1 on-the-fly beforehand. I've been trying to use something like the
snippet below, but with no particular success!
\begin{tikzpicture}
\begin{axis}[options]
\addplot [plot_options] table [x = colname1, y=colname2,
columns/colname2/.append style={multiply -1}] {datafile.dat}
\end{axis}
(Continue reading)
RSS Feed