I am trying to create a zoom effect for the plot on the left. I make a box in it and I want to draw lines from two corners of the rectangle going to the plot on the right. I thought it might be straightforward with \coordinate but pgfplots seems to forget the coordinate passing to another plot. Is there a possibility to make this effect using groupplots ?
Here is a MWE of my plots.
\documentclass{standalone}
\usepackage{mathtools}
\usepackage{tikz}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}[scale=0.7]
\begin{groupplot}[group style={group size=2 by 1,ylabels at=edge left,},
xlabel=$X_\text{Cr}$,ylabel=$\mu$,
]
\nextgroupplot[xmax=1.1,xmin=-0.1,ymax=30000,ymin=-23000]
\draw (0,-21000) rectangle (0.2,10000);
\coordinate (A) at (0,-21000);
\coordinate (B) at (0.2,10000);
\nextgroupplot[xmax=0.2,xmin=0,ymax=10100,ymin=-23000]
\addplot coordinates {(0,-20000) (0.1,-10000) (0.18,9000)};
\end{groupplot}
\draw (A) -- (group c2r1.north west);
\draw (B) -- (group c2r1.south west);
\end{tikzpicture}
\end{document}

