Question: Color key in heatmap.2 function in R
0
gravatar for manjumoorthy95
4 weeks 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 • 86 views
ADD COMMENTlink modified 4 weeks ago by ATpoint36k • written 4 weeks ago by manjumoorthy9520
2

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 REPLYlink written 4 weeks ago by RamRS27k

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 29 days ago by RamRS27k • written 4 weeks 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 4 weeks ago by RamRS27k
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: 983 users visited in the last hour