YuLab-SMU / enrichplot

Visualization of Functional Enrichment Result
https://yulab-smu.top/biomedical-knowledge-mining-book/
234 stars 65 forks source link

change edge color in cnetplot #278

Open gqhhh opened 4 months ago

gqhhh commented 4 months ago

Dear Yu group, I use cnetplot function and set the parameter 'colorEdge' as TRUE. But I would like to set my own colors of edge instead of the default color, how can I do that?

guidohooiveld commented 3 weeks ago

I realize that you have posted this a while ago,... Yet, for the archive:

With the current version of enrichplot you will need to use the argument color_edge, and provide the name (or hex code) of the color (default is: color_edge = "grey"). See ?cnetplot.

> library(clusterProfiler)
>  
> ## load example data
> data(geneList, package = "DOSE")
> de <- names(geneList)[1:100]
> 
> ## default analysis
> y1 <- enrichGO(de, 'org.Hs.eg.db',
+               ont = "CC",
+               pvalueCutoff = 0.05,
+               pAdjustMethod = "BH",
+               qvalueCutoff = 0.2)
> p1 <- cnetplot(y1, color_edge = "red", showCategory = 5)
> print(p1)
>

image