I would like to display a common legend for a groupplot like this:
\documentclass[crop]{standalone}
\usepackage[svgnames]{xcolor}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\usepackage{hyperref}
\hypersetup{}
\begin{document}
\begin{tikzpicture}
\begin{groupplot}[
group style={
{group size=1 by 1}},
legend entries={A, B},
legend columns=2,
legend to name=grouplegend]
\nextgroupplot[title=One]
\addplot+[color=Blue] coordinates {(0,0) (1,1) (2,2)};
\addplot+[color=Red] coordinates {(0,2) (1,1) (2,0)};
\end{groupplot}
\node (l1) at ($(group c1r1.south)$)
[below, yshift=-2\pgfkeysvalueof{/pgfplots/every axis title shift}]
{\ref{grouplegend}};
\end{tikzpicture}
\end{document}
As seen in the result, the legend contains a reference to the figure (hyperref of course producing a box around it). Is there a way to disable this reference?

legend to nametool. For a single plot I would indeed use the basic approach instead. – hfhc2 Feb 15 '23 at 13:17