\documentclass[a4paper]{article}

\usepackage{pgfplots}

\pgfplotsset{compat=1.8}

\begin{document}

\fbox{%
\begin{tikzpicture}
%\tracingcommands=2\tracingmacros=2
	\begin{axis}[
		xmin=0,
		xmax=1,
		ymin=0,
		ymax=1,
		hide axis,
	]
	\addplot coordinates {(-1,-1) (2,2)};
	\addplot coordinates {(0.4,0.2) (0.6,0.6)};
	\end{axis}
\end{tikzpicture}%
}%

\vskip4cm

\fbox{%
\begin{tikzpicture}
%\tracingcommands=2\tracingmacros=2
	\begin{axis}[
		xmin=0,
		xmax=1,
		ymin=0,
		ymax=1,
		hide axis,
	]
	\addplot+[overlay] coordinates {(-1,-1) (2,2)};
	\addplot coordinates {(0.4,0.2) (0.6,0.6)};
	\end{axis}
\end{tikzpicture}%
}%
\end{document}

