I am using this snippet:
\documentclass{beamer}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel={$f(x) = x^{-1}$}
]
\addplot {x^{-1}}; % this was previously: x^2
\end{axis}
\end{tikzpicture}
\end{document}
That worked until I changed x^2 to x^{-1}. Now I am getting the following error (there are also lots of errors after it):
PGF Math: Sorry, an internal routine of the floating point unit near '2Y1.0e0]'. (in 'x^{-1}'). \end{frame}
Research:
I could not find many search results except these two questions from Tex SE:
Unfortunately, they seem to be unrelated since their problem is caused by a foreach construct which I don't even have in my code.
My system:
- MiKTeX-pdfTeX 2.9.4535 (1.40.13) (MiKTeX 2.9)
- PdfLaTeX
- Document class: Beamer

\addplotshould bex^(-1), notx^{-1}. Since the resulting plot is still ugly (a value near 0 is much too large), I'll let someone with more pgfplots knowledge write a proper answer. – Bruno Le Floch Nov 18 '13 at 21:56