pgfplots 的“ybar interval stacked”键是否存在错误?

pgfplots 的“ybar interval stacked”键是否存在错误?

ybar interval键用于将图形条放置在给定坐标之间。接下来的 5 个坐标定义 4 个间隔。此键按预期工作并产生以下结果。

ybar 间隔

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}

\begin{tikzpicture}
\begin{axis}[axis x line=bottom,axis y line=left,
            ymin=0,ymax=8, xmin=20,xmax=50,
            minor y tick num=1]
\addplot+ [ybar interval,fill=green] coordinates{(25,1) (30,4) (35,5) (40,2) (45,0)};
\end{axis}
\end{tikzpicture}
\end{document}

当密钥为ybar stacked代码时,它会按预期产生 5 个条形图。

ybar 堆叠

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}

\begin{tikzpicture}
\begin{axis}[axis x line=bottom,axis y line=left,
            ymin=0,ymax=8, xmin=20,xmax=50,
            minor y tick num=1]
\addplot+ [ybar stacked,fill=green] coordinates{(25,1) (30,4) (35,5) (40,2) (45,0)};
\addplot+ [ybar stacked,pattern color=blue,draw=black,pattern=north east lines]coordinates{(25,1) (30,1) (35,2) (40,1) (45,2)};
\end{axis}
\end{tikzpicture}
\end{document}

当密钥为时,ybar interval stacked代码会产生以下结果,该结果不是间隔内的堆叠。

ybar 间隔堆叠

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}

\begin{tikzpicture}
\begin{axis}[axis x line=bottom,axis y line=left,
            ymin=0,ymax=8, xmin=20,xmax=50,
            minor y tick num=1]
\addplot+ [ybar interval stacked,fill=green] coordinates{(25,1) (30,4) (35,5) (40,2) (45,0)};
\addplot+ [ybar interval stacked,pattern color=blue,draw=black,pattern=north east lines]coordinates{(25,1) (30,1) (35,2) (40,1) (45,2)};
\end{axis}
\end{tikzpicture}
\end{document}
  • pgfplots 中有错误吗?
  • 否则钥匙如何ybar interval stacked工作?

我为此开了一张票,斯蒂芬·平诺确认是bug。

翻译www.DeepL.com/Translator

相关内容