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

From: Deepayan Sarkar <>
Date: Wed, 28 May 2008 14:42:09 -0700

On 5/28/08, <> 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 mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 28 May 2008 - 21:46:54 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 29 May 2008 - 09:30:42 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive