Last chance! 50% off unlimited learning
Sale ends in
ggsave(filename = default_name(plot), plot = last_plot(),
device = default_device(filename), path = NULL, scale = 1,
width = par("din")[1], height = par("din")[2], units = c("in", "cm",
"mm"), dpi = 300, limitsize = TRUE, ...)
TRUE
(the default), ggsave
will not
save images larger than 50x50 inches, to prevent the common error of
specifying dimensions in pixels.ggsave
currently recognises the extensions eps/ps, tex (pictex),
pdf, jpeg, tiff, png, bmp, svg and wmf (windows only).ratings <- qplot(rating, data=movies, geom="histogram")
qplot(length, data=movies, geom="histogram")
ggsave("length-hist.pdf")
ggsave("length-hist.png")
ggsave("ratings.pdf", ratings)
ggsave("ratings.pdf", ratings, width=4, height=4)
# make twice as big as on screen
ggsave("ratings.pdf", ratings, scale=2)
Run the code above in your browser using DataLab