I've created a complex multi-facet figure using ggplot
. When I save it using the basic ggsave
command:
ggsave("myplot.pdf", plot = my.plot)
The margins of the figure facets and of the labels get changed.
What it looks like in the Rstudio plot preview:
Rstudio preview:
The PDF created by ggsave
with altered margin thickness:
ggsave export:
Using the following commands:
pdf("myplot.pdf")
print(my.plot)
dev.off()
Or using the Rstudio pdf export function or cowplot
save_plot()
is even worse, as now the label font size also gets changed:
pdf() export:
Is there a more reliable tool to create PDFs? I'd like it to look the same as in Rstudio. Apologies for not posting the entire code as the source dataframe is very complicated, I'll try to create a reproducible example in the meantime.