This question already has an answer here:
- Saving grid.arrange() plot to file 5 answers
I have quite a specific problem with producing 300ppi plots in tiff format for publication. I have found ggsave to work beautifully with a single plot, which can then be exported to GIMP to compress the resulting large tiff file. However, it seems to run into trouble when plotting two figures next to each other, e.g.
plot1<-ggplot(.........)
plot2<-ggplot(.........)
grid.arrange(plot1, plot2, ncol=2)
ggsave(filename = "Figure 1.tiff", scale = 1, width = 10, height = 5,
units = "cm", dpi = 300)
This results in only plot2 appearing in the resulting tiff file, with plot 1 nowhere to be seen.
I will also have a figure which does not use ggplot, but consists of three plots produced with barplot2 and matplot, but presumably this faces a similar problem. Essentially, could anyone suggest a way of translating what appears in the plot appearing in the plot window (I use RStudio) to a high-resolution tiff file with as little fuss as possible?