[Tex/LaTex] Tick labels with decimal places

pgfplots

I want to have my axis tick labels in a plot with the first decimal place:
2 -> 2.0, 5 -> 5.0

Have anyone an idea how to do this?!

Best Answer

There must be a duplicate somewhere but anyways here is one way

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\begin{document}
\begin{tikzpicture}
\begin{axis}[tick label style={
                /pgf/number format/fixed,
                /pgf/number format/fixed zerofill,
                /pgf/number format/precision=1
            },
            ]
    \addplot+[] {x};
\end{axis}
\end{tikzpicture}
\end{document}