0

I am plotting several figures using grid plot like following.

p.list <- list()
for (i in 1:length(paths)){
  p <- plotQC(get(paste0("sce_",i)), type = "highest-expression")
  p.list[[i]] <- p
}
cowplot::plot_grid(plotlist = p.list)

How to add sub headers/titles on each plot. for example Sample#1, Sample#2 etc?

James Z
  • 12,209
  • 10
  • 24
  • 44
Angelo
  • 4,829
  • 7
  • 35
  • 56

1 Answers1

1

You may use labels and all the related parameters, such as hjust to shift the text as needed:

l <- list(qplot(1:10, 1:10) , qplot(1:10, (1:10)^2))
plot_grid(plotlist = l, labels = paste0("Sample #", 1:2), hjust = -1)

enter image description here

Julius Vainora
  • 47,421
  • 9
  • 90
  • 102