if(interactive()){
require(ggplot2)
p <- ggplot(mtcars, aes(mpg, disp, color = factor(cyl))) + geom_point()
tofigure(p,filename = file.path(tempdir(), "mtcars.pdf"))
pp <- infigure(filename = file.path(tempdir(), "mtcars.pdf"), exclude_col="white")
pp
}
Run the code above in your browser using DataLab