rggplot2data-visualizationggcorrplot

How do you add a subtitle to a ggcorrplot?


Is there a way to add subtitles to a ggcorrplot graph? I've read through the documentation and there is no subtitle feature built into the package.

library(ggcorrplot)
data(mtcars)
ggcorrplot(round(cor(mtcars), 1))

enter image description here


Solution

  • Since we deal with a ggplot object we can simply add them

    library(ggcorrplot)
    data(mtcars)
    ggcorrplot(round(cor(mtcars), 1)) + 
      labs(title = "My title",
           subtitle = "Here is a subtitle")
    

    enter image description here