[Tex/LaTex] pgfplots – number format on axis

pgfplots

How can I force pgfplots to draw my axis ticks labels consistently? I mean instead of 0 a 0.0, instead of 1 a 1.0 in the below image.

enter image description here

EDIT: Code

\documentclass[a4paper,10pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepackage{filecontents}
\usepackage{siunitx}

\pgfplotsset{
compat=1.7,
every axis/.append style={
line width=1.25pt,
tick style={line width=1.25pt, color=black, line cap=round}
}
}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
  enlarge x limits=0.05,
  enlarge y limits=0.05,
  try min ticks=4,
  max space between ticks=50pt,
  y tick label style={
    /pgf/number format/.cd,
    fixed,
    fixed zerofill,
    precision=1
  },
  x tick label style={
    /pgf/number format/.cd,
    fixed,
    fixed zerofill,
    precision=2
  }
]
\addplot[red] table[x index=1,y index=7] {dataA.dat};
\end{axis}
\end{tikzpicture}

\end{document}

I can't attach the data file, so here's a link.

Best Answer

You can change the number format using the /pgf/number format keys (there are a lot of options). In this concrete case, you'll want to set fixed, fixed zerofill, precision=1 for the y axis, and precision=2 for the x axis:

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

\begin{tikzpicture}

\begin{axis}[
    y tick label style={
        /pgf/number format/.cd,
            fixed,
            fixed zerofill,
            precision=1,
        /tikz/.cd
    },
    x tick label style={
        /pgf/number format/.cd,
            fixed,
            fixed zerofill,
            precision=2,
        /tikz/.cd
    }
]
\addplot [domain=0.98:1.02] {rnd};
\end{axis} 
\end{tikzpicture}

\end{document}