long ggtitle in a DimPlot
1
1
Entering edit mode
6 months ago
Assa Yeroslaviz ★ 1.5k

I was wondering if it is possible to put a title to a DimPlot() which is splitted into two by group.by.

in my example I am using this command to plot my data

DimPlot(seu.Merged, reduction = "tsne", label = TRUE, group.by=c("orig.ident", "seurat_clusters")) + ggtitle('This is a very long title, which should nbe spread over both plots, grouped by Ident (l) and clusters (r)')

But the plot looks like that:

enter image description here

Is there a way to spread the title over both parts of the plot?

ggplot ggtitle dimplot • 987 views
ADD COMMENT
2
Entering edit mode
6 months ago
zx8754 10k

DimPlot is calling patchwork to bind two plots together, so it is better to use patchwork to add title, too, try below:

myPlot + plot_annotation(title = 'very very long title, very very long title')

See patchwork manuals for more info:

ADD COMMENT
0
Entering edit mode

thanks, that worked. I was thinking it calls only for ggplot2, good to know that it uses also patchwork. This calls for more visual possibilities

ADD REPLY

Login before adding your answer.

Traffic: 1958 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6