1

When compiling simple examples using the \addplot command from pgfplots I'm getting simple examples. For example, the following is an adaptation of one of the examples in their documentation (From the code shown at http://pgfplots.sourceforge.net/gallery.html, though the full file for the image in the docs also produces the same error)

\documentclass[tikz]{standalone}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=1.16}

\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}

Running this results in the errors:

! Illegal parameter number in definition of \pgfmaththisrow@.
<to be read again> 
                   1
l.18 };

? 
! Illegal parameter number in definition of \pgfmaththisrowno@.
<to be read again> 
                   1
l.18 };

? 

The fact that the basic example raises errors indicates to me that I have a broken installation of pgfplots, however I've already re-installed the latest MiKTeX (2.9.6753 x64) from scratch and pulled in the latest version of pgfplots (packaged 4/8/2018) from their package manager to try to work around this issue. I've also tried using various recent version numbers for the pgfplot \pgfplotsset{compat=1.16} command but that made no difference.

What should I be doing to get this working?

Edit: Here's the full log file.

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6745 64-bit)
entering extended mode
(C:/Users/Owner/scipy-articles/scipy-1.0/demo.tex
LaTeX2e <2018-04-01> patch level 5
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\standalone\standalone.cls
Document Class: standalone 2018/03/26 v1.3a Class to compile TeX sub-files stan
dalone
("C:\Program Files\MiKTeX 2.9\tex\latex\tools\shellesc.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\xkeyval\xkeyval.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\xkeyval\xkeyval.tex"
("C:\Program Files\MiKTeX 2.9\tex\generic\xkeyval\xkvutils.tex"
("C:\Program Files\MiKTeX 2.9\tex\generic\xkeyval\keyval.tex"))))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\standalone\standalone.cfg)
 ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\pgf\frontendlayer\tikz.sty
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\pgf\basiclayer\pgf.sty
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\pgf\utilities\pgfrcs.sty
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\utilities\pgfutil-co
mmon.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\utilities\pgfutil-co
mmon-lists.tex))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\utilities\pgfutil-la
tex.def (C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\ms\everyshi.sty))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\utilities\pgfrcs.cod
e.tex))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\pgf\basiclayer\pgfcore.sty
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-cfg\graphics.cfg")
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-def\pdftex.def")))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\pgf\systemlayer\pgfsys.sty

(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\systemlayer\pgfsys.c
ode.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\utilities\pgfkeys.co
de.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\utilities\pgfkeysfil
tered.code.tex))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\systemlayer\pgf.cfg)

(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\systemlayer\pgfsys-p
dftex.def
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\systemlayer\pgfsys-c
ommon-pdf.def)))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\systemlayer\pgfsysso
ftpath.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\systemlayer\pgfsyspr
otocol.code.tex))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\xcolor\xcolor.sty
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-cfg\color.cfg"))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcore.c
ode.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmath.code.te
x
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmathcalc.cod
e.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmathutil.cod
e.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmathparser.c
ode.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmathfunction
s.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmathfunction
s.basic.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmathfunction
s.trigonometric.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmathfunction
s.random.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmathfunction
s.comparison.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmathfunction
s.base.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmathfunction
s.round.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmathfunction
s.misc.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmathfunction
s.integerarithmetics.code.tex)))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmathfloat.co
de.tex))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcorepo
ints.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcorepa
thconstruct.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcorepa
thusage.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcoresc
opes.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcoregr
aphicstate.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcoretr
ansformations.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcorequ
ick.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcoreob
jects.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcorepa
thprocessing.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcorear
rows.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcoresh
ade.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcoreim
age.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcoreex
ternal.code.tex))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcorela
yers.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcoretr
ansparency.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\basiclayer\pgfcorepa
tterns.code.tex)))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\modules\pgfmodulesha
pes.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\modules\pgfmoduleplo
t.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\pgf\compatibility\pgfcomp-
version-0-65.sty)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\pgf\compatibility\pgfcomp-
version-1-18.sty))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\pgf\utilities\pgffor.sty
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\pgf\utilities\pgfkeys.sty
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\utilities\pgfkeys.co
de.tex))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\pgf\math\pgfmath.sty
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmath.code.te
x))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\utilities\pgffor.cod
e.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\math\pgfmath.code.te
x)))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\frontendlayer\tikz\t
ikz.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\libraries\pgflibrary
plothandlers.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\modules\pgfmodulemat
rix.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\frontendlayer\tikz\l
ibraries\tikzlibrarytopaths.code.tex))))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\latex\pgfplots\pgfplots.sty
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\pgfplots.revisi
on.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\pgfplots.code.t
ex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\pgfplotscore.co
de.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\sys\pgfplotssys
generic.code.tex))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\libs\pgfplotsli
brary.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\oldpgfcompatib\
pgfplotsoldpgfsupp_loader.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\libraries\pgflibrary
fpu.code.tex)
Package pgfplots: loading complementary arithmetics for your pgf version...

