Open pgf-tikz-bot opened 5 years ago
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/218/#ab8f Author: mo-gul Timestamp: 2019-02-05 18:19:46.150000
https://sourceforge.net/p/pgfplots/bugs/_discuss/thread/e0b5f1f18c/ab8f/attachment/P.PNG
I can confirm this. This also happens, when ybar stacked interval
is moved to the axis
options (see the attached screenshot).
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{patterns}
\pgfplotsset{
compat=1.16,
my axis style/.style={
xmin=20,
xmax=50,
ymin=0,
ymax=8,
axis x line=bottom,
axis y line=left,
minor y tick num=1,
},
}
\newcommand*\AddPlots{
\addplot+ [
pattern color=green,
draw=black,
pattern=north west lines,
] coordinates {(25,1) (30,4) (35,5) (40,2) (45,0)};
\addplot+ [
pattern color=blue,
draw=black,
pattern=north east lines,
] coordinates {(25,1) (30,1) (35,2) (40,1) (45,2)};
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
my axis style,
ybar stacked,
]
\AddPlots
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
my axis style,
ybar interval stacked,
]
\AddPlots
\end{axis}
\end{tikzpicture}
\end{document}
Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/218/ Author: andre-c Timestamp: 2019-02-05 06:04:26.661000
When the key is
ybar interval stacked
the code produces the following result which is not a stacking in the intervals.