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

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

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



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. 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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive