How to Change Font Size of the Correlation Coefficient in Corrplot

How to change font size of the correlation coefficient in corrplot?

It is far from the answer, it is kind of a dirty hack, but this works (thanks user20650 for the idea):

cex.before <- par("cex")
par(cex = 0.7)
corrplot(cor(envV), p.mat = cor1[[1]], insig = "blank", method = "color",
addCoef.col="grey",
order = "AOE", tl.cex = 1/par("cex"),
cl.cex = 1/par("cex"), addCoefasPercent = TRUE)
par(cex = cex.before)

Change the font size in a seaborn corrplot

Regrettably I don't think that's configurable, but what I would recommend is just to make the figure larger e.g.

f, ax = plt.subplots(figsize=(10, 10))
sns.corrplot(df, ax=ax)

If that's not an option and you're primarily interested in the heatmap (not the numerical values), you could do

sns.corrplot(df, annot=False, sig_stars=False, diag_names=False)

How do I change the color, font type and size of a corrplot?

You can use tl.col to change the color, tl.cex to change the size and tl.srt to change the rotation degree. Here is an example:

corrplot(cor(iris[,-5]), tl.col="black", tl.cex=0.8, tl.srt=70)

corrplot

How can I change the font size of the labels in corrplot's lengend, in R?

Following on @ulfelder's answer, the parameters for controlling the scale are given by cl.x, rather than tl.x.

cl.cex = 2 does exactly what is needed.

R Corrplot square (tile) size

You should tune the width, height and res parameters of your graphic output file.

See an example below.

set.seed(1)
X = matrix(runif(1000),ncol=10)
library(corrplot)
png(file="corr.png", res=300, width=4500, height=4500)
corrplot(as.matrix(cor(X)), tl.cex = 3, tl.col = "black", method = "color",
outline = T, order="hclust",
addCoef.col = "black", number.digits = 2, number.cex = 3,
cl.pos = 'b', cl.cex = 3, addrect = 3, rect.lwd = 3,
col = colorRampPalette(c("midnightblue", "white","darkred"))(100))
dev.off()

Sample Image



Related Topics



Leave a reply



Submit