I'm generating a 32x32 (tiles, each tile less than a quarter inch x a quater inch size) heatmap in ggplot2 in my MacBook Pro, this is relatively simple stuff. However, the pdf output for this is huge (something like 7MB) and when I load it in pdflatex, loading and changing pages in the document becomes very slow. What are my options? Is there a better way to save a PDF in R that plays nicely with ggplot2 and pdflatex?
A common source of PDFs that are way too big is specifying dimensions when saving, thinking you're working in pixels, when in fact the default is in inches.
Try changing either the units (in ggsave
) or the sizes in pdf
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With