[R] image.plot transparent?
ehlers at ucalgary.ca
Fri Jul 13 23:51:50 CEST 2012
On 2012-07-13 06:07, Chris82 wrote:
> hiere is a small reproducible example.
> All z.i which are NA should be transparent at the plot, but they are white
> ### Example image.plot regular x,y grid ###
> x <- seq(2,2.9,0.1)
> y <- seq(42,42.9,0.1)
> z <- matrix(seq(-5,4.9,0.1),nrow=10)
> ### overplotting by a irregular grid ####
> x.i <-
> y.i <-
> z.i <- matrix(seq(-10,14,1),nrow=5)
> z.i[z.i< 0] <- NA
> image.plot(x.i,y.i,z.i, col=terrain.colors(20),add=T)
You still haven't told us what package you're using but,
like Professor Ripley, I assume that it's the fields package.
I believe that package uses a default of "white" for
missing values. You can reset that with the argument
'transparent.color' as in:
image.plot(x.i,y.i,z.i, col=terrain.colors(20), add=TRUE,
transparent.color = "transparent")
> View this message in context: http://r.789695.n4.nabble.com/image-plot-transparent-tp4635976p4636434.html
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help