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

I have a table with numerical data and text in different columns, like this:

0   0   0.1
1   0   \pi
2   0   \frac{\pi}{2}

I'd like to put text labels on a plot using the text in the third column at the position given by the first two columns (I need to overlay these text labels on a plot at given positions). Is it possible with pgfplots?

share|improve this question
Welcome to TeX.sx! You don't have to sign with your name since it automatically appears in the lower right corner of your post. – Joseph Wright Apr 27 '12 at 11:39

Yes, that is possible. You'll need to tell pgfplots to expect symbolic meta data (so it doesn't try to parse it as numbers), which you do using the key point meta=explicit symbolic.

Since you're using math commands in your labels, you'll have to make sure they are typeset in math mode. You can do this using nodes near coords=$\pgfplotspointmeta$.

0   0   0.1
1   0   \pi
2   0   \frac{\pi}{2}

    nodes near coords=$\pgfplotspointmeta$,
    point meta=explicit symbolic
\addplot table [meta index=2] {data.dat};
share|improve this answer

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.