Closed DanielReedOcean closed 6 years ago
Could you try the following, please? Replace this line:
plot_grid(g,g)
with these three lines:
grDevices::pdf(NULL)
plot_grid(g,g)
grDevices::dev.off()
and see if this prevents the problem. If it does, we may be able to put this workaround into the plot_grid()
function.
When I do that there are no plots at all. Instead, I get the following:
null device
1
That's good news, because I gave you the wrong code. This should work then.
grDevices::pdf(NULL)
g2 <- plot_grid(g,g)
grDevices::dev.off()
g2
Boom! No blank plot.
Yeah, I think I always need to open a null pdf device when converting plots, not just when one is already open. The problem is I vaguely remember that somebody objected to that. I think in some cases the pdf device is not available. I may just make this change and see if somebody complains.
Okay, thanks for getting this figured out so quickly.
I committed a fix that should resolve the issue for you and will hopefully not introduce other pains. Can you install the github version of cowplot and see if things work now?
It looks great! Thanks.
Closing this. It seems to work now.
When using
cowplot
with RNotebook an additional blank plot is created before the requested plot. For example,