# pgfplot with constant decimal places on ticks

I'm trying to display the tick labels of the y axis of just this graph within my document formatting to two decimal places. I've tried the following code but it seems that it doesn't like the way I'm trying to change the y tick label style, what have I done wrong?

\documentclass{article}
\usepackage{pgfplots}

\begin{document}

\begin{center}
\begin{tikzpicture}[scale=0.9]
\begin{axis}[minor tick num=1,xmin=0,xmax=6,ymin=100000, ytick={100000,125000,150000,175000,200000,225000,250000,275000,300000}, y tick label style={/pgf/number format/.cd,fixed,fixed zerofill,precision=2},
xlabel={X}, ylabel={Y},
\end{axis}
\end{tikzpicture}
\end{center}

\end{document}


And just for example, Pone.dat is:

1 100000
2 150000
3 200000
4 210000
5 220000
6 230000

-
 Sorry, I've added the definition of \Pone and an example of the .dat file it is called from. – Andy Mar 4 '12 at 11:39

Some styles for the tick label placement and the inner sep are set after the user specified styles. If you use /pgf/number format/.cd in your style, this change of directory remains active, and TikZ complains about not finding keys like /pgf/number format/inner sep, which reside in the /tikz directory. You need to .cd back into the /tikz directory (or not use .cd, but use the full /pgf/number format path for all the options).

\documentclass[]{article}
\usepackage{pgfplots}
\begin{document}

\begin{center}
\begin{tikzpicture}[scale=0.9]
\begin{axis}[
minor tick num=1,
xmin=0,
xmax=6,
ymin=100000,
ytick={100000, 125000, 150000, 175000, 200000, 225000, 250000, 275000, 300000},
xlabel={X}, ylabel={Y},
y tick label style={
/pgf/number format/.cd,
fixed,
fixed zerofill,
precision=2,
/tikz/.cd
}
]

 Thanks Jake, that has worked great in my example. Out of interest is that the 'optimum' way for changing number of decimal places displayed? I found that half code example for changing the decimal places elsewhere, so it's not really obvious to me what the .cd and fixed do, it was only the precision=2 that seemed to suit my needs. – Andy Mar 4 '12 at 12:22