Saving a large graphics file

Viewed 301

I'm trying to save a large heatmap that's roughly 20,000 x 20,000 tiles and 8.8 GB in size, and ggsave is taking a very long time to execute.

p <- large_plot %>%
  ggplot() +
  geom_tile(aes(x, variable, fill = value), color = "white") +
  theme(axis.text = element_blank(),
              axis.title = element_blank(),
              axis.ticks = element_blank(),
              legend.title = element_blank()) +
  scale_fill_distiller(palette = "YlOrRd") +
  xlab(NULL) +
  ylab(NULL)

ggsave("plot.png", plot = p, width = 8, height = 7, units = "in", dpi = 300)

My question is: what are some best programmatic practices to save very large graphics? Are there some packages that accomplish this better than others? Are there ways to reduce processing time without sacrificing image quality?

0 Answers
Related