Re: [R] Level Plot and Scale of Colorkey

From: Toby Marthews <Toby.Marthews_at_lsce.ipsl.fr>
Date: Fri, 13 Jun 2008 19:07:39 +0200 (CEST)

Try

colscaledivs=100 #colscaledivs=15 here is the R default levelplot(z ~ x * y, g,xlab="x co-ordinate",ylab="y co-ordinate",colorkey=TRUE,at=seq(from=-0.01,to=0.25,length=colscaledivs),col.regions=(col=gray((0:colscaledivs)/colscaledivs)))

Toby Marthews

Le Ven 13 juin 2008 18:50, emma hartnett a écrit :
> 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:
>
> disp<-1
>
> 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.
>
>
>
>
> __________________________________________________________
> can.html
>
> ______________________________________________
> 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.



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:40:03 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