taiyun / corrplot

A visual exploratory tool on correlation matrix
https://github.com/taiyun/corrplot
Other
316 stars 86 forks source link

How to reverse the order of the diverging color #242

Closed JennyWeng closed 2 years ago

JennyWeng commented 2 years ago

Hi, Thanks for the fantastic package. It's quite easy to use! Maybe a naive question, but can we reverse the order of the diverging color? For instance, for the "RdBu", to put red on value 1 and blue on value -1. Thank you very much!

Best, Jenny

taiyun commented 2 years ago

example

M = cor(mtcars)
corrplot(M, order = 'AOE', col = COL2('RdBu'))
corrplot(M, order = 'AOE', col = rev(COL2('RdBu')))