# 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
@ChristianFeuersänger: Is log ticks with fixed point the easily usable switch you commented about? – Ben Voigt Oct 24 '14 at 22:08
@Ben Voigt: I believe that you are correct. Maybe log ticks with fixed point has been added to TikZ after my question!? Will you post an answer? – Hans-Peter E. Kristiansen Oct 25 '14 at 8:06
@BenVoigt Yes, it is. I suppose your request is motivated by tex.stackexchange.com/questions/208891/…, right? Let us continue any comments/problem analysis on that link. – Christian Feuersänger Oct 25 '14 at 9:33
@Christian Feuersänger: Are you the helpful person, who added this feature? -If so, will you post a more contemporary answer to this question. /OP – Hans-Peter E. Kristiansen Oct 25 '14 at 15:25

In addition to the other answer, more recent versions of pgfplots come with the style log ticks with fixed point. It does almost the same: it reconfigures the number printer such that ticks are displayed in fixed point format. Its logic is somewhat more complicated to avoid rounding inaccuracies and different log bases.

Here is the result with this new feature:

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\begin{document}
\begin{tikzpicture}
\begin{semilogxaxis}[
xmin=1,
xmax=1000,
domain=1:1000,
log ticks with fixed point,
x tick label style={/pgf/number format/1000 sep=\,},
]
\end{semilogxaxis}
\end{tikzpicture}
\end{document}


-

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
Agreed, this answer does not work. I found a better but messy solution xticklabel={\pgfmathfloatparsenumber{\tick}\pgfmathfloatexp{\pgfmathresult}\pgf‌​mathprintnumber{\pgfmathresult}} on pgfplots.sourceforge.net/gallery.html, which got used in my question and answer pgfplot log axis more than one tick label per decade (1,2,5,10) – Ben Voigt Oct 24 '14 at 21:41