👩🏻💻 Emi Tanaka @ Monash University
28th November 2022 Australasian Applied Statistics Conference 2022
Both figures used the same code below to produce the figure:
ggplot(cars, aes(speed, dist)) + geom_point()
but I saved one to a png file and the other as a svg file.
jpg
(or jpeg
) uses a lossy data compression that results in some loss of information but usually a small file size.png
uses a lossless data compression and works well if the image has uniform colors.svg
, pdf
and eps
. E.g. svg and its source.ggplot2
, use ggsave()
.plotly
translates ggplot
objects into plotly
interactive graphics.ggplot2
is best for static 2D plotsFor continued learning
Learn with others!
>
Download the zip file here
>
Open the docs/index.html
in a browser