I have functions plotted in separate axis environments (from pgfplots). In each axis I define a node and I would like to connect these nodes.
In this MWE it doesn't work: The node connection that should be between "sin" and "cos" is way off.
\documentclass{article}
\usepackage{tikz, pgfplots}
\begin{document}
\begin{tikzpicture}
\matrix{
\begin{axis}
\addplot {sin(deg(x))};
\node (sin) at (axis cs:4,1) {sin};
\end{axis}
&
\begin{axis}
\addplot {cos(deg(x))};
\node (cos) at (axis cs:-4,1) {cos};
\end{axis}
\\
};
\draw (cos) -- (sin);
\end{tikzpicture}
\end{document}