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 get a lot of errors when I try to compile even the simplest examples with pgfplots. The following is taken from the documentation of the package:




    \addplot[color=red,mark=x] coordinates {


I get more than 30 errors of the following type:

! Illegal parameter number in definition of \pgfmathresult.
<to be read again>
l.11       ylabel=Error]

You meant to type ## instead of #, right?
Or maybe a } was forgotten somewhere earlier, and things
are all screwed up? I'm going to assume that you meant ##.

Strangely, the produced pdf output contains the (visually) correct plot.

I'm using TeXLive 2009, pdfTeX, pgfplots 1.5.1, pgf 2.00.

edit: I believe that this has something to do with my system (missing or old packages?) but I'm not sure. Maybe someone has seen this before?

share|improve this question
If I remove \pgfplotsset{compat=1.5.1} it compiles without problems for me. I am using pgf v2.10 though. – Roelof Spijker Jan 16 '12 at 12:05
I get exactly the same output if I remove this line. – boothby81 Jan 16 '12 at 12:11
Then I would advise you to update to pgf v2.10. Also, register on this site and get a proper username. – Roelof Spijker Jan 16 '12 at 12:29
Updating to pgf v2.10 ideed helped - thanks! I already was registered but now changed my name. – boothby81 Jan 16 '12 at 12:54
@wh1t3: Could you turn your comment into an answer? – Jake Jan 16 '12 at 21:22
up vote 7 down vote accepted

As was determined in the comments the problem is with the version of pgf you are using. Update to pgf v2.10 to resolve the issue.

share|improve this answer
I wasn't allowed to write an answer to my own question since I'm a newbie - thanks for your help. – boothby81 Jan 18 '12 at 9:27
@boothby81 if it answers your question consider accepting the answer so the question is listed as answered. You can do so by clicking the checkmark to the left of the answer. – Roelof Spijker Jan 18 '12 at 9:29

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.