How to draw the lines connecting the subplots

I would like to draw the lines on top of a large composite plot constructed from several subplots using layout.

Specifically, I would like to draw the lines in the gap between the two plots to indicate that one of the subplots is a zoom-in of the second one.
My problem is identical to the one discussed in this post. However, the solution suggested their (just add a subplot in between with the lines) does not work good in may case: I need to arrange the plots horizontally and the lines should intersect the axis label of one of the subplots.

Is there a possibility to do that?
As an alternative I thought I could create a separate figure with the lines and overlay it on top of my original figure, but is it again possible?

1 Like

I could only find this:

help?> lens!
search: lens! scalefontsize scalefontsizes leading_ones leading_zeros LinearIndices

  lens!([plot,] x, y, inset = (sp_index, bbox(x1, x2, y1, y2)))

  Magnify a region of a plot given by x and y. sp_index is the index of the subplot and x1, x2, y1 and y2 should be between 0 and 1.

I don’t know if it’s possible to somehow make the “inset” appear as a second subplot though…

Another option in Plots.jl is to use insets.

For example:

1 Like