I have a question about the package gplots
. I want to use the function heatmap.2
and therefore I want to change my symmetric point in color key from 0 to 1. Normally when symkey=TRUE
and you use the col=redgreen()
, a colorbar is created where the colors are managed like this:
red = -2 to -0.5
black=-0.5 to 0.5
green= 0.5 to 2
Now i want to create a colorbar like this:
red= -1 to 0.8
black= 0.8 to 1.2
green= 1.2 to 3
Is something like this possible?
Thank you!
Best Answer
If you look at the heatmap.2 help file, it looks like you want the
breaks
argument. From the help file:So, you use
breaks
to specify the cutoff points for each colour. e.g.:The crucial bit is the
breaks=c(-1,0.8,1.2,3)
being your cutoffs.