This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Treeplot

Dear All,

I have used treeplot to visualize my enrichment term and wanted to removed the label I circled in the box. Any member is able to assist me.

The tree plot documentation was not clear to me and I could not make it to work.

Here is my code chunk.

library(enrichplot)

edox2 <- pairwise_termsim(ego3)

treeplot(edox2, hclust_method = "average", label_format = 30)

enter image description here

Thank for your help in advance.

Kind Regards,

synat

clusterprofiler

1 answer

Try setting the nWords = 0. That function is calling ggtree under the hood. The ggtree function geom_cladelab will add those labels you're mentioning.

You could recreate that figure in ggtree manually if you wanted.

Hi Mark,

it works. sorry to bother with another one. Can I remove the line in the circle and move the number of genes and p.adjust closter so it saves sapce.

I will read the documentation of the treeplot in more details too. thank for your helps.

Regards,

synat

enter image description here

Hey synat,

The documentation isn't great for that function so don't beat yourself up. I had to dig into the source code for it to figure out what might disable the cladelabs.

With regards to your new problem, look into ggtree options as the function should allow the same options as ggtree. Try this:

treeplot(edox2, hclust_method = "average", label_format = 30) + 
theme(legend.position="bottom")

At this point I suggest either recreating the plot in ggtree from scratch or editing the image manually in a pdf editor.

Dear Mark,

thank you so much for your patience and kind help. so much appreciated. I will try today again. Good weekend to you.

Regards, synat

Log in to answer this question.