When using ybar stacked on a mix of positive and negative coordinates I cannot seem to find the answer I want.
\begin{figure}
\begin{tikzpicture}
\begin{axis}[ybar stacked]
\addplot[green,fill=green] coordinates { (1, 3) (2, 3) (3,3) (4,3) };
\addplot[red,fill=red] coordinates { (1,-4) (2,-4) (3,4) (4,4) };
\end{axis}
\end{tikzpicture}
\end{figure}
I'd like to get all red bars 4 units long (as they are in the coordinates), though the left two bars are hiding behind the green ones. Is there any solution to this? (Changing the order of the \addplot calls in the code above cannot fix it.)


ybar stacked? Perhaps what you are looking for is justybar? – Peter Grill Apr 30 '12 at 17:38stackedis that the "bar is drawn from the top coordinates of the previous bar". Since you have negative coordinates, the bar is drawn downward from the top of the previous bar exactly, and hence the overlap. Still not sure I understand what you want. Perhaps if you posted an image of the desired solution it would be clearer (even if you have to manually tweak the coordinates, to be able to show the desired result). – Peter Grill Apr 30 '12 at 18:09