I am trying to knit an Rmarkdown document which contains a rather large ggplot, that I have created using cowplot
This is how one might create such a plot:
library(DOSE)
library(cowplot)
library(enrichplot)
data(geneList)
de <- names(geneList)[abs(geneList) > 2]
edo <- enrichDGN(de)
p1 <- dotplot(edo, showCategory=30) + ggtitle("dotplot for ORA")
p2 <- dotplot(edo, showCategory=30) + ggtitle("dotplot for ORA")
p3 <- dotplot(edo, showCategory=30) + ggtitle("dotplot for ORA")
plot_grid(p1,p2,p3, ncol=3)
I have added the following parameters in the header of the code chunk of my markdown document:
{test echo=F, fig.height=8, fig.width=20, fig.show="hold", fig.align="center"}
When I run the code chunk in Rstudio, the resulting image is clear and perfectly readable.
However, when I try to knit it to an html file, it comes out very blurred and barely readable..
Are there any parameters that I should use that I am missing? Increasing dpi
did not help.
It would also be fine, if the image is wider than the text of the markdown document if that increases quality.
Any help is much appreciated!
Cheers!