\documentclass{article}

\usepackage{pgfplots}
\pgfplotsset{compat=1.11,typeset ticklabels with strut}

% \usetikzlibrary{}
% \usepgfplotslibrary{}

\begin{document}

\setlength{\fboxsep}{0pt}

\fbox{%
\begin{tikzpicture}
	\begin{axis}[
	]
	\addplot+[samples=2] {x};
	\end{axis}
\end{tikzpicture}}

\fbox{%
\begin{tikzpicture}
	\begin{axis}[
		xticklabels={a,g,G,q,0,1},
		yticklabels={a,g,G,q,0,1},
		zticklabels={a,g,G,q,0,1},
	]
	\addplot+[samples=2] {x};
	\end{axis}
\end{tikzpicture}}%

\fbox{%
\begin{tikzpicture}
	\begin{axis}[
		xticklabels={a,g,G,q,0,1},
		yticklabels={a,g,G,q,0,1},
		zticklabels={a,g,G,q,0,1},
	]
	\addplot3+[samples y=1,samples=2] {x};
	\end{axis}
\end{tikzpicture}}


\end{document}

