我使用plot_ly
在R中制作了两张热图,但即使设置相同的zmin
和zmax
,也无法一致地绘制色标。都。这似乎应该相对简单,但却无法传递zcenter
或zmid
或类似内容,也无法指定breaks
来使它们保持一致。我错过了什么或者不能在R中完成吗?
我的plot_ly代码如下,带有结果图,正如您所看到的,即使两个图中的zmin = -10000
和zmax = 10000
,0对应于第一张图片的白色,但对应于第二张图片为粉红色我不能为我的生活弄清楚为什么它不一致。
第一张图片:
plot_ly(z = data.matrix(tines.pre1[,-1]), type = "heatmap", transpose = TRUE, zauto = FALSE, zmin = -10000, zmax = 10000, colors = c("blue", "white", "red"))
第二张图片:
plot_ly(z = data.matrix(tines.pre2[,-1]), type = "heatmap", transpose = TRUE, zauto = FALSE, zmin = -10000, zmax = 10000, colors = c("blue", "white", "red"))
这是产生第二张图片的数据:
`pre2 = matrix(c(1,1147,-118,124,937,591,168,19,63,-47,626,680,1309,529,1386,53,60,77,-358,103,651,4054,679,620,484,0,311,1985,-244,-16,416,159,1562,145,181,666,1225,936,2968,324,676,196,597,412,609,1159,-187,439,-193,657,995,2178,637,-534,14,100,279,438,-39,390,348,916,100,-171,91,-35,19,270,1220,2205,933,170,181,91,258,-201,1258,250,1730,472,389,346,
2,675,-29,29,404,119,-3,63,4,-593,-201,175,40,438,844,92,-19,187,75,481,4,1617,246,1248,203,-163,344,1720,-319,79,234,-702,491,-43,-135,491,394,627,2062,748,375,-194,1060,-387,695,-244,201,-42,-64,231,655,1438,128,-533,93,-88,114,253,204,80,317,-211,181,-82,-140,-107,8,39,477,950,752,340,-412,-684,578,218,675,-86,390,152,-74,73,
3,755,37,-332,83,50,-165,67,46,-252,3,-185,464,251,577,-181,-211,-198,-261,-129,51,1056,586,169,-19,-61,429,1219,-415,67,46,-171,245,112,-91,860,-356,164,1829,286,286,-513,-73,220,34,-475,-143,-483,-334,-3,-251,2195,-279,-120,6,130,143,84,-118,148,32,-292,-250,-294,-87,-282,-131,-416,138,282,363,-20,-1060,-173,53,305,566,-157,-302,-6,-375,283,
4,404,-71,-119,-124,166,-111,164,-20,-556,-471,84,-144,11,-23,-162,-304,74,-27,835,-333,58,292,472,-111,163,192,624,-221,22,237,-513,-44,-10,-204,856,235,65,625,61,-68,7,415,138,-868,152,-65,63,115,36,-275,1,280,-531,330,-68,-75,217,-88,-77,-234,-143,96,-354,-80,-48,37,-355,577,-273,-320,48,-410,15,-65,-433,-1094,89,241,-129,63,898,
5,22,494,53,337,111,313,213,-185,68,108,58,-134,16,66,-75,74,131,-67,-753,-125,66,202,-175,-344,-9,-142,260,-169,-145,-227,-431,97,-302,-120,-152,638,-24,-209,151,96,-71,148,257,-368,61,-53,463,106,-19,63,-840,-554,-537,-95,-113,26,-17,84,-24,-192,363,-130,22,75,101,-131,217,126,-39,-127,-223,56,212,95,373,-1195,-124,11,-151,221,-24,
6,-476,-45,146,206,-162,-227,-143,290,234,399,-503,1088,116,-110,-104,-105,-81,-61,-200,145,-15,-474,171,-9,-276,1,-434,96,61,-125,368,30,86,25,-772,-60,-56,-381,-226,6,-55,137,129,715,-70,347,-187,-519,-5,231,-932,-31,-137,-599,108,-23,0,61,154,-9,-439,-501,382,42,-65,10,507,-460,-122,279,-42,-466,299,-145,172,564,-216,152,74,-57,24,
7,-499,-64,123,-346,34,186,-40,45,-104,-499,15,-342,127,-89,140,284,-77,107,-278,-5,-28,8,12,3,74,308,-422,-160,-84,-301,790,-514,81,107,-94,-632,-245,-25,1,101,134,-328,-399,563,169,-83,-394,157,105,95,442,16,571,379,56,3,-196,35,57,337,-11,506,11,-173,15,54,-130,-248,9,2,-104,382,-178,-245,-81,553,125,-119,217,-249,-645,
8,549,-315,-202,-73,-149,-161,-194,-129,358,463,346,-469,-271,155,200,50,-47,48,396,319,-81,-28,-481,461,48,-359,-28,454,146,416,-213,431,145,192,162,-181,260,-10,13,-134,-15,-373,-124,-41,-312,-146,55,142,-117,-114,1329,289,633,-16,17,70,-4,-91,-110,98,231,29,-60,135,-2,30,-240,5,425,166,321,439,-348,360,-30,1172,126,-285,-11,21,-253,
9,611,292,45,230,-25,100,-127,56,-159,310,754,312,250,-471,96,-131,72,176,288,-231,639,269,-544,343,368,139,-166,456,-162,201,-409,126,234,260,766,-499,-422,151,-85,128,263,-5,-168,-613,-1108,-262,-3,-143,92,-26,520,-184,54,296,210,-103,-9,-90,-20,-256,241,563,50,141,290,69,-502,155,1264,272,259,-138,-371,672,-247,1007,-159,112,154,76,-163,
10,348,76,-430,280,212,90,-163,-77,-171,552,626,431,-65,233,-159,-163,180,-171,40,-256,999,460,-597,-145,395,113,94,-28,218,-75,-763,-182,80,-74,-151,-54,-264,205,-666,302,379,-347,-258,-879,-958,-167,-420,-459,285,130,1053,-149,91,173,264,4,-89,-230,161,-106,-48,175,-444,-95,-74,-25,-485,532,1861,-313,-229,-371,39,649,-279,-4,-345,97,-67,182,165,
11,179,366,-14,-524,-105,-97,-92,-253,-494,-219,2111,-591,-136,442,-290,-120,342,-104,-61,-200,438,3444,3183,4069,-279,-3,-507,-857,24,-18,-403,101,1202,1057,1499,-477,246,-213,-1216,554,40,-539,-94,-1891,-428,-622,208,-405,-701,1204,1040,-186,-8,8,137,19,-53,-53,-50,-225,-417,-241,-538,-1,-509,-89,-575,374,2212,2121,3563,140,2590,2329,-15,-124,420,-184,-162,-145,314,
12,1936,554,229,761,610,385,-105,-388,-740,-1035,2246,-2387,-590,878,178,166,628,75,880,-80,4286,2960,2797,4244,260,-207,-222,-701,207,265,371,126,2343,1477,3083,1253,353,1025,-2578,35,-501,-1762,-938,-3281,-3286,389,-34,-954,-311,866,-1411,-981,-674,-209,25,-62,-163,-84,-121,466,-1638,-1446,-816,87,-132,-63,535,-397,1847,1154,3508,-2404,1547,2961,2245,-781,3338,119,-1200,166,1029,
13,660,308,-135,67,181,129,-244,-432,-1101,-2582,1695,-4415,-441,105,-584,200,892,-199,-293,-603,4282,1630,1662,2808,160,-173,-818,-620,2,-340,9,-628,1560,1296,3646,1124,269,462,-2778,-132,-638,-3190,-1672,-4430,-6093,215,-287,-1563,-816,1289,-1208,-1055,-825,-266,107,-156,-480,16,-122,-198,-2583,-1281,-1284,23,9,86,237,-1227,1050,642,2920,-3288,372,3702,2900,-572,3574,-255,-2288,485,1133,
14,-227,345,-809,-795,-29,-93,-654,-408,-1151,-2619,518,-2625,-1027,299,-403,394,1295,416,612,-823,1951,82,2367,1430,-277,-600,-1150,-564,-80,-242,332,-3011,1155,249,2914,-938,-352,-2181,-2821,-45,-189,-3795,-1274,-4192,-5830,3,-577,-1817,-1148,1096,-2127,-1683,-444,88,-6,-258,-800,-291,-110,-516,-2953,-1624,-1237,-98,-676,-158,-63,-2060,-859,-13,863,-3650,-258,2361,2272,829,4159,-1616,-2631,540,402,
15,-1917,46,-27,-740,-436,28,-356,-733,-1042,-2476,577,-4315,-884,-35,-730,296,1056,-62,387,-1499,1275,-36,2520,168,-387,-24,-700,163,137,-338,817,-2314,600,595,2024,-442,-311,-1911,-2899,-95,-297,-3679,-1776,-4095,-5756,-358,-641,-2599,-1783,120,-1573,-1647,68,313,-59,-235,-376,2,-29,-95,-2170,-1327,-1187,-114,-203,-96,-6,-1902,-1371,-215,-150,-4831,-296,1706,2555,310,4994,-1379,-2581,190,-199,
16,-2953,-180,-504,-1380,-440,-111,-980,-644,-1079,-2445,518,-3652,-949,-405,-645,17,420,-273,26,-1022,430,-331,2185,171,-481,-208,-1013,-387,-59,100,372,-2644,401,250,1776,-1096,-373,-1789,-1651,-158,-451,-3265,-1457,-3886,-5053,-760,-676,-2179,-1512,1522,-2024,-1462,-558,520,222,-161,-690,-203,45,-746,-1354,-1138,-1334,-151,-527,-167,-12,-1970,-1296,281,88,-3943,-233,1651,1343,545,3569,-2148,-1949,-682,-577,
17,-2226,149,0,-2010,-380,91,-950,-163,-999,-2978,-449,-3630,-1050,-205,-741,-131,712,-138,-102,-1505,-513,-620,3642,399,-342,-7,-953,485,-32,-386,445,-2635,205,511,972,-1116,-540,-3017,-3614,-235,-325,-3273,-1758,-4311,-5930,-379,-485,-2472,-1419,986,-2593,-1583,-1047,194,-37,-165,-772,-213,398,-498,-2002,-876,-985,-156,-691,-197,616,-2550,-1637,-360,-572,-4339,-1174,1059,1625,3473,5172,-1634,-2004,-685,-286,
18,-3373,16,-113,-638,-389,-73,-450,-265,-799,-2237,319,-3083,-840,-98,-731,-325,469,-615,-324,-1323,-965,-747,3102,-252,-478,8,-982,-404,-233,-512,-181,-2683,22,333,1656,-1340,651,-2538,-3222,873,-569,-3039,-1221,-4301,-4715,-162,-938,-1931,-1542,1651,-1637,-1235,142,602,-56,-315,-457,-236,91,-507,-857,-625,-1247,-329,-767,-121,1538,-2130,-205,132,-255,-4083,-1338,1677,422,4085,2748,-2523,-1949,-948,-706,
19,-1826,377,-152,-873,-79,118,-653,-283,-946,-1780,-83,-3504,-637,-113,-568,-61,381,-106,-850,-1298,333,-173,3623,-109,-776,-398,-1199,-587,148,-365,-760,-2660,260,316,1294,-1209,1379,-2138,-2566,1207,-442,-4097,-1596,-4826,-4702,-192,-295,-2410,-1193,1495,-1561,-1173,-403,653,22,-192,-451,-174,-116,-460,-585,-899,-1169,-59,-28,-115,1347,-325,794,48,225,-3962,-915,1681,-56,8588,1604,-1517,-1954,-938,-254,
20,-1394,-90,311,-673,-406,73,-265,263,-573,-1246,169,-1609,-597,-132,-323,-360,521,-215,-725,-836,518,-93,1969,17,-586,-656,-1123,-184,48,-293,-241,-1772,122,180,1386,-1112,244,-2057,-2364,377,-96,-3112,-1013,-3781,-4494,-546,-632,-2067,-1266,763,-1527,-752,-605,217,61,-126,-345,-423,53,-526,-1173,-700,-1020,7,-426,-36,768,-1535,438,-150,-449,-3168,-1260,149,-626,9486,1809,-651,-1486,-394,-182,
21,-1357,-262,-313,-929,-92,-427,-659,27,-435,-1487,-62,-1073,-440,-425,-415,-301,-111,-251,-476,-1046,-638,-791,3023,135,-293,108,-1239,-598,-46,-542,-180,-1635,142,-86,1141,-1429,456,-2925,-2284,298,-612,-2566,-643,-2982,-3858,-720,-505,-2357,-859,531,-2229,-1346,-571,671,60,-169,-592,-339,-89,-706,-1698,-308,-787,-81,-364,-82,281,-1269,-422,54,-448,-2937,-1124,565,-557,6805,941,-1114,-1106,-256,-362,
22,-1502,71,65,-665,-59,-106,-195,88,-378,-390,589,-1532,-466,-114,-382,-296,237,-76,-696,-1075,326,-16,1958,224,-645,-180,-849,-878,463,-276,7,-1391,-366,-77,463,-995,-398,-2494,-2242,166,-281,-2633,-704,-3056,-2990,-559,-795,-1813,-694,1022,-1275,-179,-852,672,282,-73,-527,-96,-117,-645,-1240,-373,-918,25,-309,40,208,-408,1206,-205,252,-1636,-1088,-167,-300,6556,862,-1204,-652,49,1,
23,-577,53,-35,419,510,337,-222,13,-307,1008,1069,-888,-207,40,-315,-252,9,-147,-244,475,2813,592,1997,-220,4,-2,-663,-505,167,205,244,1654,14,25,1153,101,-1240,-48,-928,-789,-670,-1847,-541,-2432,-2836,-572,-241,-1246,-258,632,-1500,-583,-826,168,-28,128,25,155,54,18,-1524,-318,-783,21,-214,28,-425,-8,1330,-243,50,-871,-941,-157,-65,5100,612,-804,-1277,-22,494,
24,-331,-142,288,594,614,172,-73,193,-68,834,1973,962,-265,118,-414,110,313,-315,-263,353,3681,1137,1954,536,210,701,-260,-446,181,888,-52,2210,-92,157,1187,1343,-276,1014,-1392,-385,-932,-1129,-1179,-2754,-5413,-466,-681,-760,-578,539,-1566,-286,-624,351,93,98,238,413,313,-57,-1463,-117,-901,151,-99,73,-678,746,2414,-460,582,-696,-973,502,585,4413,497,-313,-1113,68,227,
25,671,84,-163,-138,402,-258,11,31,162,-157,1058,-1094,-551,281,-321,-412,284,-135,-757,160,3704,558,1834,233,-397,-287,210,-157,396,528,355,639,-47,421,1447,202,288,-358,-1752,720,-156,-2196,-208,-2977,-3354,-59,31,-669,-326,549,-1519,-119,-339,382,199,138,-397,120,-283,-236,-964,-737,-736,227,-344,46,84,763,2602,-175,737,-2308,-1337,535,161,2811,577,-578,-1537,189,1461,
26,-104,193,224,-482,-82,-153,-107,-189,774,489,1344,-700,-397,-137,-201,-145,362,-234,-245,-605,1920,263,1589,35,-209,-269,-295,-482,425,-209,-142,-1408,280,158,1245,-833,423,-2082,-1192,81,-1023,-732,93,-3472,-3669,-620,-212,-969,-1019,1877,-2094,-209,-622,179,24,152,-401,151,12,-673,-1148,-630,-710,189,-251,8,-708,-144,1557,65,1396,-889,-678,928,-163,2800,-126,-617,-1649,455,1086,
27,-425,-61,305,-651,181,76,-510,500,-247,-204,339,-2765,113,464,-331,18,397,-83,-584,-749,1781,84,1044,36,-383,84,-290,-483,-216,-185,-267,-893,42,-197,678,-691,-92,-1894,-2548,-165,-382,-1438,-538,-2698,-2273,-370,-72,-1014,-971,986,-2537,-641,-672,163,43,145,-423,-41,-265,-649,-1091,-628,-436,99,-505,69,-456,225,658,-358,729,-965,-796,229,151,1102,371,-286,-1445,-96,386,
28,-673,33,379,126,382,-157,-536,256,345,88,1133,-3531,-505,-25,89,-55,264,-210,209,-88,2127,388,1761,52,-87,682,376,-675,122,212,-108,884,-244,-94,489,-80,-264,-644,-947,-601,-256,-355,27,-2128,-2968,-818,-134,-419,-886,1660,-2462,-998,-801,501,277,75,-190,172,70,-71,-1539,71,-696,225,56,-54,-1027,-782,657,191,526,-1593,-1664,-467,170,2301,576,-1016,-1256,203,107,
29,-465,-211,546,-112,151,-300,-205,65,51,-134,1162,-4626,-148,-385,159,-117,348,-80,-304,-484,1840,62,2013,397,-382,336,252,-781,146,176,190,246,-68,-267,510,-496,18,-1016,-2068,-85,218,-617,141,-1217,-4180,-678,-802,-310,-864,623,-995,-545,-261,576,97,111,-479,230,231,-188,-722,-335,-589,91,84,27,-509,-474,405,328,1605,-2054,-524,912,45,973,357,-903,-612,-450,-76,
30,-561,-60,280,-491,3,89,38,62,309,-768,97,-4672,-467,-268,-376,-236,52,-540,-265,-439,-116,-430,1215,-526,-433,293,-466,-869,-235,-219,817,-1201,252,0,368,-911,-858,-2266,-1136,20,57,-1037,492,-571,-3634,-718,-317,-847,-1189,623,-1605,-1003,-149,583,139,73,-887,-43,-176,-498,-962,-154,-622,69,-364,2,19,-949,-307,-57,755,-1727,-1361,51,-570,311,57,-1025,-859,-454,-196,
31,-1549,-481,-53,-1093,-99,-558,-605,45,206,-1407,-788,-3913,-336,-598,-231,-319,160,-207,-768,-1334,-786,-393,1069,-62,-443,-40,-167,-131,147,-779,139,-2066,-358,-293,16,-1245,-396,-2894,-1736,217,-479,-1275,-470,-1198,-3343,-725,-30,-555,-384,209,-2546,-794,-432,101,81,-227,-748,-156,-110,-550,-271,-497,-771,100,-417,-31,-486,-1307,82,-497,-128,-2734,-1067,-50,-349,-900,256,-1039,-699,-31,-228,
32,-1752,-55,202,-433,-261,197,-391,123,-77,-511,610,-3780,-693,-187,-330,-56,2,-274,-434,-932,-1406,-431,738,-93,-153,-196,-161,-390,128,-722,-70,-1480,217,-256,436,-1611,-583,-2934,-1723,-163,-515,-1496,-69,-1176,-3596,-835,-623,-567,-659,487,-1172,-747,-282,81,308,1,-1007,-86,7,-935,-694,-358,-807,-56,-232,71,-1139,-585,-620,-30,-126,-1956,-900,538,-418,-223,-238,-1163,-1558,-211,-125,
33,-608,-257,-15,-545,145,-210,-433,28,-531,-1038,302,-2823,-239,-817,-648,-239,52,-97,-442,-1171,-608,-525,518,-442,-135,-30,-94,-446,-107,-515,-238,-2492,297,-190,304,-1665,-238,-3438,-1834,-387,-685,-1742,225,-1542,-3106,-682,-6,-338,-873,521,-1935,-847,-465,325,350,-124,-948,-156,97,-776,13,-1029,-772,26,-612,-46,-1193,37,169,-574,-181,-2080,-738,3,-382,-623,171,-156,-1128,63,282,
34,-1122,-143,330,-917,8,-224,-367,-82,-97,-1166,115,-2922,-290,79,-511,-334,312,-261,-365,-742,-152,-350,851,-119,-508,24,-117,-644,-229,-291,-482,-1400,-179,-73,550,-1804,93,-2935,-1918,-409,-271,-1741,-691,-2003,-2679,-783,-652,-457,-402,-254,-1168,-457,-275,581,94,49,-805,-318,-17,-173,-422,-969,-846,-52,-192,13,-1079,526,294,-305,108,-1951,-978,515,-543,-47,-617,-440,-1568,614,-219,
35,-302,-72,-50,-650,-175,-334,-420,201,276,-1420,-216,-1944,-180,-26,-375,-232,269,-278,-450,-649,-127,-325,-73,-522,-35,-280,70,-337,99,-307,177,-1853,-227,-202,100,-1162,-316,-2876,-2067,-226,-329,-1054,-556,-1873,-2374,-933,-650,-106,-618,335,-1867,-994,-646,40,151,-60,-969,-164,-311,-732,-727,-1101,-962,87,-278,29,-1515,219,1108,-406,-48,-1619,-1136,-33,-119,-140,422,-467,-1508,-167,-232,
36,-1336,216,380,-332,-88,280,-141,201,-119,-1002,227,-2501,-398,119,-401,-271,93,-330,59,-832,321,-501,55,-131,-575,-356,-430,-479,-135,-368,189,-1667,-99,-203,-237,-1037,69,-2814,-2726,-65,-742,-1712,-292,-1577,-2132,-453,-787,-499,-1224,-63,-2595,-827,-352,412,233,-56,-794,-69,86,-67,-315,-453,-790,-17,185,-56,-523,541,2077,75,194,-1193,-949,-171,-437,-773,-39,-378,-1353,-113,-423,
37,-659,-320,480,-113,113,220,-111,82,-85,-1778,24,-2801,-843,-5,-475,-239,349,-339,-136,-826,-212,-513,234,-383,-572,-282,-510,-638,-342,-992,429,-1586,-106,-381,152,-1628,-396,-2731,-1741,-454,-358,-1863,-144,-2296,-2470,-1156,-713,-367,-952,122,-2133,-677,-419,136,365,-61,-668,-188,-181,-348,-402,-558,-886,-142,-136,-101,-752,417,443,-546,87,-2084,-763,-241,-526,-773,-99,-544,-1357,91,-840,
38,-1148,265,369,-603,-42,-322,-237,-95,-130,-1132,362,-3040,-419,131,-284,-35,-25,-319,-580,-477,496,33,214,-310,-854,210,-602,-1323,404,-362,548,-515,-301,9,563,-1226,-503,-2420,-1748,-240,237,-2316,-479,-1431,-2945,-925,-137,-587,-1297,-18,-1200,-524,-373,209,150,-5,-571,-112,-87,-522,113,-321,-658,71,-139,-52,-816,708,1611,-174,592,-1630,-468,82,-168,-870,-500,40,-1597,-455,-568,
39,-894,-30,184,365,76,-350,-223,57,-171,-1467,74,-2895,-495,547,27,-113,313,-61,-210,-275,1181,-168,-99,-320,-860,-76,-833,-682,137,153,591,-1050,-158,-198,-146,-1282,-316,-2041,-1778,-558,115,-1621,-528,-2550,-3261,-849,-151,-782,-538,-335,-2105,-389,-645,331,199,-85,-699,22,-164,-405,-904,-852,-846,102,-44,-74,-712,166,1429,-138,-38,-1172,-445,128,-123,-900,-332,-990,-831,-625,-171,
40,-335,96,607,-266,129,-156,-252,51,117,-686,322,-2119,-744,48,-286,-112,318,-316,-213,-488,865,-234,55,-652,-285,-201,-619,-851,-251,-714,139,-316,-128,208,114,-1130,-168,-2519,-1899,-496,91,-2345,121,-3221,-3852,-887,-62,-501,-1145,322,-1928,87,-687,439,98,-30,-933,16,-276,-864,-661,-1182,-868,-28,-360,63,-764,-172,578,-621,-32,-1627,-210,-32,-472,-614,-251,-845,-1660,-36,-492,
41,-831,-286,-117,-959,29,-121,-348,33,-62,-1493,-623,-3302,-645,-543,-537,-361,99,-508,-692,-551,-419,-359,205,-742,-578,-245,-1013,-377,-154,-268,-127,-1776,-83,-384,-488,-1748,-402,-3403,-1272,-147,-549,-2054,290,-1854,-4360,-661,-496,-825,-426,-330,-2148,-256,-264,171,235,-148,-912,-104,-290,-772,-534,-1133,-1005,-51,-419,-57,-768,258,426,-696,-314,-1253,-1365,82,-496,-567,-366,-1467,-2006,-187,-217,
42,-973,-247,514,-1759,37,96,-342,-67,-108,-305,52,-2409,37,-265,-161,-197,359,-478,309,-936,-1103,-576,-50,-427,-124,112,-561,-937,-246,-484,434,-2110,21,-354,-319,-1819,-919,-4065,-1824,-338,-323,-1820,-170,-2161,-3255,-699,-633,-1399,-555,487,-1836,-320,-210,254,314,-158,-751,-188,-73,-893,-568,-1156,-778,-275,-371,88,-1065,-657,297,-713,-149,-1235,-707,381,-347,1373,-199,-756,-1913,-364,-366,
43,-1287,88,252,-1293,-67,-58,-467,-45,-204,-1513,-147,-1983,-657,307,-514,-213,124,-449,-75,-475,-576,-247,373,-244,-531,50,-1236,-784,-533,-590,33,-1516,-235,-99,-1246,-1760,-630,-4413,-1671,-738,423,-2520,-657,-1147,-2512,-349,5,-1053,-396,435,-2007,-537,-457,-29,110,-243,-1185,-177,-110,-742,-418,-984,-751,34,-60,-77,-473,-126,177,-494,165,-2500,-1038,-240,-671,-2,-347,152,-1068,-861,-786,
44,-771,-19,282,-95,413,33,-229,-72,-156,-1913,568,-4400,-324,-295,-1,-281,-16,-439,-258,481,1000,795,524,739,147,-26,-831,-668,88,681,731,588,-124,-50,-276,-320,-1352,-2067,-1313,-720,667,-2432,-202,-751,-4170,-667,-521,-497,-899,105,-1447,348,-399,523,93,-31,-604,32,-32,-91,-2084,-566,-572,76,-71,86,-596,-33,305,-275,892,-1436,-670,-266,-7,35,-347,-1270,-930,-260,-72,
45,420,-67,349,-208,457,-219,-462,-217,-244,-1606,604,-4546,-173,158,-422,-286,69,-507,-55,-548,1320,121,-112,-117,-205,-209,-642,-442,-178,248,468,-1156,-42,-74,445,-1266,-470,-2517,-1889,-719,406,-2263,-499,-2107,-4183,-911,-155,-761,-635,-710,-338,467,-267,545,524,-139,-951,-6,-257,-649,-1420,-785,-826,157,-266,93,-32,-566,1417,-225,757,-1475,30,628,114,2923,-269,-1384,-1106,-100,-5,
46,767,180,154,-230,-79,-104,-452,177,-113,-1687,226,-3346,-744,65,-358,-351,285,-235,-352,-724,148,-91,502,886,65,-46,-640,-1135,-190,-259,-48,-1146,-371,178,918,-921,-956,-2915,-1740,-605,350,-2206,-894,-1669,-3593,-927,-454,-1491,-975,-873,-636,-315,-143,-309,694,-108,-761,55,-313,-575,-1663,-956,-772,-68,-152,-6,271,-258,735,-502,630,-2084,-786,351,-403,2302,-532,-698,-1374,-253,-46,
47,677,-110,398,-67,184,-226,-352,568,152,-1523,793,-1189,-253,-382,-257,-188,49,-304,-485,-481,-35,-114,289,283,-611,245,-658,-884,-270,-499,-235,-1573,-386,-474,-321,-1134,-496,-3565,-2112,-139,180,-2657,-320,-1773,-4464,-862,-615,-1241,-745,-386,-1297,-942,-170,570,484,-50,-1031,-16,-77,-913,-1620,-1347,-788,13,-73,131,-324,-123,747,-257,233,-1811,390,-237,-408,1029,-207,-1195,-1526,162,501,
48,102,-276,87,-1100,111,-180,-377,-34,-433,-1783,240,-593,-530,-101,-148,-389,140,-286,-283,-769,-773,-43,192,92,-681,-118,-1109,-1058,-289,-144,238,-1913,-342,-349,72,-1700,-637,-4081,-1794,-321,-560,-2649,-1348,-2463,-4972,-788,143,-1682,-1046,-611,-1630,-388,-738,-163,293,-104,-850,89,-265,-1041,-2024,-1047,-755,-29,-371,-20,-357,-494,411,-106,-346,-1444,740,-10,-398,925,-819,-799,-1656,-537,892,
49,-228,-308,278,-74,531,170,-347,92,-192,-1777,189,-1761,-374,-220,72,-162,57,-123,220,-1006,-647,280,322,-427,89,262,-1240,-889,-359,-461,909,-941,204,105,77,-1127,-1486,-3107,-1720,-517,-942,-2967,-262,-2675,-4985,-867,-720,-1396,-761,349,-2106,-189,-743,-106,366,-57,-896,-16,-197,-841,-1210,-1612,-1040,-39,-16,-2,-600,-716,1148,183,47,-1558,125,109,-117,-341,-522,-1147,-1281,-404,485,
50,-12,-106,375,225,267,1,-144,125,-334,-2355,235,-2114,132,-150,-338,77,321,-277,-704,-694,332,-353,-279,-169,-338,139,-691,-913,133,-543,680,-1845,-265,-258,188,-480,-528,-3396,-1818,-708,-460,-2849,149,-3162,-4316,-450,-146,-933,-987,126,-2213,-267,-591,68,192,-202,-915,67,-48,-432,-1664,-917,-1033,94,-72,-85,-355,5,788,-753,-11,-1692,-517,18,-353,-810,-176,-828,-1997,161,1207,
51,566,20,2,-275,-13,-116,-340,-59,-544,-1552,338,-974,-521,95,-202,-487,180,-352,-272,-485,-565,233,-497,-115,-307,-106,-1152,-1206,-371,-651,191,-1542,-119,-330,-79,-1041,-941,-3955,-1143,-884,-155,-2473,-477,-2941,-5215,-786,-327,-1491,-878,944,-2407,-663,-422,-102,169,-205,-937,-184,-94,-576,-1068,-1147,-878,1,92,35,-220,-471,-475,-395,-109,-2152,-790,310,-32,-20,-411,-1385,-1964,272,922,
52,67,-191,52,-1361,-161,-167,-560,286,-179,-2082,-101,-500,-367,148,-319,-194,-17,-478,-135,-689,-416,-87,-749,-262,-721,178,-1362,-993,-108,-635,-149,-1491,-121,-359,-563,-1092,-1100,-4242,-1596,-614,-264,-2575,-110,-4178,-4748,-732,-383,-1543,-1383,200,-2253,-443,-671,333,80,96,-868,-32,68,-597,-1466,-1723,-816,61,122,30,-773,-497,198,-753,326,-1632,-448,-313,-511,-314,-126,-1363,-2322,698,941), ncol = 82)`
和plot_ly
plot_ly(z = as.matrix(pre2[,-1]), type = "heatmap", transpose = TRUE, zauto = FALSE, zmin = -10000, zmax = 10000, colors = c("blue", "white", "red")
答案 0 :(得分:0)
此行为与数据的分布有关。 当我用-10000和10000交换数据集的最后两个值时,颜色会正确显示。 颜色插值似乎是一个问题,这是一个使用“样条曲线”和“线性”插值的示例:
编辑:添加了使用库(d3heatmap)(不再有效维护)和库(heatmaply)的替代解决方案
第二次编辑:最终找到了一个使用自定义色标的基于标准图的热解决方案(类型热图)(请参见图pCustom
和最后一个示例here)。关于到达那里的努力,我会给热图打个针。
library(plotly)
pre2 = matrix(c(1,1147,-118,124,937,591,168,19,63,-47,626,680,1309,529,1386,53,60,77,-358,103,651,4054,679,620,484,0,311,1985,-244,-16,416,159,1562,145,181,666,1225,936,2968,324,676,196,597,412,609,1159,-187,439,-193,657,995,2178,637,-534,14,100,279,438,-39,390,348,916,100,-171,91,-35,19,270,1220,2205,933,170,181,91,258,-201,1258,250,1730,472,389,346,
2,675,-29,29,404,119,-3,63,4,-593,-201,175,40,438,844,92,-19,187,75,481,4,1617,246,1248,203,-163,344,1720,-319,79,234,-702,491,-43,-135,491,394,627,2062,748,375,-194,1060,-387,695,-244,201,-42,-64,231,655,1438,128,-533,93,-88,114,253,204,80,317,-211,181,-82,-140,-107,8,39,477,950,752,340,-412,-684,578,218,675,-86,390,152,-74,73,
3,755,37,-332,83,50,-165,67,46,-252,3,-185,464,251,577,-181,-211,-198,-261,-129,51,1056,586,169,-19,-61,429,1219,-415,67,46,-171,245,112,-91,860,-356,164,1829,286,286,-513,-73,220,34,-475,-143,-483,-334,-3,-251,2195,-279,-120,6,130,143,84,-118,148,32,-292,-250,-294,-87,-282,-131,-416,138,282,363,-20,-1060,-173,53,305,566,-157,-302,-6,-375,283,
4,404,-71,-119,-124,166,-111,164,-20,-556,-471,84,-144,11,-23,-162,-304,74,-27,835,-333,58,292,472,-111,163,192,624,-221,22,237,-513,-44,-10,-204,856,235,65,625,61,-68,7,415,138,-868,152,-65,63,115,36,-275,1,280,-531,330,-68,-75,217,-88,-77,-234,-143,96,-354,-80,-48,37,-355,577,-273,-320,48,-410,15,-65,-433,-1094,89,241,-129,63,898,
5,22,494,53,337,111,313,213,-185,68,108,58,-134,16,66,-75,74,131,-67,-753,-125,66,202,-175,-344,-9,-142,260,-169,-145,-227,-431,97,-302,-120,-152,638,-24,-209,151,96,-71,148,257,-368,61,-53,463,106,-19,63,-840,-554,-537,-95,-113,26,-17,84,-24,-192,363,-130,22,75,101,-131,217,126,-39,-127,-223,56,212,95,373,-1195,-124,11,-151,221,-24,
6,-476,-45,146,206,-162,-227,-143,290,234,399,-503,1088,116,-110,-104,-105,-81,-61,-200,145,-15,-474,171,-9,-276,1,-434,96,61,-125,368,30,86,25,-772,-60,-56,-381,-226,6,-55,137,129,715,-70,347,-187,-519,-5,231,-932,-31,-137,-599,108,-23,0,61,154,-9,-439,-501,382,42,-65,10,507,-460,-122,279,-42,-466,299,-145,172,564,-216,152,74,-57,24,
7,-499,-64,123,-346,34,186,-40,45,-104,-499,15,-342,127,-89,140,284,-77,107,-278,-5,-28,8,12,3,74,308,-422,-160,-84,-301,790,-514,81,107,-94,-632,-245,-25,1,101,134,-328,-399,563,169,-83,-394,157,105,95,442,16,571,379,56,3,-196,35,57,337,-11,506,11,-173,15,54,-130,-248,9,2,-104,382,-178,-245,-81,553,125,-119,217,-249,-645,
8,549,-315,-202,-73,-149,-161,-194,-129,358,463,346,-469,-271,155,200,50,-47,48,396,319,-81,-28,-481,461,48,-359,-28,454,146,416,-213,431,145,192,162,-181,260,-10,13,-134,-15,-373,-124,-41,-312,-146,55,142,-117,-114,1329,289,633,-16,17,70,-4,-91,-110,98,231,29,-60,135,-2,30,-240,5,425,166,321,439,-348,360,-30,1172,126,-285,-11,21,-253,
9,611,292,45,230,-25,100,-127,56,-159,310,754,312,250,-471,96,-131,72,176,288,-231,639,269,-544,343,368,139,-166,456,-162,201,-409,126,234,260,766,-499,-422,151,-85,128,263,-5,-168,-613,-1108,-262,-3,-143,92,-26,520,-184,54,296,210,-103,-9,-90,-20,-256,241,563,50,141,290,69,-502,155,1264,272,259,-138,-371,672,-247,1007,-159,112,154,76,-163,
10,348,76,-430,280,212,90,-163,-77,-171,552,626,431,-65,233,-159,-163,180,-171,40,-256,999,460,-597,-145,395,113,94,-28,218,-75,-763,-182,80,-74,-151,-54,-264,205,-666,302,379,-347,-258,-879,-958,-167,-420,-459,285,130,1053,-149,91,173,264,4,-89,-230,161,-106,-48,175,-444,-95,-74,-25,-485,532,1861,-313,-229,-371,39,649,-279,-4,-345,97,-67,182,165,
11,179,366,-14,-524,-105,-97,-92,-253,-494,-219,2111,-591,-136,442,-290,-120,342,-104,-61,-200,438,3444,3183,4069,-279,-3,-507,-857,24,-18,-403,101,1202,1057,1499,-477,246,-213,-1216,554,40,-539,-94,-1891,-428,-622,208,-405,-701,1204,1040,-186,-8,8,137,19,-53,-53,-50,-225,-417,-241,-538,-1,-509,-89,-575,374,2212,2121,3563,140,2590,2329,-15,-124,420,-184,-162,-145,314,
12,1936,554,229,761,610,385,-105,-388,-740,-1035,2246,-2387,-590,878,178,166,628,75,880,-80,4286,2960,2797,4244,260,-207,-222,-701,207,265,371,126,2343,1477,3083,1253,353,1025,-2578,35,-501,-1762,-938,-3281,-3286,389,-34,-954,-311,866,-1411,-981,-674,-209,25,-62,-163,-84,-121,466,-1638,-1446,-816,87,-132,-63,535,-397,1847,1154,3508,-2404,1547,2961,2245,-781,3338,119,-1200,166,1029,
13,660,308,-135,67,181,129,-244,-432,-1101,-2582,1695,-4415,-441,105,-584,200,892,-199,-293,-603,4282,1630,1662,2808,160,-173,-818,-620,2,-340,9,-628,1560,1296,3646,1124,269,462,-2778,-132,-638,-3190,-1672,-4430,-6093,215,-287,-1563,-816,1289,-1208,-1055,-825,-266,107,-156,-480,16,-122,-198,-2583,-1281,-1284,23,9,86,237,-1227,1050,642,2920,-3288,372,3702,2900,-572,3574,-255,-2288,485,1133,
14,-227,345,-809,-795,-29,-93,-654,-408,-1151,-2619,518,-2625,-1027,299,-403,394,1295,416,612,-823,1951,82,2367,1430,-277,-600,-1150,-564,-80,-242,332,-3011,1155,249,2914,-938,-352,-2181,-2821,-45,-189,-3795,-1274,-4192,-5830,3,-577,-1817,-1148,1096,-2127,-1683,-444,88,-6,-258,-800,-291,-110,-516,-2953,-1624,-1237,-98,-676,-158,-63,-2060,-859,-13,863,-3650,-258,2361,2272,829,4159,-1616,-2631,540,402,
15,-1917,46,-27,-740,-436,28,-356,-733,-1042,-2476,577,-4315,-884,-35,-730,296,1056,-62,387,-1499,1275,-36,2520,168,-387,-24,-700,163,137,-338,817,-2314,600,595,2024,-442,-311,-1911,-2899,-95,-297,-3679,-1776,-4095,-5756,-358,-641,-2599,-1783,120,-1573,-1647,68,313,-59,-235,-376,2,-29,-95,-2170,-1327,-1187,-114,-203,-96,-6,-1902,-1371,-215,-150,-4831,-296,1706,2555,310,4994,-1379,-2581,190,-199,
16,-2953,-180,-504,-1380,-440,-111,-980,-644,-1079,-2445,518,-3652,-949,-405,-645,17,420,-273,26,-1022,430,-331,2185,171,-481,-208,-1013,-387,-59,100,372,-2644,401,250,1776,-1096,-373,-1789,-1651,-158,-451,-3265,-1457,-3886,-5053,-760,-676,-2179,-1512,1522,-2024,-1462,-558,520,222,-161,-690,-203,45,-746,-1354,-1138,-1334,-151,-527,-167,-12,-1970,-1296,281,88,-3943,-233,1651,1343,545,3569,-2148,-1949,-682,-577,
17,-2226,149,0,-2010,-380,91,-950,-163,-999,-2978,-449,-3630,-1050,-205,-741,-131,712,-138,-102,-1505,-513,-620,3642,399,-342,-7,-953,485,-32,-386,445,-2635,205,511,972,-1116,-540,-3017,-3614,-235,-325,-3273,-1758,-4311,-5930,-379,-485,-2472,-1419,986,-2593,-1583,-1047,194,-37,-165,-772,-213,398,-498,-2002,-876,-985,-156,-691,-197,616,-2550,-1637,-360,-572,-4339,-1174,1059,1625,3473,5172,-1634,-2004,-685,-286,
18,-3373,16,-113,-638,-389,-73,-450,-265,-799,-2237,319,-3083,-840,-98,-731,-325,469,-615,-324,-1323,-965,-747,3102,-252,-478,8,-982,-404,-233,-512,-181,-2683,22,333,1656,-1340,651,-2538,-3222,873,-569,-3039,-1221,-4301,-4715,-162,-938,-1931,-1542,1651,-1637,-1235,142,602,-56,-315,-457,-236,91,-507,-857,-625,-1247,-329,-767,-121,1538,-2130,-205,132,-255,-4083,-1338,1677,422,4085,2748,-2523,-1949,-948,-706,
19,-1826,377,-152,-873,-79,118,-653,-283,-946,-1780,-83,-3504,-637,-113,-568,-61,381,-106,-850,-1298,333,-173,3623,-109,-776,-398,-1199,-587,148,-365,-760,-2660,260,316,1294,-1209,1379,-2138,-2566,1207,-442,-4097,-1596,-4826,-4702,-192,-295,-2410,-1193,1495,-1561,-1173,-403,653,22,-192,-451,-174,-116,-460,-585,-899,-1169,-59,-28,-115,1347,-325,794,48,225,-3962,-915,1681,-56,8588,1604,-1517,-1954,-938,-254,
20,-1394,-90,311,-673,-406,73,-265,263,-573,-1246,169,-1609,-597,-132,-323,-360,521,-215,-725,-836,518,-93,1969,17,-586,-656,-1123,-184,48,-293,-241,-1772,122,180,1386,-1112,244,-2057,-2364,377,-96,-3112,-1013,-3781,-4494,-546,-632,-2067,-1266,763,-1527,-752,-605,217,61,-126,-345,-423,53,-526,-1173,-700,-1020,7,-426,-36,768,-1535,438,-150,-449,-3168,-1260,149,-626,9486,1809,-651,-1486,-394,-182,
21,-1357,-262,-313,-929,-92,-427,-659,27,-435,-1487,-62,-1073,-440,-425,-415,-301,-111,-251,-476,-1046,-638,-791,3023,135,-293,108,-1239,-598,-46,-542,-180,-1635,142,-86,1141,-1429,456,-2925,-2284,298,-612,-2566,-643,-2982,-3858,-720,-505,-2357,-859,531,-2229,-1346,-571,671,60,-169,-592,-339,-89,-706,-1698,-308,-787,-81,-364,-82,281,-1269,-422,54,-448,-2937,-1124,565,-557,6805,941,-1114,-1106,-256,-362,
22,-1502,71,65,-665,-59,-106,-195,88,-378,-390,589,-1532,-466,-114,-382,-296,237,-76,-696,-1075,326,-16,1958,224,-645,-180,-849,-878,463,-276,7,-1391,-366,-77,463,-995,-398,-2494,-2242,166,-281,-2633,-704,-3056,-2990,-559,-795,-1813,-694,1022,-1275,-179,-852,672,282,-73,-527,-96,-117,-645,-1240,-373,-918,25,-309,40,208,-408,1206,-205,252,-1636,-1088,-167,-300,6556,862,-1204,-652,49,1,
23,-577,53,-35,419,510,337,-222,13,-307,1008,1069,-888,-207,40,-315,-252,9,-147,-244,475,2813,592,1997,-220,4,-2,-663,-505,167,205,244,1654,14,25,1153,101,-1240,-48,-928,-789,-670,-1847,-541,-2432,-2836,-572,-241,-1246,-258,632,-1500,-583,-826,168,-28,128,25,155,54,18,-1524,-318,-783,21,-214,28,-425,-8,1330,-243,50,-871,-941,-157,-65,5100,612,-804,-1277,-22,494,
24,-331,-142,288,594,614,172,-73,193,-68,834,1973,962,-265,118,-414,110,313,-315,-263,353,3681,1137,1954,536,210,701,-260,-446,181,888,-52,2210,-92,157,1187,1343,-276,1014,-1392,-385,-932,-1129,-1179,-2754,-5413,-466,-681,-760,-578,539,-1566,-286,-624,351,93,98,238,413,313,-57,-1463,-117,-901,151,-99,73,-678,746,2414,-460,582,-696,-973,502,585,4413,497,-313,-1113,68,227,
25,671,84,-163,-138,402,-258,11,31,162,-157,1058,-1094,-551,281,-321,-412,284,-135,-757,160,3704,558,1834,233,-397,-287,210,-157,396,528,355,639,-47,421,1447,202,288,-358,-1752,720,-156,-2196,-208,-2977,-3354,-59,31,-669,-326,549,-1519,-119,-339,382,199,138,-397,120,-283,-236,-964,-737,-736,227,-344,46,84,763,2602,-175,737,-2308,-1337,535,161,2811,577,-578,-1537,189,1461,
26,-104,193,224,-482,-82,-153,-107,-189,774,489,1344,-700,-397,-137,-201,-145,362,-234,-245,-605,1920,263,1589,35,-209,-269,-295,-482,425,-209,-142,-1408,280,158,1245,-833,423,-2082,-1192,81,-1023,-732,93,-3472,-3669,-620,-212,-969,-1019,1877,-2094,-209,-622,179,24,152,-401,151,12,-673,-1148,-630,-710,189,-251,8,-708,-144,1557,65,1396,-889,-678,928,-163,2800,-126,-617,-1649,455,1086,
27,-425,-61,305,-651,181,76,-510,500,-247,-204,339,-2765,113,464,-331,18,397,-83,-584,-749,1781,84,1044,36,-383,84,-290,-483,-216,-185,-267,-893,42,-197,678,-691,-92,-1894,-2548,-165,-382,-1438,-538,-2698,-2273,-370,-72,-1014,-971,986,-2537,-641,-672,163,43,145,-423,-41,-265,-649,-1091,-628,-436,99,-505,69,-456,225,658,-358,729,-965,-796,229,151,1102,371,-286,-1445,-96,386,
28,-673,33,379,126,382,-157,-536,256,345,88,1133,-3531,-505,-25,89,-55,264,-210,209,-88,2127,388,1761,52,-87,682,376,-675,122,212,-108,884,-244,-94,489,-80,-264,-644,-947,-601,-256,-355,27,-2128,-2968,-818,-134,-419,-886,1660,-2462,-998,-801,501,277,75,-190,172,70,-71,-1539,71,-696,225,56,-54,-1027,-782,657,191,526,-1593,-1664,-467,170,2301,576,-1016,-1256,203,107,
29,-465,-211,546,-112,151,-300,-205,65,51,-134,1162,-4626,-148,-385,159,-117,348,-80,-304,-484,1840,62,2013,397,-382,336,252,-781,146,176,190,246,-68,-267,510,-496,18,-1016,-2068,-85,218,-617,141,-1217,-4180,-678,-802,-310,-864,623,-995,-545,-261,576,97,111,-479,230,231,-188,-722,-335,-589,91,84,27,-509,-474,405,328,1605,-2054,-524,912,45,973,357,-903,-612,-450,-76,
30,-561,-60,280,-491,3,89,38,62,309,-768,97,-4672,-467,-268,-376,-236,52,-540,-265,-439,-116,-430,1215,-526,-433,293,-466,-869,-235,-219,817,-1201,252,0,368,-911,-858,-2266,-1136,20,57,-1037,492,-571,-3634,-718,-317,-847,-1189,623,-1605,-1003,-149,583,139,73,-887,-43,-176,-498,-962,-154,-622,69,-364,2,19,-949,-307,-57,755,-1727,-1361,51,-570,311,57,-1025,-859,-454,-196,
31,-1549,-481,-53,-1093,-99,-558,-605,45,206,-1407,-788,-3913,-336,-598,-231,-319,160,-207,-768,-1334,-786,-393,1069,-62,-443,-40,-167,-131,147,-779,139,-2066,-358,-293,16,-1245,-396,-2894,-1736,217,-479,-1275,-470,-1198,-3343,-725,-30,-555,-384,209,-2546,-794,-432,101,81,-227,-748,-156,-110,-550,-271,-497,-771,100,-417,-31,-486,-1307,82,-497,-128,-2734,-1067,-50,-349,-900,256,-1039,-699,-31,-228,
32,-1752,-55,202,-433,-261,197,-391,123,-77,-511,610,-3780,-693,-187,-330,-56,2,-274,-434,-932,-1406,-431,738,-93,-153,-196,-161,-390,128,-722,-70,-1480,217,-256,436,-1611,-583,-2934,-1723,-163,-515,-1496,-69,-1176,-3596,-835,-623,-567,-659,487,-1172,-747,-282,81,308,1,-1007,-86,7,-935,-694,-358,-807,-56,-232,71,-1139,-585,-620,-30,-126,-1956,-900,538,-418,-223,-238,-1163,-1558,-211,-125,
33,-608,-257,-15,-545,145,-210,-433,28,-531,-1038,302,-2823,-239,-817,-648,-239,52,-97,-442,-1171,-608,-525,518,-442,-135,-30,-94,-446,-107,-515,-238,-2492,297,-190,304,-1665,-238,-3438,-1834,-387,-685,-1742,225,-1542,-3106,-682,-6,-338,-873,521,-1935,-847,-465,325,350,-124,-948,-156,97,-776,13,-1029,-772,26,-612,-46,-1193,37,169,-574,-181,-2080,-738,3,-382,-623,171,-156,-1128,63,282,
34,-1122,-143,330,-917,8,-224,-367,-82,-97,-1166,115,-2922,-290,79,-511,-334,312,-261,-365,-742,-152,-350,851,-119,-508,24,-117,-644,-229,-291,-482,-1400,-179,-73,550,-1804,93,-2935,-1918,-409,-271,-1741,-691,-2003,-2679,-783,-652,-457,-402,-254,-1168,-457,-275,581,94,49,-805,-318,-17,-173,-422,-969,-846,-52,-192,13,-1079,526,294,-305,108,-1951,-978,515,-543,-47,-617,-440,-1568,614,-219,
35,-302,-72,-50,-650,-175,-334,-420,201,276,-1420,-216,-1944,-180,-26,-375,-232,269,-278,-450,-649,-127,-325,-73,-522,-35,-280,70,-337,99,-307,177,-1853,-227,-202,100,-1162,-316,-2876,-2067,-226,-329,-1054,-556,-1873,-2374,-933,-650,-106,-618,335,-1867,-994,-646,40,151,-60,-969,-164,-311,-732,-727,-1101,-962,87,-278,29,-1515,219,1108,-406,-48,-1619,-1136,-33,-119,-140,422,-467,-1508,-167,-232,
36,-1336,216,380,-332,-88,280,-141,201,-119,-1002,227,-2501,-398,119,-401,-271,93,-330,59,-832,321,-501,55,-131,-575,-356,-430,-479,-135,-368,189,-1667,-99,-203,-237,-1037,69,-2814,-2726,-65,-742,-1712,-292,-1577,-2132,-453,-787,-499,-1224,-63,-2595,-827,-352,412,233,-56,-794,-69,86,-67,-315,-453,-790,-17,185,-56,-523,541,2077,75,194,-1193,-949,-171,-437,-773,-39,-378,-1353,-113,-423,
37,-659,-320,480,-113,113,220,-111,82,-85,-1778,24,-2801,-843,-5,-475,-239,349,-339,-136,-826,-212,-513,234,-383,-572,-282,-510,-638,-342,-992,429,-1586,-106,-381,152,-1628,-396,-2731,-1741,-454,-358,-1863,-144,-2296,-2470,-1156,-713,-367,-952,122,-2133,-677,-419,136,365,-61,-668,-188,-181,-348,-402,-558,-886,-142,-136,-101,-752,417,443,-546,87,-2084,-763,-241,-526,-773,-99,-544,-1357,91,-840,
38,-1148,265,369,-603,-42,-322,-237,-95,-130,-1132,362,-3040,-419,131,-284,-35,-25,-319,-580,-477,496,33,214,-310,-854,210,-602,-1323,404,-362,548,-515,-301,9,563,-1226,-503,-2420,-1748,-240,237,-2316,-479,-1431,-2945,-925,-137,-587,-1297,-18,-1200,-524,-373,209,150,-5,-571,-112,-87,-522,113,-321,-658,71,-139,-52,-816,708,1611,-174,592,-1630,-468,82,-168,-870,-500,40,-1597,-455,-568,
39,-894,-30,184,365,76,-350,-223,57,-171,-1467,74,-2895,-495,547,27,-113,313,-61,-210,-275,1181,-168,-99,-320,-860,-76,-833,-682,137,153,591,-1050,-158,-198,-146,-1282,-316,-2041,-1778,-558,115,-1621,-528,-2550,-3261,-849,-151,-782,-538,-335,-2105,-389,-645,331,199,-85,-699,22,-164,-405,-904,-852,-846,102,-44,-74,-712,166,1429,-138,-38,-1172,-445,128,-123,-900,-332,-990,-831,-625,-171,
40,-335,96,607,-266,129,-156,-252,51,117,-686,322,-2119,-744,48,-286,-112,318,-316,-213,-488,865,-234,55,-652,-285,-201,-619,-851,-251,-714,139,-316,-128,208,114,-1130,-168,-2519,-1899,-496,91,-2345,121,-3221,-3852,-887,-62,-501,-1145,322,-1928,87,-687,439,98,-30,-933,16,-276,-864,-661,-1182,-868,-28,-360,63,-764,-172,578,-621,-32,-1627,-210,-32,-472,-614,-251,-845,-1660,-36,-492,
41,-831,-286,-117,-959,29,-121,-348,33,-62,-1493,-623,-3302,-645,-543,-537,-361,99,-508,-692,-551,-419,-359,205,-742,-578,-245,-1013,-377,-154,-268,-127,-1776,-83,-384,-488,-1748,-402,-3403,-1272,-147,-549,-2054,290,-1854,-4360,-661,-496,-825,-426,-330,-2148,-256,-264,171,235,-148,-912,-104,-290,-772,-534,-1133,-1005,-51,-419,-57,-768,258,426,-696,-314,-1253,-1365,82,-496,-567,-366,-1467,-2006,-187,-217,
42,-973,-247,514,-1759,37,96,-342,-67,-108,-305,52,-2409,37,-265,-161,-197,359,-478,309,-936,-1103,-576,-50,-427,-124,112,-561,-937,-246,-484,434,-2110,21,-354,-319,-1819,-919,-4065,-1824,-338,-323,-1820,-170,-2161,-3255,-699,-633,-1399,-555,487,-1836,-320,-210,254,314,-158,-751,-188,-73,-893,-568,-1156,-778,-275,-371,88,-1065,-657,297,-713,-149,-1235,-707,381,-347,1373,-199,-756,-1913,-364,-366,
43,-1287,88,252,-1293,-67,-58,-467,-45,-204,-1513,-147,-1983,-657,307,-514,-213,124,-449,-75,-475,-576,-247,373,-244,-531,50,-1236,-784,-533,-590,33,-1516,-235,-99,-1246,-1760,-630,-4413,-1671,-738,423,-2520,-657,-1147,-2512,-349,5,-1053,-396,435,-2007,-537,-457,-29,110,-243,-1185,-177,-110,-742,-418,-984,-751,34,-60,-77,-473,-126,177,-494,165,-2500,-1038,-240,-671,-2,-347,152,-1068,-861,-786,
44,-771,-19,282,-95,413,33,-229,-72,-156,-1913,568,-4400,-324,-295,-1,-281,-16,-439,-258,481,1000,795,524,739,147,-26,-831,-668,88,681,731,588,-124,-50,-276,-320,-1352,-2067,-1313,-720,667,-2432,-202,-751,-4170,-667,-521,-497,-899,105,-1447,348,-399,523,93,-31,-604,32,-32,-91,-2084,-566,-572,76,-71,86,-596,-33,305,-275,892,-1436,-670,-266,-7,35,-347,-1270,-930,-260,-72,
45,420,-67,349,-208,457,-219,-462,-217,-244,-1606,604,-4546,-173,158,-422,-286,69,-507,-55,-548,1320,121,-112,-117,-205,-209,-642,-442,-178,248,468,-1156,-42,-74,445,-1266,-470,-2517,-1889,-719,406,-2263,-499,-2107,-4183,-911,-155,-761,-635,-710,-338,467,-267,545,524,-139,-951,-6,-257,-649,-1420,-785,-826,157,-266,93,-32,-566,1417,-225,757,-1475,30,628,114,2923,-269,-1384,-1106,-100,-5,
46,767,180,154,-230,-79,-104,-452,177,-113,-1687,226,-3346,-744,65,-358,-351,285,-235,-352,-724,148,-91,502,886,65,-46,-640,-1135,-190,-259,-48,-1146,-371,178,918,-921,-956,-2915,-1740,-605,350,-2206,-894,-1669,-3593,-927,-454,-1491,-975,-873,-636,-315,-143,-309,694,-108,-761,55,-313,-575,-1663,-956,-772,-68,-152,-6,271,-258,735,-502,630,-2084,-786,351,-403,2302,-532,-698,-1374,-253,-46,
47,677,-110,398,-67,184,-226,-352,568,152,-1523,793,-1189,-253,-382,-257,-188,49,-304,-485,-481,-35,-114,289,283,-611,245,-658,-884,-270,-499,-235,-1573,-386,-474,-321,-1134,-496,-3565,-2112,-139,180,-2657,-320,-1773,-4464,-862,-615,-1241,-745,-386,-1297,-942,-170,570,484,-50,-1031,-16,-77,-913,-1620,-1347,-788,13,-73,131,-324,-123,747,-257,233,-1811,390,-237,-408,1029,-207,-1195,-1526,162,501,
48,102,-276,87,-1100,111,-180,-377,-34,-433,-1783,240,-593,-530,-101,-148,-389,140,-286,-283,-769,-773,-43,192,92,-681,-118,-1109,-1058,-289,-144,238,-1913,-342,-349,72,-1700,-637,-4081,-1794,-321,-560,-2649,-1348,-2463,-4972,-788,143,-1682,-1046,-611,-1630,-388,-738,-163,293,-104,-850,89,-265,-1041,-2024,-1047,-755,-29,-371,-20,-357,-494,411,-106,-346,-1444,740,-10,-398,925,-819,-799,-1656,-537,892,
49,-228,-308,278,-74,531,170,-347,92,-192,-1777,189,-1761,-374,-220,72,-162,57,-123,220,-1006,-647,280,322,-427,89,262,-1240,-889,-359,-461,909,-941,204,105,77,-1127,-1486,-3107,-1720,-517,-942,-2967,-262,-2675,-4985,-867,-720,-1396,-761,349,-2106,-189,-743,-106,366,-57,-896,-16,-197,-841,-1210,-1612,-1040,-39,-16,-2,-600,-716,1148,183,47,-1558,125,109,-117,-341,-522,-1147,-1281,-404,485,
50,-12,-106,375,225,267,1,-144,125,-334,-2355,235,-2114,132,-150,-338,77,321,-277,-704,-694,332,-353,-279,-169,-338,139,-691,-913,133,-543,680,-1845,-265,-258,188,-480,-528,-3396,-1818,-708,-460,-2849,149,-3162,-4316,-450,-146,-933,-987,126,-2213,-267,-591,68,192,-202,-915,67,-48,-432,-1664,-917,-1033,94,-72,-85,-355,5,788,-753,-11,-1692,-517,18,-353,-810,-176,-828,-1997,161,1207,
51,566,20,2,-275,-13,-116,-340,-59,-544,-1552,338,-974,-521,95,-202,-487,180,-352,-272,-485,-565,233,-497,-115,-307,-106,-1152,-1206,-371,-651,191,-1542,-119,-330,-79,-1041,-941,-3955,-1143,-884,-155,-2473,-477,-2941,-5215,-786,-327,-1491,-878,944,-2407,-663,-422,-102,169,-205,-937,-184,-94,-576,-1068,-1147,-878,1,92,35,-220,-471,-475,-395,-109,-2152,-790,310,-32,-20,-411,-1385,-1964,272,922,
52,67,-191,52,-1361,-161,-167,-560,286,-179,-2082,-101,-500,-367,148,-319,-194,-17,-478,-135,-689,-416,-87,-749,-262,-721,178,-1362,-993,-108,-635,-149,-1491,-121,-359,-563,-1092,-1100,-4242,-1596,-614,-264,-2575,-110,-4178,-4748,-732,-383,-1543,-1383,200,-2253,-443,-671,333,80,96,-868,-32,68,-597,-1466,-1723,-816,61,122,30,-773,-497,198,-753,326,-1632,-448,-313,-511,-314,-126,-1363,-2322,698,941), ncol = 82)
pLinear <- plot_ly(z = pre2[,-1], type = "heatmap", transpose = TRUE, zauto = FALSE, zmin = -10000, zmax = 10000, colors = colorRamp(colors = c("blue", "white", "red"), interpolate = "linear"))
pLinear
pSpline <- plot_ly(z = pre2[,-1], type = "heatmap", transpose = TRUE, zauto = FALSE, zmin = -10000, zmax = 10000, colors = colorRamp(colors = c("blue", "white", "red"), interpolate = "spline"))
pSpline
library(d3heatmap)
pD3heatmap <- d3heatmap(pre2[,-1], scale = "column", dendrogram = "none", color = c("blue", "white", "red"))
pD3heatmap
library(heatmaply)
pHeatmaply <- heatmaply(pre2[,-1], colors = c("blue", "white", "red"), limits=c(-10000, 10000), dendrogram = "none")
pHeatmaply
library(scales)
colRamp <- colorRampPalette(colors = c("blue", "white", "red"))
vals <- unique(scales::rescale(c(pre2[,-1])))
o <- order(vals, decreasing = FALSE)
cols <- scales::col_numeric(colRamp(length(vals)), domain = NULL)(vals)
colz <- setNames(data.frame(vals[o], cols[o]), NULL)
pCustom <- plot_ly(z = pre2[,-1], colorscale = colz, type = "heatmap", transpose = TRUE, zauto = FALSE, zmin = -10000, zmax = 10000)
pCustom