0

I'm having trouble using tikz's

\draw (coordinate) circle (radius);

Command within the axis environment of pgfplots. The following code fails to compile:

\documentclass{article}

\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}

\begin{document}
    \begin{tikzpicture}
        \begin{axis}
            \addplot {x};
            \draw (1,1) circle (1cm);
        \end{axis}
    \end{tikzpicture}
\end{document}

But if I try to draw a circle outside the axis environment it works (although of course the coordinates are not relative to the axis that is drawn). Any idea as to what is happening? I've tried setting compat=1.15 but I get a similar error.

James
  • 187
  • 8
  • 3
    You are using a deprecated syntax. You need \draw (1,1) circle[radius=1cm];. –  Jan 27 '20 at 16:11
  • @Schrödinger'scat Thank you! I would swear blind the old syntax worked last fall. Is this change recent? – James Jan 27 '20 at 18:01
  • Yes, it is. It is the very recent update of pgf to version 3.1.5. –  Jan 27 '20 at 18:03

0 Answers0