[R] library(Matrix) and image() colors?

jgarcia at ija.csic.es jgarcia at ija.csic.es
Thu May 29 08:57:34 CEST 2008


Yes ,this work! Uhmm... Strange!
Thanks,
Javier
--------------
> On 5/28/08, jgarcia at ija.csic.es <jgarcia at ija.csic.es> wrote:
>> Hi,
>>  I'm trying to produce a plot of an image of a Matrix, but I don't get
>>  other colors than the default grey scale:
>>
>>  > image(Matrix(topo.matrix.2),col.regions=topo.colors(100),colorkey=FALSE)
>>
>>  this still is plotted in grey.
>>
>>  Is there any mistake in my syntax?
>
> Not sure what the problem is, but although the first call does not
> work, the second one does:
>
> image(Matrix(volcano), col.regions = topo.colors(100), colorkey = TRUE)
>
> image(as(Matrix(volcano), "sparseMatrix"),
>       col.regions = topo.colors(100), colorkey = TRUE)
>
> -Deepayan
>



More information about the R-help mailing list