library(gridGraphics)


cpfun <- function() {
    coplot(lat ~ long | depth, datasets::quakes, pch=16, cex=.5,
           given.values=rbind(c(0, 400), c(300, 700)))
}
pushViewport(viewport(y=0, height=.7, just="bottom"))
grid.echo(cpfun, newpage=FALSE, prefix="cp")
upViewport()
library(ggplot2)
pushViewport(viewport(y=1, height=.33, just="top"))
gg <- ggplot(datasets::quakes) + geom_histogram(aes(x=depth)) +
      theme(axis.title.x = element_blank())
print(gg, newpage=FALSE)
upViewport()


