How can I remove text labels from diagonal only on corrplot?
my_correlation_matrix1 <- read.table("path/to/matrix", header = T)
my_correlation_matrix2 <- read.table("path/to/matrix", header = T)
corrplot(my_correlation_matrix1,
method = "color",
type = "lower",
tl.col = "black",
tl.cex = 0.6,
tl.srt = 45)
corrplot(my_correlation_matrix2,
method = "color",
type = "lower",
tl.col = "black",
tl.cex = 0.6,
tl.srt = 45,
add = T)
Since I'm using add = T, the 2 corrplots are merged in one plot. But because they have values on the diagonal, they are overlapping. How can this be fixed?
What I'm trying to do, is merge 2-corrplots-in-1. Two different studies for the same set of values. Upper triangular is measurement A and lower is measurement B.
Not completely sure what you want to do but you could try modifying the values in the diagonal of your correlation matrix. Use
diagto access the diagonal:diag(my_matrix) <- <some_new_value>@ddiez I've updated the question. check it again.
Added an tentative answer. I assumed there is a typo in your code above and the second call to
corrplotsetstype = "upper". Is that correct?