[Tex/LaTex] Tick labels with decimal places


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

\begin{axis}[tick label style={
                /pgf/number format/fixed,
                /pgf/number format/fixed zerofill,
                /pgf/number format/precision=1
    \addplot+[] {x};