Description
Dear Yu,
I am sorry to bother you in your busy schedule.
Here's my question:
I use dotplot to plot the result of enrichGO with command:
dotplot(ego_mf, showCategory=25,font.size=15)
but in the MF text list on the left, there is a result that is so long that it affects the layout of the entire graph.
example:
neutrophil activation
RNA splicing, via transesterification reactions
RNA splicing, via transesterification reactions with bulged adenosine as nucleophile
mRNA splicing, via spliceosome
nuclear transport
The third line is too long, squeezing the chart on the right. So I want to divide it into two lines. But I did not find the relevant parameters in dotplot. I remember that you mentioned this problem in biobabble. But I did not find it. Could you please give me some advice about it.
Have a nice day!
Activity
jllavin77 commentedon Aug 8, 2019
Dear Yu,
I'm facing the same problem. I tried to export to this case the solution given for barplots,
dotplot(egoBP,font.size=12) + scale_x_discrete(labels=function(egoBP) str_wrap(egoBP, width=10))
but it doesn't work for dotplot.
Have you provided a solution to this issue, because it severely affects the usability of dotplots for publication purposes when labels are too long...
Thanks in advance
jllavin77 commentedon Sep 3, 2019
Dear Yu,
Any insight or example on how to do this?
Thanks
PSSUN commentedon Sep 4, 2019
Hi,
I am sure I have find out the way to solve this.
please check this link: link.
Whether your native language is Chinese or not, I believe you can read it because the code and images are displayed in the text.
Have a nice day!
jllavin77 commentedon Sep 11, 2019
PSSUN solution only works for barplots and was already included in my first comment as "not working for dotplots".
GuangchuangYu commentedon Sep 12, 2019
use
scale_y_
for dotplot.jllavin77 commentedon Sep 12, 2019
Dear GuangchuangYu,
Thank you for the insight, now it works like charm.
Best
JL
tilofrei commentedon Jul 14, 2020
Thanks, very helpful comments here. For completeness I'll add the code for
dotplot()
here:If you curate custom gene lists be aware that for text wrapping to be possible you need spaces in your term titles: