How can I read the first value from the first column of a table, assign it to a variable and the use it in some math expression with x expr=\thisrow{}?
The code would be something like this, but in my example I'm manually typing the first value of the first column (3 in this example, as in x expr=\thisrow{time}-3) and I would like it to be done automatically.
UPDATE: My real table has between 5 and 6 columns and some thousands of rows. Please, this should be taken into account for the solution.
\documentclass{article}
\usepackage{pgfplots,tikz}
\usepackage{filecontents}
\begin{filecontents}{data.dat}
time speed
3 5
4 3
5 6
6 4
7 0
8 1
\end{filecontents}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xlabel=time,ylabel=speed]
\addplot table[x expr=\thisrow{time}-3, y={speed}] {data.dat};
\end{axis}
\end{tikzpicture}
\end{document}

axisenvironment and save it to a macro using\pgfplotstablegetelem{0}{time}\of{data.dat} \edef\firstrowvalue{\pgfplotsretval}. Then you can access it in your plot usingx expr=\thisrow{time}-\firstrowvalue. Is that what you're looking for, or do you want an even more automatic solution (something like a\firstrow{<column name>}thata can be used directly inx expr, for example)? – Jake Jan 17 '13 at 07:14pgfplotstablecomplaining about the size of the table. My real table is much bigger than that (thousands of rows) and 5--6 columns. Frompgfplotsmanual section 4.2.3 > "1. If tables contain few rows and many columns, the ⟨\macro⟩ framework will be more efficient. 2. If tables contain more than 200 data points (rows), you should always use file input (and reload if necessary)." I believe number 2 is my case. – perr0 Jan 17 '13 at 11:44