if (FALSE) {
data( "obs0601" )
data( "wrf4ncar0531" )
data( "ICPg240Locs" )
## Plot verification sets with a map.
## Two different methods.
# First way does not preserve projections.
locr <- c( range( ICPg240Locs[,1]), range( ICPg240Locs[,2]))
zl <- range( c( c(obs0601), c( wrf4ncar0531) ) )
par( mfrow=c(2,1), mar=rep(0.1,4))
image( obs0601, axes=FALSE, col=c("grey", tim.colors(256)), zlim=zl)
par( usr=locr)
# if( map.available) map( add=TRUE, database="state") # from library( "maps" )
image( wrf4ncar0531, axes=FALSE, col=c("grey", tim.colors(256)), zlim=zl)
par( usr=locr)
# if( map.available) map( add=TRUE, database="state")
image.plot( obs0601, legend.only=TRUE, horizontal=TRUE,
col=c("grey", tim.colors(256)), zlim=zl)
# Second way preserves projections, but values are slighlty interpolated.
zl <- range( c( c(obs0601), c( wrf4ncar0531) ) )
par( mfrow=c(2,2), mar=rep(2.1,4))
image(as.image(c(t(obs0601)), x=ICPg240Locs, nx=601, ny=501, na.rm=TRUE), zlim=zl,
col=c("grey", tim.colors(64)), axes=FALSE, main="Stage II Reanalysis 4/26/05 0000 UTC")
# map(add=TRUE, lwd=1.5)
# map(add=TRUE, database="state", lty=2)
image(as.image(c(t(wrf4ncar0531)), x=ICPg240Locs, nx=601, ny=501, na.rm=TRUE), zlim=zl,
col=c("grey", tim.colors(64)), axes=FALSE, main="WRF NCAR valid 4/26/05 0000 UTC")
image.plot(obs0601, col=c("grey", tim.colors(64)), zlim=zl, legend.only=TRUE, horizontal=TRUE)
}
Run the code above in your browser using DataLab