# NOT RUN {
p1 <- ggplot(mtcars, aes(mpg, disp)) +
geom_line(colour = "blue") +
theme_bw() +
theme(plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"))
p2 <- ggplot(mtcars, aes(mpg, drat)) +
geom_line(colour = "red") +
theme_bw() +
theme(plot.margin = grid::unit(c(.5, 1, .5, 0), "cm"))
ggdual_axis(lhs = p1, rhs = p2)
# }
Run the code above in your browser using DataLab