I am trying to mark two inflection points using a foreach loop in a pgfplot, but it isn't working.
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat = 1.10}
\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\infx}{1/sqrt(2)}
\pgfmathsetmacro{\infy}{exp(-.5)}
\begin{axis}[
xmin = -3,
xmax = 3,
ymin = -0.1,
ymax = 1.05,
domain = -4:4
]
\addplot[blue, samples = 500, smooth] gnuplot {exp(-x^2)};
\foreach \x/\y in {\infx/\infy, -\infx/\infy}{
\draw[red] (axis cs: \x, \y) circle[radius = .025];
}
\end{axis}
\end{tikzpicture}
\end{document}
I am being told:
Undefined control sequence.^M
<argument> axis cs: \x ^M
, \y ^M
l.34 \end{axis}^M