I tried plotting the following functions; however, they are cut off at x=[-5,5] and I cannot figure out why. Any help would greatly be appreciated.
\documentclass{article}
\usepackage{pgfplots}
\usepgfplotslibrary{external}
\tikzexternalize[shell escape=-enable-write18] %needed for the MiKTeX compiler
\tikzset{external/force remake}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xmin=-10,xmax=10]
\addplot [mark=none, smooth, color=blue]{x^2+2};
\addplot [mark=none, smooth, color=red]{x^2};
\addplot [mark=none, smooth, color=green]{x^2-2};
\addlegendentry{$x^2+2$}
\addlegendentry{$x^2$}
\addlegendentry{$x^2-2$}
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[xmin=-10,xmax=10]
\addplot [mark=none, smooth, color=blue]{(x+2)^2};
\addplot [mark=none, smooth, color=red]{x^2};
\addplot [mark=none, smooth, color=green]{(x-2)^2};
\addlegendentry{$(x+2)^2$}
\addlegendentry{$x^2$}
\addlegendentry{$(x-2)^2$}
\end{axis}
\end{tikzpicture}
\end{document}