[R] Error in image.default(1:nc, 1:nr, x, xlim = 0.5 + c(0, nc), ylim = 0.5 + : must have one more break than colour

David Winsemius dwinsemius at comcast.net
Mon Nov 17 18:30:51 CET 2008


On Nov 17, 2008, at 11:01 AM, paul murima wrote:

> heatmap.2(m, margins= c(9,9), col = bluered(64), trace=c("none"),
> breaks=c(seq(-60,0,60/20)), symkey=TRUE, density.info="histogram",
> cexRow=1,)
> Error in image.default(1:nc, 1:nr, x, xlim = 0.5 + c(0, nc), ylim =  
> 0.5 +  :
>  must have one more break than colour

Thisnewbies reading of the error message and the function call:
     -request for what appears to be 64 colors
(Although my current set up does not recognize the function bluered(),  
I will assume that you have a package that provides bluered.)
     -3 breaks .... since 60/20 = 3
     -an error message that says that is unacceptable.

Suggest you look at ?seq more carefully.


-- 
David Winsemius


>
>
> Hie all.
>
> I am working on scaling my data into a fited range of -60 0 and 60,
> with increases of 20.
> when i use heatmap,2 the error messgae i get is as follows
>
> heatmap.2(m, margins= c(9,9), col = bluered(64), trace=c("none"),
> breaks=c(seq(-60,0,60/20)), symkey=TRUE, density.info="histogram",
> cexRow=1,)
>
> Error in image.default(1:nc, 1:nr, x, xlim = 0.5 + c(0, nc), ylim =  
> 0.5 +  :
>  must have one more break than colour
>
> Can any one help on how i can get around this problem.
> Your help is most appreciated.
>
> Rockie
>
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list