(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\oldpgfcompatib\
pgfplotsoldpgfsupp_pgflibraryfpu.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\oldpgfcompatib\
pgfplotsoldpgfsupp_pgfmathfloat.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\oldpgfcompatib\
pgfplotsoldpgfsupp_trig_format.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\oldpgfcompatib\
pgfplotsoldpgfsupp_leq.code.tex))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\util\pgfplotsut
il.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\liststructure\p
gfplotsliststructure.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\liststructure\p
gfplotsliststructureext.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\liststructure\p
gfplotsarray.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\liststructure\p
gfplotsmatrix.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\numtable\pgfplo
tstableshared.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\liststructure\p
gfplotsdeque.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\util\pgfplotsbi
nary.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\util\pgfplotsbi
nary.data.code.tex))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\util\pgfplotsut
il.verb.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\libs\pgflibrary
pgfplots.surfshading.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\sys\pgflibraryp
gfplots.surfshading.pgfsys-pdftex.def)))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\util\pgfplotsco
lormap.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\util\pgfplotsco
lor.code.tex))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\pgfplotsstacked
plots.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\pgfplotsplothan
dlers.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\pgfplotsmeshplo
thandler.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\pgfplotsmeshplo
timage.code.tex)))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\pgfplots.scalin
g.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\pgfplotscoordpr
ocessing.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\pgfplots.errorb
ars.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\pgfplots.marker
s.code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\pgfplotsticks.c
ode.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgfplots\pgfplots.paths.
code.tex)
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\frontendlayer\tikz\l
ibraries\tikzlibrarydecorations.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\modules\pgfmoduledec
orations.code.tex))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\frontendlayer\tikz\l
ibraries\tikzlibrarydecorations.pathmorphing.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\libraries\decoration
s\pgflibrarydecorations.pathmorphing.code.tex))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\frontendlayer\tikz\l
ibraries\tikzlibrarydecorations.pathreplacing.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\libraries\decoration
s\pgflibrarydecorations.pathreplacing.code.tex)))
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\frontendlayer\tikz\l
ibraries\tikzlibraryplotmarks.code.tex
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\libraries\pgflibrary
plotmarks.code.tex)))
No file demo.aux.
ABD: EveryShipout initializing macros
(C:\Users\Owner\AppData\Roaming\MiKTeX\2.9\tex\context\base\supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) ("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\epstopdf-base.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\grfext.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\kvdefinekeys.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty")))
("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\kvoptions.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\kvsetkeys.sty"
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\etexcmds.sty")))
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\pdftexcmds.sty"))
Package pgfplots notification 'compat/show suggested version=true': document ha
s been generated with the most recent feature set (\pgfplotsset{compat=1.16}).

! Illegal parameter number in definition of \pgfmaththisrow@.
<to be read again> 
                   1
l.18 };

? 
  • 2
    Welcome to TeX.SE! The only error I get with your code is the one that labels the y axis. This suggests there's something wrong with your TeX installation. – user121799 Jul 17 '18 at 17:11
  • Great! Thanks for confirming that. It's good to know where the problem is. – IanH Jul 17 '18 at 17:16
  • Similar error at https://www.reddit.com/r/LaTeX/comments/8nb3o7/need_help_with_addplot/ but no solution there either. – IanH Jul 17 '18 at 17:29
  • Can you show the .log file, perhaps that could give some hints. – Torbjørn T. Jul 17 '18 at 21:10
  • 4
    I'm voting to close this question as off-topic because it was most likely a broken TeX installation as OP has stated in his answer. – Stefan Pinnow Aug 17 '18 at 8:47
0

The error goes away after doing a second complete reinstall. My best guess is that, in my most recent reinstall, some files were left behind when uninstalling the old version of MiKTeX. When uninstalling the current version, be sure that the files C:/Program Files/MiKTeX 2.9 (or the equivalent Program Files (x86) directory if you used the 32 bit version) and C:/Users/%USERNAME%/AppData/Roaming/MiKTeX (where %USERNAME% is your user name) are properly deleted.

|improve this answer|||||

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