I need to put two plots side by side. As such, not a hard exercise, except that:
- I want and need to use basic graphics
- the plots should be placed seamlessly next to each other.
Here is an example how I solve it
x2 <- seq(1.9, 7.3, length.out=10)
x1 <- seq(0.2, 5.8, length.out=10)
y1 <- rnorm(10)
par(mfrow=c(1,2))
par(mar=c(5,4,4,0))
plot(x1, y1, type="l", bty="n", xlim=range(x1), ylim=c(-2, 2))
par(mar=c(5,0,4,2))
plot(x2, y1, type="l", bty="n", xlim=rev(range(x2)), ylim=c(-2, 2), yaxt="n")
Here is the problem: I would like the two lines to touch or almost touch. If the axes are separated, that is OK; but the distance between these two plots should be minimal. Optimally, I will want to have fat red vertical line showing where the two parts of the plot meet.
None of the answers I have found so far allow me to do that.
Context: I am plotting a genomic rearrangement in which two distant parts of some chromosomes were fused together, one of them reversed (hence the different scaling).


