# nodes near coords with logarithmic axis: Wrong values

I created a horizontal bar plot to compare benchmark times. Since one of the tested components is really slow, I need a logarithmic y axis for the other values to be distinguishable. Combined with "nodes near coords" this results in the calculated values showing, instead of the original ones. Is there any way to fix this?

What it looks like:

What the values(!) should look like:

Clearly, I'm overlooking something terribly obvious. I'm just a beginner at PGFPlots, so please don't kill me. :)

MWE:

\documentclass[fontsize=12pt]{scrartcl}

\usepackage{pgfplots}
\pgfplotsset{compat=1.8}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=12.5cm,
xbar=0.1cm,
xmin=0,
y=0.6cm,
bar width=0.4cm,
xlabel={Time (ms)},
xmode=log,
major x tick style = transparent,
major y tick style = transparent,
symbolic y coords={
{Aspose.Cells},
{NPOI},
{C1.Excel},
{Spire.XLS},
{SmartXLS},
},
ytick=data,
y dir = reverse,
nodes near coords,
nodes near coords align={horizontal},
]

(3078.6,{Aspose.Cells})
(10059.2,{C1.Excel})
(7437079.8,{SmartXLS})
(19975.2,{Spire.XLS})
(10025.2,{NPOI})};
\end{axis}
\end{tikzpicture}
\end{document}


PGFPlots is printing the log transformed x value. To print the non transformed value, set point meta=rawx. (Similarly for ybar, use point meta=rawy to get the raw y value.)

Note that bar plots with logarithmic axes are a really bad idea, since the zero point of logarithmic plots is arbitrary and the length of the bar doesn't carry any information. A dot plot is better in this case:

\documentclass[fontsize=12pt]{scrartcl}

\usepackage{pgfplots}
\pgfplotsset{compat=1.8}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=12.5cm,
%xbar=0.1cm,
only marks,
xmin=0,
y=0.6cm,
bar width=0.4cm,
xlabel={Time (ms)},
xmode=log,
major x tick style = transparent,
major y tick style = transparent,
symbolic y coords={
{Aspose.Cells},
{NPOI},
{C1.Excel},
{Spire.XLS},
{SmartXLS},
},
ytick=data,
y dir = reverse,
nodes near coords,
nodes near coords align={horizontal},
point meta=rawx
]

(3078.6,{Aspose.Cells})
(10059.2,{C1.Excel})
(7437079.8,{SmartXLS})
(19975.2,{Spire.XLS})
(10025.2,{NPOI})};
\end{axis}
\end{tikzpicture}
\end{document}

• Thanks a lot for your quick answer! Like I thought, a single option... P: – Daniel B Nov 8 '13 at 10:54