I would like to add some arrows between plot directly on R like in this picture, arrows between plots:
So far I have only the plots with the code below, but I cannot figure out how to add the arrows
# devtools::install_github("franciscorichter/dmea")
library(dmea)
s = sim_phyl()
par(mfrow=(c(1,2))) # 1 row but 2 plot panels
color = 'darkgreen'
plot(s$newick,direction = 'upwards',show.tip.label=FALSE,edge.width=5,edge.color = color,type="fan", no.margin = TRUE)
dropex <- drop.fossil(s$newick)
plot(dropex,direction = 'upwards',show.tip.label=FALSE,edge.width=5,edge.color = color,type="fan", no.margin = TRUE)
Here's one way to do it with 3 columns using par(mfrow=))
.If you'd like to have more control over the columns width, consider using layout
instead of par(mfrow=))
.
par(mfrow=(c(1,3))) # 1 row but 3 plot panels
plot(1:10, yaxt="n",ylab="")
plot(1:10,type="n", yaxt="n",xaxt="n",xlab="", ylab="", bty="n")
arrows(x0=10, y0=7, x1 = 1, y1 = 7)
arrows(x0=1, y0=3, x1 = 10, y1 = 3)
plot(10:1, yaxt="n",ylab="")