# Z-Order of plots pgfplots

Simple question:

I can’t seem to control the z-order (i.e. which comes in front, which comes in the back) of the plots in a 2D axis.

MWE:

\documentclass{article}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}
0 2
1 1
2 2
};
0 2
1 1
2 2
};
\end{axis}
\end{tikzpicture}
\end{document}


Obligatory screenshot:

The problem here is that the first plot, only marks always comes in front of the other plot. If I reverse the order of the respective \addplot commands then the colours and marks are switched but not the order of the plots. That is, the only marks are still in front of the line.

How can I change this?

(Yes, I need two separate plots here since the line will actually be a regression curve that uses different data but there is a huge overlap and the curve is barely visible below the point cloud).

-
That even ignores the pgfonlayer environment! –  Caramdir Feb 12 '11 at 1:49

It works if you set the option clip marker paths:
\begin{axis}[clip marker paths=true]