I am trying to plot some data with on logarithmic axes. My x axis is labelled with integer numbers from the input data (xtick=data). I don't want to use scientific notation, so I added the log ticks with fixed point option. However, the tick labels are rounded and have a precision of only 3 digits.
I have tried to solve this problem in 2 ways. First: changing the x tick label style with formatting options. See the example below.
\begin{tikzpicture}
\begin{loglogaxis}[
log ticks with fixed point,
x tick label style={/pgf/number format/fixed relative,/pgf/number format/precision=5},
xtick=data,
]
\addplot table[x=input,y=output] {
input output
1 0.9
16 4
256 9
4096 15
65536 20
};
\end{loglogaxis}
\end{tikzpicture}
My second attempt was to recalculate the labels based on this answer and this answer. This leads to some errors in the floating point calculation, since the example below results in the label '33442' instead of '33444'.
\begin{tikzpicture}
\begin{loglogaxis}[
log ticks with fixed point,
log basis x=2,
xticklabel={
\pgfkeys{/pgf/fpu=true}
\pgfmathparse{2^\tick}
\pgfmathprintnumber[fixed]{\pgfmathresult}
},
xtick=data,
]
\addplot table[x=input,y=output] {
input output
1 0.9
16 4
256 9
4096 15
33444 20
};
\end{loglogaxis}
\end{tikzpicture}
How can I solve this problem and display the numbers exactly as they are in my data?


xticklabels from table, which I will put in an answer. – Thomas May 13 '16 at 12:17xticklabels from tableinstead – Jake May 13 '16 at 12:28