In the r
package corrplot
, you can mix the type of figure on the lower and upper half of a correlation matrix to make a nice visual. I would like to have numbers on the lower half of my matrix, and ellipses on the top half of the matrix - that is all fine. But, with my data I cannot see some of the correlation numbers since they are near 0. Below is the code I am using and current output.
Is there a way to change the text color for the lower half of the matrix? I'd like to change the colors of the correlation coefficients to not be white (they don't need to be red to blue, black would be ok).
#Saves the correlation matrix for reproducibility
#The matrix was modified based on the answer here: https://mcmap.net/q/1478933/-corrplot-label-printing
cormatx <- structure(c(1, 0.480473436029381, 0.727971392165508, 0.0755790813842022,
0.647226624978262, 0.706156814758194, 0.73971915882987, 0.073024457099958,
0.480473436029381, 1, 0.540515552878261, 0.106196818240067, 0.505171500429873,
0.480694458288349, 0.538693541543583, 0.158300667842954, 0.727971392165508,
0.540515552878261, 1, 0.111168537597397, 0.587432598932939, 0.673406541830384,
0.724533755640279, 0.139232852746538, 0.0755790813842022, 0.106196818240067,
0.111168537597397, 1, -0.0844917222701804, 0.0382605955575862,
-0.00462812019681349, 0.000406894700952559, 0.647226624978262,
0.505171500429873, 0.587432598932939, -0.0844917222701804, 1,
0.668544141384562, 0.761303240927891, 0.152127182963817, 0.706156814758194,
0.480694458288349, 0.673406541830384, 0.0382605955575862, 0.668544141384562,
1, 0.772678948045676, 0.119611111043454, 0.73971915882987, 0.538693541543583,
0.724533755640279, -0.00462812019681349, 0.761303240927891, 0.772678948045676,
1, 0.174453831824302, 0.073024457099958, 0.158300667842954, 0.139232852746538,
0.000406894700952559, 0.152127182963817, 0.119611111043454, 0.174453831824302,
1), .Dim = c(8L, 8L), .Dimnames = list(c("A. SAT Critical Reading",
"B. SAT Mathematics", "C. SAT Writing Multiple Choice", "D. SAT Essay",
"E. TOEFL Listening Comprehension", "F. TOEFL Structure and Written Expression",
"G. TOEFL Reading Comprehension", "H. TOEFL Test of Written English"
), c("A", "B", "C", "D", "E", "F", "G", "H")))
#Creates the corrplot
corrplot.mixed(cormatx, upper = "ellipse", lower = "number",
tl.pos = "lt", tl.col = "black", tl.offset=1, tl.srt = 0)