[R] Level Plot and Scale of Colorkey

From: emma hartnett <emma_hartnett_at_yahoo.co.uk>
Date: Fri, 13 Jun 2008 16:50:58 +0000 (GMT)

I am drawing level plots but I would like to specify the range of the colorkey, I am not having any success figuring this out so any help would be greatly appreciated!

Here is an example of what I am trying to do:


x <- seq(1, 10,by=1) 
y <- seq(1,10,by=1)
g <- expand.grid(x = x, y = y)

g$z <- 1/exp((abs(g$x-5)+abs(g$y-5))*disp) g$z<-g$z/sum(g$z)

levelplot(z ~ x * y, g,xlab="x co-ordinate", ylab="y co-ordinate" ,colorkey=TRUE,col.regions=(col=gray((0:32)/32)))

I would like to enforce the number of divisions on the colorkey scale and the size – so for example from 0 to 0.1 in increments of 0.02 (just as an example).

I apologize if this is an obvious question but I have read the documentation and scoured the archives and cannot figure it out.


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 Fri 13 Jun 2008 - 17:30:00 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 Fri 13 Jun 2008 - 18:30:44 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