Guest User

Untitled

a guest
Dec 14th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. library(ggplot2)
  2. library(gtable)
  3. a = ggplot(data=diamonds, aes(x=price)) + geom_histogram()
  4. b = ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width)) + geom_point()
  5. agg = ggplot_gtable(ggplot_build(a))
  6. bgg = ggplot_gtable(ggplot_build(b))
  7.  
  8. g = gtable(width=unit(c(0.3, 0.5), "null"), height = unit(1, "null"))
  9. g = gtable_add_grob(g, agg, 1,1)
  10. g = gtable_add_grob(g, agg, 1,2)
  11.  
  12. plot(g)
Add Comment
Please, Sign In to add comment