3. Beautify your `plotReducedDim` Legends

Do you think that long ENSEMBL GENE ID in your legend is annoying? Move it out of the way!
You can use theme() to modify many things in ggplots such as the legends.

For example try this:

plotReducedDim(object = sce, dimred="umap", colour_by=gene_id) + labs(title = gene_name) + theme(legend.title = element_blank(), legend.position="top")
  1. Add the gene name as the title of the plot: + labs(title = gene_name)
    [see 1. Gene ID <---> Gene SYMBOL & 2. Add gene SYMBOL to your plots for instructions]

  2. Remove the looooooooong ENSMEBL ID as the legend title:
    + theme(legend.title = element_blank())

  3. Move the legend to the top under the new gene_name title:
    + theme(legend.position="top")

1 Like