I would like to place a legend outside an axis using symbols from multiple plots within a groupplot. Trying it the way I show below doesn't seem to work, just the last entry is shown. How can this be done in a way such that all entries are shown?
\documentclass[crop]{standalone}
\usepackage[svgnames]{xcolor}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\begin{document}
\begin{tikzpicture}
\begin{groupplot}[
group style={
{group size=2 by 2}},
legend to name=grouplegend]
\nextgroupplot[title=One]
\addplot+[color=Blue] coordinates {(0,0) (1,1) (2,2)};
\addlegendentry{A}
\nextgroupplot[title=Two]
\addplot+[color=Red] coordinates {(0,2) (1,1) (2,0)};
\addlegendentry{B}
\nextgroupplot[title=Three]
\addplot+[color=Gray] coordinates {(0,2) (1,1) (2,1)};
\addlegendentry{C}
\nextgroupplot[title=Four]
\addplot+[color=Orange] coordinates {(0,2) (1,1) (1,0)};
\addlegendentry{D}
\end{groupplot}
\node (l1) at ($(group c1r2.south)!0.5!(group c2r2.south)$)
[below, yshift=-2\pgfkeysvalueof{/pgfplots/every axis title shift}]
{\ref{grouplegend}};
\end{tikzpicture}
\end{document}



