This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Emapplot function - change font size?

Hi guys, I have been plotting some results from my RNA seq experiment. I am using a nice function from the package enrichplot (explained in detail in the clusterprofiler vignette) which is called emapplot (link: http://yulab-smu.top/clusterProfiler-book/chapter12.html#enrichment-map). Does anyone know how to change the font size in the plot?

Thanks in advance for your help

all the best Luca

enrichplot r plot function clusterprofiler

I believe that it returns a ggplot2 object. If so, assuming your plot it stored in variable p, you can increase the font-size of all text with p <- p + theme(text=element_text(size=12)).

Hi rpolicastro! Thanks for the quick reply. it is actually a "ggraph, gg, ggplot object". I tried your command but it doesn't work because it only changes the font size of the legend, without changing the font size of the categories that are plot....

1 answer

Looking at their code on github, the ellipses in the emapplot function appears to pass through to an internal function that takes care of the plotting here. The documentation is kind of sparse for that internal function, but the argument cex_label_category might control the node label sizes. Try adding cex_label_category=2 to your plotting function to see if it works.

I had already tried that but it does not work...

What version of enrichPlot are you using?

I currently have enrichplot_1.4.0

The latest version appears to be 1.10.0, so try updating the package and trying again.

I did update the library and your previous suggestion (change cex_label_category) did work! Thanks a lot rpolicastro! :D

Log in to answer this question.