Is it possible to add a grouping label to a corrplot?

Viewed 104

Is it possible to add a label that applies to a few variables in a corrplot? This is an example of what I'm after. In that case it is the word "Petals" on the y-axis.

Below is the code to make the rest of the plot.

library(corrplot)

library(Hmisc)

iris_c <- iris[, c(1:4)]

test <- rcorr(as.matrix(iris_c))

corrplot(test$r, type="lower", order= "original", 
         p.mat = test$P, sig.level = 0.01, insig = "blank",
         col= colorRampPalette(c("blue","white", "red"))(100), tl.col = 'black', cl.ratio = 0.8, tl.srt = 45,  diag = FALSE, method = "square")
1 Answers

You can use title() to adjust axis labels, which is what you're looking for here. After running your code above, just run:

title(ylab = "Petals")

enter image description here

Related