[Tex/LaTex] Connecting subplots

pgfplotstikz-pgf

Is there a way to draw a sort of connection between subplots in TiKz/pgfplot, like in this example? I'm looking to achieve something like this:

enter image description here

But I would need to draw the "x 2000" line between the plots.

EDIT: So right now I have something like this:

enter image description here

Coming from my main.tex:

\input{aipcheck}

\documentclass[final]{aipproc}

\layoutstyle{8x11single}
\usepackage[utf8]{inputenc}
\usepackage{algorithm2e}
\usepackage{color}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{cleveref}
\usepackage{pgfplots}

\pgfplotsset{
tick label style={font=\tiny}, %axis numbers
label style={font=\small}, %axis labels
legend style={font=\tiny}
}

\begin{document}

(...)

\begin{figure}
    \centering
    \newlength\figureheight 
    \newlength\figurewidth 
    \setlength\figureheight{5cm} 
    \setlength\figurewidth{5cm}
    \input{figs/_ddmp2d.tikz}
\label{fig2D}
\end{figure}

with _ddmp2d.tikz, originally created from matlab2tikz, but already modified, containing:

% This file was created by matlab2tikz v0.3.3.
% Copyright (c) 2008--2013, Nico Schlömer <nico.schloemer@gmail.com>
% All rights reserved.
% 
% The latest updates can be retrieved from
%   http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
% where you can also make suggestions and rate matlab2tikz.
% 
% 
% 

\begin{tikzpicture}

\begin{axis}[%
width=\figurewidth,
height=\figureheight,
scale only axis,
xmin=0,
xmax=15,
xlabel={Number of iterations},
ymin=0,
ymax=16000000000000,
name=plot1,
after end axis/.append code={\coordinate (a) at (axis description cs:1,0);}]

\addplot [
thick,
color=red,
dash pattern=on 1pt off 3pt on 3pt off 3pt,
forget plot
]
table[row sep=crcr]{
1 15841000000000\\
(...)
15 25160000000\\
};
\addplot [
thick,
color=black,
dashed,
forget plot
]
table[row sep=crcr]{
1 15841000000000\\
(...)
15 52501000000\\
};
\addplot [
thick,
color=blue,
dotted,
forget plot
]
table[row sep=crcr]{
1 15841000000000\\
(...)
15 5324200000\\
};
\addplot [
thick,
color=green,
solid,
forget plot
]
table[row sep=crcr]{
1 15841000000000\\
(...)
15 551920000\\
};
\addplot [
thick,
color=green,
solid,
forget plot
]
table[row sep=crcr]{
3 0\\
3 16000000000000\\
};

\addplot [
thick,
color=blue,
dotted,
forget plot
]
table[row sep=crcr]{
4 0\\
4 16000000000000\\
};
\addplot [
thick,
color=black,
dashed,
forget plot
]
table[row sep=crcr]{
5 0\\
5 16000000000000\\
};
\addplot [
thick,
color=red,
dash pattern=on 1pt off 3pt on 3pt off 3pt,
forget plot
]
table[row sep=crcr]{
8 0\\
8 16000000000000\\
};
\end{axis}

\begin{scope}[xshift=5cm]
\begin{axis}[%
width=0.35\figurewidth,
height=\figureheight,
scale only axis,
xmin=995,
xmax=1000,
xtick={997,998,999,1000},
xticklabels={$997$,$998$,$999$,$1000$},
ymin=0,
ymax=8000000000,
at=(plot1.right of south east),
anchor=left of south west,
yticklabel pos=right,
axis x discontinuity=crunch,
after end axis/.append code={\coordinate (b) at (axis description cs:0,1);}
]
\addplot [
thick,
color=red,
dash pattern=on 1pt off 3pt on 3pt off 3pt
]
table[row sep=crcr]{
995 6093100000\\
996 6093100000\\
997 6093100000\\
998 6093100000\\
999 6093100000\\
1000 6093100000\\
};

\addplot [
thick,
color=black,
dashed
]
table[row sep=crcr]{
995 1577100000\\
996 1598000000\\
997 1598500000\\
998 1628600000\\
999 1631000000\\
1000 1595900000\\
};

\addplot [
thick,
color=blue,
dotted
]
table[row sep=crcr]{
995 2592000000\\
996 2591900000\\
997 2591700000\\
998 2591600000\\
999 2591500000\\
1000 2591400000\\
};

\addplot [
thick,
color=green,
solid
]
table[row sep=crcr]{
995 391810000\\
996 391810000\\
997 391810000\\
998 391810000\\
999 391810000\\
1000 391810000\\
};

\end{axis}
\draw[gray] (a) -- (b) node[pos=0.5,sloped,fill=white] {$\times$2000};
\end{scope}

\end{tikzpicture}%

Best Answer

Please consider giving compilable examples, as you can see below it doesn't take more than 10 lines but makes the question much more simpler to answer.

You can leave coordinates using the axis coordinates for later use.

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}

\begin{document}
\begin{tikzpicture}
    \begin{axis}[width=3cm,height=5cm,after end axis/.append code={\coordinate (a) at (axis description cs:1,0);}]
    \end{axis}
    \begin{scope}[xshift=4cm]
        \begin{axis}[after end axis/.append code={\coordinate (b) at (axis description cs:0,1);}]
        \end{axis}
        \draw[gray] (a) -- (b) node[pos=0.5,sloped,fill=white] {$x=2000$};
    \end{scope}
\end{tikzpicture}
\end{document}

enter image description here