Created
July 10, 2017 23:45
-
-
Save JZL/b1faa2b427b9cdd9c6c875904e08dd69 to your computer and use it in GitHub Desktop.
makeMultiColorMatrixPlot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
list = {{100.01219,69.11319,44.51419,93.21519,63.61619,27.21719,50.61819,50.11919},{69.1122,100.0132,63.1142,63.7152,90.2162,38.5172,62.5182,62.8192},{44.81221,63.51321,100.01421,51.31521,72.71621,49.51721,50.61821,42.81921},{93.41222,63.91322,51.31422,100.01522,70.41622,29.01722,53.91822,47.91922},{63.91223,90.71323,72.81423,70.51523,100.01623,40.91723,66.71823,59.21923},{35.41224,50.21324,65.31424,37.91524,53.71624,100.01724,37.01824,32.61924},{57.61225,70.31325,55.61425,61.11525,74.81625,48.51725,100.01825,83.51925},{56.41226,69.81326,46.31426,53.91526,65.81626,41.51726,83.51826,100.01926}} | |
*) | |
list = {{100.01173,87.01273,74.01373,70.01473,25.01573,22.01673,24.01773},{87.01174,100.01274,68.01374,73.01474,38.01574,24.01674,26.01774},{74.01175,68.01275,100.01375,93.01475,34.01575,20.01675,32.01775},{70.01176,73.01276,93.01376,100.01476,38.01576,22.01676,33.01776},{25.01177,38.01277,34.01377,38.01477,100.01577,22.01677,31.01777},{22.01178,24.01278,20.01378,22.01478,22.01578,100.01678,43.01778},{24.01179,26.01279,32.01379,33.01479,31.01579,43.01679,100.01779}} | |
With[{max = Max@list}, | |
MatrixPlot[#, | |
BaseStyle->{FontColor->Red, FontSize->16}, | |
ColorFunction -> (If[First[First[Position[list,#1]]]<=4 && First[Position[list,#1]][[2]]<=4||First[First[Position[list,#1]]]>4 && First[Position[list,#1]][[2]]>4, Blend[{ColorNegate[Black], ColorNegate[Green]}, #/max], | |
Blend[{ColorNegate[Black], ColorNegate[Red]}, #/max]] &), | |
ColorFunctionScaling -> False, | |
FrameTicks -> { | |
{{{1,"Ciona_v1"},{2, "Ciona_v2"},{3, "Corella_i8"},{4, "Corella_i14"},{5, "E.huxleyi"},{6, "A.protothecoides"},{7, "C.subellipsoidea"}}, None}, {None, {{1,"Ciona_v1"},{2, "Ciona_v2"},{3, "Corella_i8"},{4, "Corella_i14"},{5, "E.huxleyi"},{6, "A.proto"},{7, "C.subell"}}} | |
}] | |
] &@list | |
(* | |
FrameTicks -> { | |
{{{1, "Corella_i11"},{2, "Corella_i14"},{3, "Corella_i5"},{4, "Corella_i6"},{5, "Corella_i8"},{6, "Corella_i1"},{7, "Ciona_v1"},{8, "Ciona_v2"}}, None}, {None, {{1, "Corella_i11"},{2, "Corella_i14"},{3, "Corella_i5"},{4, "Corella_i6"},{5, "Corella_i8"},{6, "Corella_i1"},{7, "Ciona_v1"},{8, "Ciona_v2"}}} | |
*) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment