# Setting zmin/zmax in groupplot confuses colorbar creation (colorbar is 3d)

When using groupplots and setting zmin and/or zmax in the groupplot environment manually, pgfplots generates a (broken) 3d legend:

I assume the issue is that groupplot passes the zmin/zmax settings to the colorbar axis environment as well, resulting in the existential crisis making the colorbar 3d.

Omitting the settings from the global groupplot environment and passing them manually to each \nextgroupplot works. But I thought this was still worth posting in case there's a better solution or in case this is a bug that needs to be resolved.

# MWE:

\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}

\begin{document}
\begin{tikzpicture}

\begin{groupplot}[%
group style={
group size=2 by 1,
horizontal sep=2cm,
},
zmin=-10,
zmax=10,
colorbar horizontal,
]

\nextgroupplot
% \nextgroupplot[zmin=-10,zmax=10] % Works if global zmin/zmax are commented out.

\nextgroupplot
% \nextgroupplot[zmin=-10,zmax=10] % Works if global zmin/zmax are commented out.

\end{groupplot}
\end{tikzpicture}
\end{document}


You are right, the options are not reset for colorbar.
I have fixed this in pgfplots. You can activate the fix in your tex files by means of
\pgfplotsset{