TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A lot of code about pgfplots I found (also here on tex.stack) was using \thisrowno{} to address specific rows of a table. All of these had no additional pakages loaded than I do in the following example. But I get the error that \thisrowno is an undefined control sequence. What am I missing and/or doing wrong?




0.0  1
0.1  23
0.2  4
0.3  35


    \addplot table [x=\thisrowno{1}, y=\thisrowno{0}] {data.dat};

share|improve this question
up vote 7 down vote accepted

\thisrowno{0} is used to access the content of a certain column in the context of an expression.

In this case, however, you merely want to specify which column to use for x and y, so you'd use x index=1, y index=0. If your columns had proper names, you could use x=<column name>, y=<column name>. If you really want to use the \thisrowno syntax, you could use x expr=\thisrowno{1}, y expr=\thisrowno{0}.

However, typically you'd use x expr to process the data, for example using x expr=\thisrowno{0} + \thisrowno{1} * \coordindex.

share|improve this answer
Thanks, this works. :) So much parameters and options in pgfplots, it's very confusing... – Foo Bar Nov 13 '12 at 20:17
@FooBar: It is at first, but stick with it, it'll pay off! Very soon, it'll come very naturally. – Jake Nov 13 '12 at 20:21
+1 for your comment suggesting to stick with it :-) – Harish Kumar Nov 14 '12 at 0:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.