How to change the font style inside the HEATMAP boxes?

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"))

try something like

update_geom_defaults(geom = "text", aes(family = "Times New Roman", fontface = "bold", size = 12/.pt))

Note: I divide the size by .pt to make the size compatible with the units that theme uses.

1 Like

Yes, it worked.. Thank you so much