似乎使用 fillbetween 库时全局轴选项未传递。有人可以证实吗?
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{groupplots}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{label style={font=\small},every tick/.append style={very thin,black},
every axis/.append style={very thin,black},
}
\begin{document}
\begin{tikzpicture}
\begin{groupplot}[group style={group size=2 by 1}]
\nextgroupplot
\addplot [blue] {rnd};
\nextgroupplot
%\nextgroupplot[every tick/.append style={very thin,black},
% every axis/.append style={very thin,black}]
\addplot [red] {rnd};
\addplot[draw=none,
name path=A,
] {rnd};
\addplot [draw=none,domain=-6:6,name path=B] {0}; % “fictional” curve
\addplot [gray,opacity=0.5] fill between[of=A and B,domain=-6:6]; % filling
\end{groupplot}
\end{tikzpicture}
\end{document}