42

When creating a plot like this one

\documentclass{article}

\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture} 
        \begin{axis} 
                \addplot coordinates {
                (0.01,0.01)
                (0.09,0.09)
                };
        \end{axis}
\end{tikzpicture}
\end{document}

pgfplot uses the following xticklabels:

produced output

Is there any way to make pgfplots create labels as 0.01,0.02,... without specifying them all manually using xticklabels and yticklabels?

52

Section 4.12 Number formatting options from pgfplots manual sends you to pgfplotstable manual where in section 2.7 Number formatting options you can find the solution.

\documentclass[border=3mm]{standalone}

\usepackage{pgfplots}
\begin{document}

\begin{tikzpicture} 
        \begin{axis}[scaled ticks=false, tick label style={/pgf/number format/fixed} ]
                \addplot coordinates {
                (0.01,0.01)
                (0.09,0.09)
                };
        \end{axis}
\end{tikzpicture}
\end{document}

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.