# Drawing lines automatically between two different plots

I try to create a special plot where several lines have to be generated automatically between two plots at very precise coordinate. My goal is to make something exactlly like

But I want to do it for different spectra. If you wonder what does represent this picture, I can tell you that this is about atomic laser spectroscopy (If you have questions I will be glad to give you some answers.)

So, this graph is divided in two parts: the part on the top of the picture is a plot showing several line crossing each other. At each crossing point, a dashed line is drawn towards the second part of the picture, depicting the spectrum. The part on the right has absolutely no importance.

In Mathematica, I can generate each part of the picture separately without problems. I also have the coordinates of every crossing points (one can easily find them by solving the equations of each straight line). I know that it is possible to align verticaly both plots by using GraphicsColumn and ImagePadding.

Now I am searching for the way to generate these dashed vertical lines, knowing the coordinates of each crossing points. Does someone have an idea ?

After that, I would like to automate the method for generating these lines by creating an appropriate function. I guess that the arguments of this function will be the number of crossing points and their coordinates.

Thanks a lot for your coming help

Mimmo

• Why not a single Plot using Epilog to draw the lines? – Dr. belisarius Jul 7 '15 at 21:56
• Each part is generated independently using two different routines that I have created. As in the picture, the final graphic has to show each part stil separated with their own axes ans label axes. The vertical dashed lines have to link both plots, from one crossing point to the corresponding peak in the spectrum. But certainly one will have to use the Epilog function. – Mimmo Jul 7 '15 at 22:03
• In this case, it would help you posted these routines with some sample data. – yohbs Jul 8 '15 at 8:55

As @belisarius suggests:

Plot[{15 - x, x, -7 + Sin[x]}, {x, 0, 10},
PlotRange -> {{-.5, 10}, Automatic},
AxesOrigin -> {0, 0},
TicksStyle -> {Automatic, White},
AxesStyle -> {Automatic, White},
ImageSize -> 700,
Epilog -> {Rotate[Text[Style[
"Velocity component \!$$\*SubscriptBox[\(v$$, $$z$$]\) of \ atoms", 18],
{-0.2, 7}], 90 Degree],
Arrow[{{0, 0}, {0, 16}}],
{Dashed, Line[{{7.5, -6}, {7.5, 7.5}}]}}
]

Alternatively:

myPlot = Plot[{Sin[x], Sin[2 x]}, {x, 0, 2 \[Pi]}, ImageSize -> 200,
Frame -> True, Background -> LightYellow, AspectRatio -> 1/7,