The following code fails to compile due to the use of rnd:
\documentclass{article}
\usepackage{tikz,pgfplots}
\pgfplotsset{width=7cm,compat=1.3}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot {x};
\draw [] (axis cs: 0,0)
\foreach \i in {1,...,10} {
-- ++ (axis direction cs: 0.2,rnd)
};
\end{axis}
\end{tikzpicture}
\end{document}
Why is this happening and how can it be rewritten to work as intended?

axis direction cs. Taking that out this compiles fine. Also, it is better to usearticleclass and notminimal. See Why not use the minimal class. – Peter Grill Feb 24 '13 at 19:16axis direction csit seems to compile, but I can't see any drawings however!!! – niels Feb 24 '13 at 19:20