I made a plot using ggplot2
. From this plot, I want to highlight and zoom in on two different areas. To do this I used the ggforce
package and the facet_zoom( )
function. However, this function only creates one inset plot, and I can find no information on how to make a second one.
library(ggplot2)
library(ggforce)
ggplot(data = mtcars,
aes(x = mpg,
y = disp,
color = factor(cyl),
shape = factor(carb))) +
geom_point() +
facet_zoom(xlim = c(15, 20),
ylim = c(200, 300),
horizontal = FALSE)
In addition to the inset plot shown, I would like to add this one:
facet_zoom(xlim = c(30, 35),
ylim = c(0, 100),
horizontal = FALSE)
How can I put the second plot on the right side of the first?