r - How do you save a ggplot_table as a jpeg? -
following sandy muspratt's answer question: "inserting image ggplot outside chart area", how save output jpeg? helpful generating reports in r.
better create grobs, arrange them using arrangegrob
, use ggsave
:
library(png) library(grid) library(ggplot2) ## create image grob img <- readpng(system.file("img", "rlogo.png", package="png")) g <- rastergrob(img, interpolate=true) ## ggplot2 grob p = qplot(x=x,y=y,data= data.frame(x=1:10,y=1:10)) library(gridextra) ## arrange , save ggsave('test.png', arrangegrob(p,g))
Comments
Post a Comment