Increasing cluster name size on a plot

Viewed 13

I did some data clustering according to seurat instruction, named the identified clusters and then wanted to draw a plot. The plot looks good but the names of the clusters are written with very small font. I'd like to increase the font of the names but I can only change the size of everything else but the names.

DimPlot(sunion.data, group.by = "seurat_clusters", label = T)

new.cluster.ids <- c("newname1", "newname2", "newname3", "andsoon")
names(new.cluster.ids) <- levels(sunion.data)
sunion.data<- RenameIdents(sunion.data, new.cluster.ids)

setwd("datapath.here")
pdf(paste("Name_of_the_File",format(Sys.time(), "%Y_%m_%d%H_%M"),".pdf",sep=""), width = 17, height = 10)
print(DimPlot(sunion.data, reduction = "umap", label = TRUE, pt.size = 0.5) + theme(text = element_text(face = "bold"),
        axis.text.x=element_text(angle=45, hjust=1, size=20),
        axis.title = element_text(size=20,face="bold"),
        axis.title.y.right = element_text(size = 20),
        legend.text=element_text(size=20),
        legend.title=element_text(size=30),
        axis.line = element_line(size=1)) + NoLegend(element_line(size=10)))
dev.off()

what do I need to write in the code to increase the font size of cluster names?

EDLIT: I got it working

```DimPlot(sunion.data, group.by = "seurat_clusters", label = T)

new.cluster.ids <- c("newname1", "newname2", "newname3", "andsoon")
names(new.cluster.ids) <- levels(sunion.data)
sunion.data<- RenameIdents(sunion.data, new.cluster.ids)

setwd("datapath.here")
pdf(paste("Name_of_the_File",format(Sys.time(), "%Y_%m_%d%H_%M"),".pdf",sep=""), width = 17, height = 10)
print(DimPlot(sunion.data, reduction = "umap", label = TRUE, label.size = 10, pt.size = 0.5) + theme(text = element_text(face = "bold"),
        axis.text.x=element_text(angle=45, hjust=1, size=20),
        axis.title = element_text(size=20,face="bold"),
        axis.title.y.right = element_text(size = 20),
        legend.text=element_text(size=20),
        legend.title=element_text(size=30),
        axis.line = element_line(size=1)) + NoLegend(element_line(size=10)))
dev.off()
0 Answers
Related