There's no built-in code for this, but you can create a style to do it if you want. Here, I've created ignore zero
which accepts a single argument: the axis for which the zero ticklabel will not be plotted:
\pgfplotsset{ignore zero/.style={%
#1ticklabel={\ifdim\tick pt=0pt \else\pgfmathprintnumber{\tick}\fi}
}}
That just compares the current value of \tick
on the specified axis to zero. If it is zero, we do nothing; if it's not zero, proceed with normal ticklabel typesetting (\pgfmathprintnumber{\tick}
). Here's an example showing both possibilities (ignoring either x
or y
):
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\pgfplotsset{ignore zero/.style={%
#1ticklabel={\ifdim\tick pt=0pt \else\pgfmathprintnumber{\tick}\fi}
}}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xmin=0,ymin=0,domain=0:5,ignore zero=x]
\addplot {x};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[xmin=0,ymin=0,domain=0:5,ignore zero=y]
\addplot {x};
\end{axis}
\end{tikzpicture}
\end{document}

\documentclass
and the appropriate packages that reproduces the problem.