Emapplot function - change font size?
1
1
Entering edit mode
2.1 years ago
luca ▴ 60

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?

all the best Luca

enrichplot R plot function clusterprofiler • 2.9k views
1
Entering edit mode

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)).

0
Entering edit mode

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
Entering edit mode
2.1 years ago

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.

0
Entering edit mode

0
Entering edit mode

What version of enrichPlot are you using?

0
Entering edit mode

I currently have enrichplot_1.4.0

0
Entering edit mode

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

1
Entering edit mode

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