[R] library(Matrix) and image() colors?
Deepayan Sarkar
deepayan.sarkar at gmail.com
Wed May 28 23:42:09 CEST 2008
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