huayc09 / SeuratExtend

https://huayc09.github.io/SeuratExtend/
GNU General Public License v3.0
101 stars 8 forks source link

Adding a title to FeaturePlot3() #18

Closed BenDo85 closed 3 weeks ago

BenDo85 commented 3 weeks ago

Hi, I'm trying to add a title to FeaturePlot3() but it seems I'm not able to do it

Here's some example code of what I'm trying to do: FeaturePlot3(pbmc, "Car4", "Clic5", "Jup") + ggtitle("My title")

Also, thanks for this awesome package!

huayc09 commented 3 weeks ago

Thanks for using SeuratExtend! Since the plot is created using ggarrange to combine the main plot with the legend, regular ggtitle() won't work directly. However, you can add a title using annotate_figure() from the ggpubr package after creating the plot:

p <- FeaturePlot3(pbmc, "CD3D", "CD68", "CD79A")
annotate_figure(p, top = text_grob("My title", face = "bold", size = 14))

You can customize the title appearance by modifying the text_grob() parameters:

Let me know if you need help with any other customizations!

BenDo85 commented 3 weeks ago

Works like a charm!

Thank you very much for your time and your quick reply!