Skip to content

Instantly share code, notes, and snippets.

@bchartoff
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bchartoff/9301317 to your computer and use it in GitHub Desktop.
Save bchartoff/9301317 to your computer and use it in GitHub Desktop.
from rpy2 import robjects
r = robjects.r
r.library("ggplot2")
robjects.r("p = ggplot(aes(price, carat), data=diamonds) + geom_point() + facet_grid(clarity ~ color, scales = 'free')")
r.ggsave('faceted_plot.jpeg')
robjects.r('print(p)')
r['dev.off']()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment