1

So I want to build a correlation plot for an N*N matrix. But, the difference is that I want the upper-triangular and the lower-triangular to have different colors. Because the upper-triangular matrix will represent Z-squared values and the lower-triangular, D prime. Of course, the diagonal should be white to denote the equalities.

How can this be done with R? I checked corrplot and other alternatives in Google but I can't figure it out. Can this be done?

An example matrix for Z-scores could be a matrix like so:

    SNP1 SNP2 SNP3 SNP4 ... 
SNP1 1 0.0007 0.05 0.004 ...
SNP2 0.003 1 0.00001 0.02 0.000003 ...

Same applies to D-prime matrixes. I just want to plot them with different colors in the same correlation matrix.

Karolis Koncevičius
  • 9,417
  • 9
  • 56
  • 89
Pavlos Panteliadis
  • 1,495
  • 1
  • 15
  • 25
  • To be honest, I don't know the anwer to your question but maybe you will find something useful in `corrplot.mixed()` documentation? – kaksat Jan 09 '17 at 22:41
  • You say that the upper and lower triangles will represent different values. What values? From two different correlation matrices? Please be more explicit about what you want to plot. In addition, providing some sample data with the desired outcome would be the best. Please see [This post](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – G5W Jan 09 '17 at 22:48
  • @kaksat thank you for your quick response. the problem is the double legend that i'm after because the 2 values that I want to plot are. `corrplot` does not offer that. – Pavlos Panteliadis Jan 09 '17 at 22:48
  • @G5W I've updated the question. please check it again. – Pavlos Panteliadis Jan 09 '17 at 22:56
  • you can define the upper and lower separately, example here http://stackoverflow.com/questions/40352503/change-text-color-in-corrplot-mixed – user20650 Jan 09 '17 at 22:58
  • 1
    @user20650 I will look in to that! thanks! – Pavlos Panteliadis Jan 10 '17 at 12:31

0 Answers0