[R] Natural colours for topographic data

Jim Lemon jim at bitwrit.com.au
Tue Nov 24 11:15:59 CET 2009


On 11/24/2009 07:42 PM, Karl Ove Hufthammer wrote:
> On Mon, 23 Nov 2009 12:21:03 -0500 David Winsemius
> <dwinsemius at comcast.net>  wrote:
>    
>>> I would be happy with a simple one, that just mapped negative values
>>> to water colours and positive values to land colours.
>>>        
>> Searching with the strategy "color positive negative zero" in r-search
>> and limiting it to r-help replies,  I get this Jim Lemon reply using
>> (naturally) plotrix's color.scale:
>>
>> http://finzi.psych.upenn.edu/R/Rhelp02/archive/90837.html
>>
>> The application to your needs looks pretty immediate.
>>      
> Thanks for the suggestion, but the arguments that 'color.scale' takes
> (range of red, green and blue values) makes it not very useful for this
> purpose.
>    
Hi Karl,
For a start, you could try:

color.scale(oceandepths,extremes=c("lightblue","blue"))

for the water and

color.scale(vegetationcover,c(0.55,0),0.55,0)

for the land as really basic "natural" colors. There are several ways to 
specify the value to color transformations, and you can even overwrite 
some parts of the color matrix using logical vectors, like coloring 
everything over 4000 meters white for snow.

Jim




More information about the R-help mailing list