I'm trying to create a stacked bar plot where the data is loaded using the pgfplotstableread command. I want to use a logarithmic scale rather than a normal scale. However, when I change theaxis environment to semilogyaxis, pdfplots gives an error:

! Package pgfplots Error: Sorry, pgfplots expects stacked plots to have exactly the same number of coordinates. Unfortunately, I encountered at plot with DIFF ERENT NUMBERS OF COORDINATES. Please verify that 1. no point has been dropped b y coordinate filters (for example log(0) or so) and 2. all plots have the same number of coordinates..

The problem lies with the fact that I have zero values in my dataset. These values do not represent missing values, but I think that pgfplots thinks they are.

How can I correctly plot my data (containing zero values) on a logarithmic scale?

\documentclass{article}
\usepackage{pgfplots, pgfplotstable}

\begin{document}
\begin{tikzpicture}
X   Gp  C1  C2  Name        Zn      Pb
1   1A  0.2 3   Duracem     47.2    12
2   1A  0.2 3   Technocem   0      11
3   1A  0.2 3   Alipre      28      13
5   1A  0.2 8   Duracem     16.2    12
}\datatable

\begin{semilogyaxis}[
axis lines*=left, ymajorgrids,
width=5cm, height=6cm,
ymin=0,
ybar stacked,
bar width=8pt,
xtick=data,
xticklabels from table={\datatable}{Name},
xticklabel style={rotate=90,xshift=-10ex,anchor=mid east}
]

you can compile your stuff if you replace 0 by (say) 1e-16 and ymin=0 by ymin=1. But the key question is... what does stacking logs mean? I am not sure by heart, but I believe it will stack logs, that is: multiply numbers. Please double-check that the log is actually useful here. –  Christian Feuersänger May 30 at 10:19