Closed fungs closed 6 years ago
I finally had a chance to look at this. That it worked in the past was an accident, because you're misusing the save_plot()
API. You should specify base_width
and base_height
instead of width
and height
, and then it works as expected:
save_plot("out.pdf", p, base_width=297, base_height=210, units="mm")
Also, the benefit of save_plot()
is the width and height calculations if you're making larger plot grids. If you're simply specifying width and height in absolute values then there's no benefit to using save_plot()
over ggsave()
.
Leaving this issue open for now because I want to ponder a bit longer whether this should be fixed. In any case, things currently work as expected.
Thanks, I will try this next time I use cowplot. I don't remember exactly why I used save_plot over ggsave, but there was a specific reason.
Usage of width
or height
now creates a meaningful error.
Great!
In cowplot 0.9.2 and earlier, if I use the save_plot function and pass it a width and hight argument, it does not work due to ambiguity.
Error message:
Instead, calling ggsave works.