# NOT RUN {
session_grid(NULL)
a <- pixelsize()
p1 <- colorize(a[a>500],ramp=FALSE,interval=TRUE)
p2 <- colorize(a,ramp=FALSE,pal=colorRampPalette(c("grey40","grey100"))
,verbose=!TRUE,interval=TRUE)
compose_open(layout=c(2,2),legend=list(list(1,"right"),list(2,"left")))
for (i in 1:4) {
panel_new(col=ifelse(i==2,"white",NA))
if (i %in% c(3,4))
panel_raster(p1)
else if (i %in% 2)
panel_raster(p2)
if (i==1)
panel_coastline()
panel_coastline(coast=4,col="#007F00",fill="lightgreen",land=TRUE)
panel_coastline(coast=3,col="#0000003F",fill="#0000003F")
panel_coastline(coast=2,col="black",fill="black",density=20
,angle=c(-45,45),lwd=0.25,detail="l")
# panel_graticule(decor=4)
panel_annotation(text=as.character(i))
if (i==1)
panel_annotation(pos=c(1,1),text="default")
else if (i==2)
panel_annotation(pos=c(0,1),text="greyscale")
else if (i==3)
panel_annotation(pos=c(1,1),text="land is shadowed")
else if (i==4)
panel_annotation(pos=c(0,1),text="ocean is masked")
}
compose_legend(p2,p1)
compose_close()
# }
Run the code above in your browser using DataLab