Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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]
    \addplot[color=red,mark=x] coordinates {
      (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.
<to be read again>
                  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?

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

1 Answer 1

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

 
discard

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.