carlosdc
carlosdc

Reputation: 12142

ggplot2/R output pdf too large

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?

Upvotes: 10

Views: 3097

Answers (1)

joran
joran

Reputation: 173577

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.

Upvotes: 7

Related Questions