Closed imilenkovic closed 2 years ago
This was the code:
corrplot(cor(merged2), # Correlation matrix method = "shade", # Correlation plot method type = "full", # Correlation plot style (also "upper" and "lower") diag = TRUE, # If TRUE (default), adds the diagonal tl.col = "black", # Labels color bg = "white", # Background color title = "", # Main title
is.corr = FALSE,
COL1(sequential = c("YlOrBr"))) # Color palette
You can set col.lim
.
Examples: https://taiyun.github.io/corrplot/
Hello,
When I set col.lim, the colour distribution stays the same.
corrplot(cor(merged2), # Correlation matrix
method = "shade", # Correlation plot method
type = "full", # Correlation plot style (also "upper" and "lower")
diag = TRUE, # If TRUE (default), adds the diagonal
tl.col = "black", # Labels color
bg = "white", # Background color
title = "", # Main title
col.lim = c(-0.15,1),
is.corr = FALSE,
COL1(sequential = c("YlOrBr"))) # Color palette
When changing is.corr to TRUE, it's still the same:
corrplot(cor(merged2), # Correlation matrix
method = "shade", # Correlation plot method
type = "full", # Correlation plot style (also "upper" and "lower")
diag = TRUE, # If TRUE (default), adds the diagonal
tl.col = "black", # Labels color
bg = "white", # Background color
title = "", # Main title
col.lim = c(-0.15,1),
is.corr = TRUE,
COL1(sequential = c("YlOrBr"))) # Color palette
I assume that I would have to use diverging colours here, but the same colour palette doesn't exist with diverging colours. I already made many other plots with this colour scheme so I would prefer to stick to the same colours if at all possible. Thanks!
Please update the new version v0.93 from Github. And set ignoreSign = TRUE
.
Hello,
I updated the package and ran the following:
corrplot(cor(merged2), # Correlation matrix
ignoreSign = TRUE,
method = "shade", # Correlation plot method
type = "full", # Correlation plot style (also "upper" and "lower")
diag = TRUE, # If TRUE (default), adds the diagonal
tl.col = "black", # Labels color
bg = "white", # Background color
title = "", # Main title
col.lim = c(-0.2,1),
is.corr = FALSE,
COL1(sequential = c("YlOrBr")))
and got the following warning
Warning message: In corrplot(cor(merged2), ignoreSign = TRUE, method = "shade", type = "full", : col.lim interval not suitable to the matrix
The plot now looks like this:
So all good, thanks a lot!
Please update the new version v0.93 from Github. And set
ignoreSign = TRUE
.
ignoreSign = TRUE
is very easy to misunderstood.
I rename it, please set transKeepSign = FALSE
after updating. Like:
merged2 = matrix(runif(100,-0.18,0.99),10,10)
corrplot(merged2, # Correlation matrix
method = "color", # Correlation plot method
type = "full", # Correlation plot style (also "upper" and "lower")
diag = TRUE, # If TRUE (default), adds the diagonal
tl.col = "black", # Labels color
bg = "white", # Background color
title = "", # Main title
col.lim = c(-0.2,1),
cl.length = 13,
is.corr = FALSE,
transKeepSign = FALSE,
COL1(sequential = c("YlOrBr"))) # Color palette
Hello,
I was wondering if it would be possible to specify the range in which a color gradient will be applied? For example:
in this plot the range is from 1 to -1, but I would like to only have it eg. from 1 to -0.15, so that the values around 0 are bright yellow and values around 1 are brown?
Thank you.