apenwarr-redo/Documentation/cookbook/latex/mpg.R
Avery Pennarun 2e84c1bc02 Docs/cookbook: add an R + latex example.
This shows how to dynamically generate a plot in R+ggplot2, then embed
it into a latex document, and compile it to pdf, all with proper
autodependencies.
2018-11-28 17:33:03 -05:00

4 lines
133 B
R

library(ggplot2)
qplot(mpg, wt, data = mtcars) + facet_wrap(~cyl) + theme_bw()
ggsave("mpg.new.eps", width=4, height=2, units='in')