[R] changing colors in filled.contour

begrinner j.terheyden at t-online.de
Wed Oct 7 12:40:05 CEST 2015


Dear R community!

I haven't worked with R before but I found it has some nice abilities to
create graphics. I made it to create a filled.contour with the settings I
want but unfortunately I don't seem to be able to change colors. Instead of
the standard colors, I'd like to get dark gray or black for higher values
(instead of pink) and light gray or white for lower values (instead of
cyan).  A second option I'd like to try is having colors change from green
(low values) to red (high values)... but right now it seems like I'm miles
away from that.

This is what I have so far:

model=function(a, b){+4+0.5*a-0.2*b}
x=seq(-10, 10, by = 2)
y=seq(0, 100, by = 10)
z=outer(x, y, model)
contour(x,y,z,nlevels=12)
mylevels <- seq(0,10,10)
filled.contour(x,y,z, main="Title")

But when I try to Change the Color theme like this -

filled.contour(x,y,z,levels=mylevels,col=grey(seq(0,1,length=length(mylevels))))

 - I just get one white and one black bar. 

Does anyone of you know a solution?

Thanks in advance, you'd help me a lot as I've been working on these few
lines for a couple already.

J




--
View this message in context: http://r.789695.n4.nabble.com/changing-colors-in-filled-contour-tp4713260.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list