0

My data covers a small range, but I still like to make the small differences between the data points visible in a heat-map. What color-key is best to maximize color intensity (and not generating a greyish map) and how to set the range in pheatmap?

Joanne
  • 1
  • 1
  • You would need to tell us more about your data (eg range, intervals, purpose)! A start could be to look up templates on [Colorbrewer2](http://colorbrewer2.org/) and use them like `color = brewer.pal(10, "RdYlBu")`. – Tapper Nov 12 '18 at 15:24

1 Answers1

1

You didn't give enough information to give you an exact code example for your sample data, but something like the below is a way to get at the problem. In terms of what actual colours you want to use, I recommend you play around with it to see what looks best, I have just subbed in red and blue as a proxy.

pheatmap(yourdata, color = colorRampPalette(c("red", "blue"))(length(-12:12)),breaks=c(-12:12))

The length() is setting the range while the breaks=c(x:x) tells it where to make breaks. So let's say you wanted breaks every 0.2 from 0 to 1, you would modify it to be:

breaks=c(0,0.2,0.4,0.6,0.8,1.0)

You can play around with the break gradients to get something that works for your dataset.

This is my first attempt at answering a question on here, please let me know if something above does't work for you, or if you are confused by what I've written.

mdelow
  • 65
  • 1
  • 2
  • 10