# PGF stacked bar graph not drawn correctly

I am having problem with the following code which is supposed to produce a simple stacked graph.

\documentclass[tikz,border=2pt]{standalone}

\usepackage{pgfplots}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\begin{axis}[ybar stacked]
\end{axis}
\end{tikzpicture}

\end{document}


Below is the output it generates which is not clearly well-aligned. If I explicitly specify ymin = -0.1, ymax = 1.1, the bar looks almost right, but it starts slightly below (0,0). If I replace coordinates (0.00,0.10) with (0.00,0.00), the bar looks just fine. I have absolutely no idea what the problem could be.

Adding enlarge y limits=0.15 to the axis option is one possible solution.

Code

\documentclass[tikz,border=2pt]{standalone}

\usepackage{pgfplots}
\usepackage{tikz}
\pgfplotsset{compat=1.8}
\begin{document}
\begin{tikzpicture}
\begin{axis}[ybar stacked,enlarge y limits=0.15]
\end{axis}
\end{tikzpicture}


\end{document}

• This looks different on my computer (the lowest segment starts below 0). What version of PGFPlots are you using? I'm using 1.10.
– Jake
May 20 '14 at 6:58
• Gee, I forgot there is a minimal length to write in a comment. Keep giving me errors -- Mine is 1.8. May 20 '14 at 7:07
• Mine is also 1.10, though it still doesn't work for me even with \pgfplotsset{compat=1.8}
– Ali
May 22 '14 at 18:06
• @Ali -- thank you for your feedback. I tried and tried and tried again with xelatex and pdflatex, same output as I had shown. This is indeed generated by MiKTeK_Portable\tex\generic\pgfplots\pgfplots.revision.tex) Package: pgfplots 2013/03/17 v1.8 Data Visualization (1.8-3-gaf58a29). May 22 '14 at 19:34