I want to do some plots using TikZ, however the following code doesn't work:
\documentclass{minimal}
\usepackage{amsmath}
\usepackage{pgf,tikz}%
\begin{document}
\begin{tikzpicture}
\draw[->] (-3,0) -- (2.2,0) node[right] {$x$}; %
\draw[->] (0,-0.5) -- (0,3.2) node[above] {$y$};%
\draw plot (\x,{\x^2});%
\end{tikzpicture}
\end{document}
Any idea what's wrong?
How to plot functions like x \mapsto a^x (a > 0)?
Edit: Thanks for the patch, however ploting 2^x doesn't work, I get the following picture using Jakes answer:

