Question: Color key in heatmap.2 function in R
0
gravatar for manjumoorthy95
7 months ago by
manjumoorthy9520 wrote:

The below image shows the type of the heatmap i want. As you can see the color key range in the heatmap is -3,3,9,15. How to achieve the same?

I have tried the break argument in the heatmap.2() function. But the color range keeps changing from what ever break i provide. I need the exact numbers in the color key as seen in the picture.

enter image description here

R • 1.1k views
ADD COMMENTlink modified 16 days ago by Biostar ♦♦ 20 • written 7 months ago by manjumoorthy9520
2
gravatar for _r_am
7 months ago by
_r_am32k
Baylor College of Medicine, Houston, TX
_r_am32k wrote:

Consider switching to ComplexHeatmap. It eliminates a lot of the problems one faces with heatmap.2 or pheatmap or any of those complicated heatmap building packages.

ADD COMMENTlink written 7 months ago by _r_am32k

Even in ComplexHeatmap package, when I use the

colorRamp2(c(-3,3,9,15), c(“red”,”yellow”,”green”,”blue”))

The color range is still getting divided in the heatmap automatically to 15,10,5,0,-5. I basically want to see only the values (-3,3,9,15) in the color range bar.

ADD REPLYlink modified 7 months ago by _r_am32k • written 7 months ago by manjumoorthy9520
1

You may want to look at advanced parameters or limit the data range to your specific range by trimming all values that fall outside the range.

ADD REPLYlink written 7 months ago by _r_am32k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2112 users visited in the last hour
_