ggplot2/R output pdf too large

廉价感情. 提交于 2019-12-12 10:34:44

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/9572518/ggplot2-r-output-pdf-too-large

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!