I am trying to make a group of plots with groupplots sharing the same colorbar and the same y axis. An example:
\documentclass{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\begin{document}
\begin{tikzpicture}
\begin{groupplot}[%
point meta min=0, point meta max=25,
group style={group size=2 by 1,
yticklabels at=edge left, ylabels at=edge left,
},
colorbar,
colorbar to name=commonbar,
]
\nextgroupplot
\addplot[scatter, scatter src=y] {x^2};
\nextgroupplot
\addplot[scatter, scatter src=y] {x^2};
\end{groupplot}
\end{tikzpicture}
\ref{commonbar}
\end{document}
Here, the colorbar to name option takes care of using the same colorbar for all plots (there is a warning from pdflatex on "multiply defined labels" -- to be expected, I suppose, and no problem as long as the range of the colorbar is specified). The colorbar is then "placed" by the \ref{commonbar} command.
How can I align the colorbar properly with the figures? I have tried placing the \ref command in several places (the placement above gives the best result I've seen so far). You may say I'm looking for the equivalent of yticklabels at=edge left for colorbars.

