I do set the breaks parameter in heatmap.2
I would expect that the color.key and the histogram (the thing in the
top left of the plot) are aligned.
Just that everyone can reproduce the problem:


mypalette<-brewer.pal(11,"RdYlBu")
ddd <- rnorm(400,0,0.1)
mdd <- matrix(ddd,ncol=50)
hm <- heatmap.2(mdd,col=mypalette,scale="row") #this is used to
produce the breaks, (and here it works fine)

mdd <- t(scale(t(mdd)))
heatmap.2(mdd,col=mypalette,scale="none",breaks=hm$breaks)

# take a look and you will see that the colors are not aligned with the breaks
although the documentation states
breaks: (optional) Either a numeric vector indicating the splitting
          points for binning ‘x’ into colors, or a integer number of
          break points to be used, in which case the break points will
          be spaced equally between ‘min(x)’ and ‘max(x)’.



-- 
Witold Eryk Wolski

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to