# pgfplots ticklabel format logarithmic scale

How do I disable exponent notation on logarithmic scale?

I want ...,$10^0$,$10^1$,$10^2$,... replaced by ...,1,10,100,...

I have tried to play with this default(pgfplots manual p. 209):

\pgfplotsset{ log base 10 number format code/.code={$10^{\pgfmathprintnumber{#1}}$}
}


But I can't make it work, and it seems to be a complicated way to do a simple thing.

\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\pgfplotsset{log base 10 number format code/.code={$fun^{\pgfmathprintnumber{#1}}$}}
\begin{semilogxaxis}
[xmin=1, xmax=1000, domain=1:1000]
\end{semilogxaxis}
\end{tikzpicture}
\end{document}


-
I will add this to the pgfplots todo list (the requests came up a couple of times now). It seems an easily usable predefined switch is adequate here. –  Christian Feuersänger Dec 10 '11 at 21:04

Do you mean something like this:

\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\pgfplotsset{%
x tick label style={/pgf/number format/1000 sep=\,},
log base 10 number format code/.code={%
$\pgfmathparse{10^(#1)}\pgfmathprintnumber{\pgfmathresult}$%
}%
}
\begin{semilogxaxis}
[xmin=1, xmax=1000, domain=1:1000]

Thanks for the code provided, worked most of the times for my purposes! However, I noticed, that your code does not correctly handle negative exponents, i.e. 10^(-0.3) leads to a label of "2" (==10^0.3) instead of "0.5". I worked around by changing your code to \pgfmathparse{1/10^(#1)} however, is there a general to avoid a wrong handling of the sign of #1 ? –  user32597 Jun 21 '13 at 9:47