Seurat: How can I change the size of gene names displayed on DoHeatmap?

Created on 25 Apr 2019  路  5Comments  路  Source: satijalab/seurat

Hi, I am using v3 and would like to shrink the gene name labels on a heatmap. (In v2 I used cex.row = , but that does not work with v3)
Thanks in advance for any tips!

Most helpful comment

Good news- Was able to fix it, had to use theme(axis.text.y = ...)
thanks again for your help!

DoHeatmap(object = immune.small, features = top20$gene, assay = "integrated") + theme(axis.text.y = element_text(size = 5))

All 5 comments

Hi, you can change the text size using the theme function in ggplot2:

DoHeatmap(object = pbmc_small, features = VariableFeatures(pbmc_small)) + 
    theme(text = element_text(size = 20))

Hi Tim, Thanks so much for your suggestion. Unfortunately, that only seems to change the size of the Legend text, not of the gene names.

I can't reproduce that, here's the output of my example without changing element_text:

no_change

And setting element_text(size = 20):

size_20

Hi Tim,
This is what happens when I try that- it only changes legend size.
I really appreciate your help, and any further suggestions

DoHeatmap(object = immune.small, features = top20$gene, assay = "integrated") + theme(text = element_text(size = 4))

size4.pdf

Good news- Was able to fix it, had to use theme(axis.text.y = ...)
thanks again for your help!

DoHeatmap(object = immune.small, features = top20$gene, assay = "integrated") + theme(axis.text.y = element_text(size = 5))

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GHAStVHenry picture GHAStVHenry  路  3Comments

Biogitte picture Biogitte  路  3Comments

igordot picture igordot  路  3Comments

whitleyo picture whitleyo  路  3Comments

sarahwajid picture sarahwajid  路  3Comments