I'm having trouble changing the font style of correlation values inside the heatmap boxes to "Times New Roman"...Although I was able to change all the texts and numbers other than the correlation values inside the boxes in Times New Roman.. This is the code I'm using:
corrplot(cor(my.data))
cor = cor(my.data)
ggplot(cor)
my_plot<- ggcorrplot(cor, method = "square", type = "upper",
title = "Correlogram Cassia fistula",
legend.title = "Pearson Correlation",
lab = TRUE, lab_size = 3, lab_col = "black",
ggtheme = theme_minimal(),
outline.color = "white",
colors = c("#6D9EC1", "white", "#E46726")) +
theme(text = element_text(family = "Times New Roman"),
title = element_text(family = "Times New Roman"),
plot.title = element_text(family = "Times New Roman", face = "bold"),
axis.text = element_text(family = "Times New Roman"),
legend.text = element_text(family = "Times New Roman"))
To change the font style of the correlation values inside the heatmap boxes in ggcorrplot, you need to modify the lab_font argument, which controls the font appearance for labels inside the boxes. Update your ggcorrplot() call like this: lab_font = c("Times New Roman", 3, "plain"), where the elements represent font family, size, and face respectively. Here's the fix:
my_plot <- ggcorrplot(cor, method = "square", type = "upper",
title = "Correlogram Cassia fistula",
legend.title = "Pearson Correlation",
lab = TRUE, lab_size = 3, lab_col = "black",
lab_font = c("Times New Roman", 3, "plain"),
ggtheme = theme_minimal(),
outline.color = "white",
colors = c("#6D9EC1", "white", "#E46726")) +
theme(text = element_text(family = "Times New Roman"),
title = element_text(family = "Times New Roman"),
plot.title = element_text(family = "Times New Roman", face = "bold"),
axis.text = element_text(family = "Times New Roman"),
legend.text = element_text(family = "Times New Roman"))
This ensures even the labels inside heatmap tiles use "Times New Roman".