Entering edit mode
6 months ago
Saran
▴
50
Hello,
I am using DimPlot()
from the Seurat package to make some final figures. I would like to label the clusters as found below in the UMAP legend.
The only way I am able to remotely get close to doing this is by using scale_color_hue()
and changing the legend labels as shown below but for some reason they are right aligned:
dp <- DimPlot(CD4T, label = F, pt.size = 0.6)
dp + scale_color_hue(labels = c(expression("T"[N]*"T"[CM]), expression("T"[EM]), expression("T"[EFF]*"/T"[EMRA]*".17"),
expression("T"[EFF]*"/T"[EMRA]*".1"), expression("T"[EFF]*"/T"[EMRA]*"(mixed)"),
expression("T"[RM]), expression("T"[FH]), expression("T"[reg]), expression("T"[FR]))) +
theme(axis.text.y=element_text(size=12,color='black', face = "bold"),
axis.text.x=element_text(size=12,color='black', face = "bold"),
legend.text=element_text(size=16,color='black', face = "bold"),
axis.title.y= element_text(size=16,color='black',face = "bold"),
axis.title.x= element_text(size=16,color='black',face = "bold"))
Is there any way to left align these labels in the legend?
Also, Is there anyway to add subscripts to the cluster labels in the Seurat MetaData?
Thanks,
Sara
Can you try adding this line to your code and playing with it?
guides(colour = guide_legend( label.position = "right",override.aes = list(size=3)))