# Simplest example from pfgplots documentation not working

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:

\documentclass{article}

\usepackage{pgfplots}
\pgfplotsset{compat=1.5.1}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
xlabel=Cost,
ylabel=Error]
(2,-2.8559703)
(3,-3.5301677)
(4,-4.3050655)
(5,-5.1413136)
(6,-6.0322865)
(7,-6.9675052)
(8,-7.9377747)
};
\end{axis}
\end{tikzpicture}

\end{document}


I get more than 30 errors of the following type:

! Illegal parameter number in definition of \pgfmathresult.
1
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?

-
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

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.