Emapplot function - change font size?
1
1
Entering edit mode
3.5 years ago
luca ▴ 70

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 • 4.8k views
ADD COMMENT
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)).

ADD REPLY
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....

ADD REPLY
1
Entering edit mode
3.5 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.

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

What version of enrichPlot are you using?

ADD REPLY
0
Entering edit mode

I currently have enrichplot_1.4.0

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2942 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6