\documentclass{article}
% translate with >> pdflatex -shell-escape <file>

% This file is used as unit test for pgfplots, copyright by Christian Feuersaenger.
% 
% See
%   http://pgfplots.sourceforge.net/pgfplots.pdf
% for pgfplots.
%
% Any required input files (for <plot table> or <plot file> or the table package) can be downloaded
% at
% http://www.ctan.org/tex-archive/graphics/pgf/contrib/pgfplots/doc/latex/
% and
% http://www.ctan.org/tex-archive/graphics/pgf/contrib/pgfplots/doc/latex/plotdata/

\usepackage{pgfplots}
\pgfplotsset{compat=1.3}

\pagestyle{empty}

\begin{document}

\def\testaxis#1{
	\begin{tikzpicture}
	\begin{axis}[#1,title=A title,xlabel=$x$,ylabel=$y$]
	
	\addplot (\x,\x^2);
	\legend{$x^2$}
	\end{axis}
	\end{tikzpicture}
}
\subsection{hide x/y axis}
\testaxis{hide x axis}

\testaxis{hide y axis}

\testaxis{hide x axis,axis y line=center}

\testaxis{hide y axis,axis x line=center}

\testaxis{hide x axis,axis y line=right}

\testaxis{hide y axis,axis x line=bottom}
\end{document}
