梅威瑟:
\documentclass{article}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{groupplots}
\usepgfplotslibrary{fillbetween}
\usepackage{filecontents}
\begin{filecontents}{testdata.dat}
t lineLow lineHigh lineMedian
0 1 1 1
1 2 2 2
2 2 3 2.5
3 2 4 3
4 2 4 3
\end{filecontents}
\begin{document}
\begin{tikzpicture}
\begin{groupplot}
[
group style={group size=1 by 2, vertical sep=30pt}
]
\nextgroupplot
[
]
\addplot[name path=lineLow] table[x=t, y=lineLow] {testdata.dat};
\addplot[name path=lineHigh] table[x=t, y=lineHigh] {testdata.dat};
\addplot[fill=red] fill between[of=lineLow and lineHigh];
\addplot table[x=t, y=lineMedian] {testdata.dat};
\end{groupplot}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
\addplot[name path=lineLow] table[x=t, y=lineLow] {testdata.dat};
\addplot[name path=lineHigh] table[x=t, y=lineHigh] {testdata.dat};
\addplot[fill=red] fill between[of=lineLow and lineHigh];
\addplot table[x=t, y=lineMedian] {testdata.dat};
\end{axis}
\end{tikzpicture}
\end{document}
问题:线条之间的填充区域在内部不起作用groupplots
。有解决方法吗?
版本:
- pgf 3.0.0
- pgfplots 1.11
答案1
这是 中的一个错误pgfplots 1.11
。我降级到pgfplots 1.10
并且一切看起来都符合预期。