Dear List,

I am trying to plot an RGB image using plotRGB, and I was wondering if
there is anyway to turn the NA regions of the image to a different color
(say white or grey)?

For instance, in the following code, how to a turn the first and last 5
columns of the image something other than black?

library(raster)
br <- brick(lapply(1:3, function(x) {
  r <- raster(nrow = 100, ncol = 100)
  r[] <- sample(0:255, ncell(r), replace = T)
  r[cellFromCol(r, colnr = c(1:5, 96:100))] <- NA
  return(r)
}))

plotRGB(br, r = 1, g = 2, b = 3)

Thanks in advance for your advice, and I will be happy to try alternate RGB
plotting approaches as well.

Cheers, Lyndon

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to