[R] is there "colNA" for a image? (i.e. How to set the color of NAs or background in an image)

Camilo Mora cmora at dal.ca
Sat Aug 4 08:18:35 CEST 2012


Hi everyone,

I am using a layout of two images, one of which is an image of a  
raster. In this one image I am using a color palette to show the  
gradient of temperature in the world.By default the color of the  
continents (which I set to NA in the raster) appears as white.

I would like the NA values or background of just that one image to be  
of a given color. is this possible?

I know I can use "bg" in par but that will change the background color  
of the entire window.
I found I can use plot instead of image, which has the option of  
setting "colNA" to any color. My problem is that that the plot does  
not work well in the layout with the other image.

Any help very much appreciated.
Again, my question is how to set the background color of an image in a  
layout?.

Thanks,

Camilo

Camilo Mora, Ph.D.
Department of Geography, University of Hawaii



More information about the R-help mailing list