Skip to content

Inverting the scale in heat.colors

6 messages · caspar hallmann, Dennis Murphy, Greg Snow +1 more

#
Dear list members,

I am plotting the result of a kriging with spplot and I would like to 
reverse the colors in the heat.colors palette for the col.regions 
argument.  In other words I want the red colors to represent higher 
values than the yellow colors to represent temperature.
Best,

Manuel
#
use colorampPalette(). You can define your own colors in any order.
something as in :

plot(1:10,1,col= colorRampPalette(c("blue", "red"))(10)

hope it helps

Caspar
On Sun, Sep 12, 2010 at 3:05 PM, Manuel Sp?nola <mspinola10 at gmail.com> wrote:
#
Thank you very much Caspar.
Best,

Manuel
On 12/09/2010 07:25 a.m., caspar hallmann wrote:

  
    
1 day later
#
Others have shown how to create your own palette, which is good general information.  But for your case you may be able to simply use the rev function with heat.colors.
#
Thank you very much Greg.
Best,

Manuel
On 13/09/2010 10:33 a.m., Greg Snow wrote: