# How to format y tick label into a consistent decimal style in pgfplots

I have this plots .

It is generated by the pgfplots code at the bottom. For the y tick labels, instead of the one shown in the figure, I would like to have {2, 4, 6, 8, 10} by the y ticks, and a $10^{-2}$ on top of y axis, just like Jake's solution to this question, which produces a figure with the desired y tick label format. (However, this does not do so for my ytick={0.02, 0.04, 0.06, 0.08, 0.1})

\documentclass{article}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}[scale=0.9]
\begin{axis}[
minor tick num=1,
xmin=0,
xmax=6,
ymin=0,
ytick={0.02, 0.04, 0.06, 0.08, 0.1},
xlabel={X}, ylabel={Y},
yticklabel=\pgfmathprintnumber{\tick}]
0 0\\
2 0.15\\
};
\end{axis}
\end{tikzpicture}

\end{document}

-

You can use the scaled y ticks=base 10:2 option:

\documentclass{article}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}[scale=0.9]
\begin{axis}[
minor tick num=1,
xmin=0,
xmax=6,
ymin=0,
ytick={0.02, 0.04, 0.06, 0.08, 0.1},
xlabel={X}, ylabel={Y},
yticklabel=\pgfmathprintnumber{\tick},
scaled y ticks=base 10:2
]
0 0\\
2 0.15\\
};
\end{axis}
\end{tikzpicture}

\end{document}


-
scaled y ticks=base 10:2 is exactly what I was looking for. Thanks for the quick response. – Causality Jul 23 '12 at 22:56