session_grid(NULL)
a <- pixelsize()
refval <- seq(450,650,by=25)
val <- refval[seq(refval) %% 2 == 1]
ref <- colorize(a,breakvalue=refval,pal.rich=45,pal.rotate=0)
p1 <- colorize(a,breakvalue=val,pal.rich=135,pal.rotate=0)
p2 <- colorize(a,value=val,pal.rich=-15,pal.rotate=0)
p3 <- colorize(a,value=refval)
# \donttest{
if (exam1 <- TRUE) {
compose_open(legend=list(list(1,"left"),list(1,"right")),scale=2)
panel_new()
# ct1 <- panel_raster(ref)
# ct2 <- panel_contour(p2,"colored line",palname="Greens",lwd=15,lwd.bg=0)
ct2 <- panel_contour(p2,"colored line",pal.rich=240,pal.rotate=0,lwd.fg=15,lwd.bg=0)
# panel_contour(ref,lwd=0)
# mysource("contour.R")
# mycontour(.panel_contour(a),lwd=0)
if (exists("ct1"))
compose_legend(ct1,units="raster")
if (exists("ct2"))
compose_legend(ct2,units="contour")
compose_close(bpp=8)
}
# }
if (exam2 <- TRUE) {
compose_open(layout=c(2,2),byrow=FALSE
,legend=list(list(1,"left"),list("bottom",1)
,list(1,"right"),list("top",2)
,list(2,"right"),list("bottom",2)))
panel_new()
panel_raster(ref)
panel_contour(a)
panel_new()
ct0 <- panel_contour(a,"color",value=val,pal.rich=240,pal.rotate=0,lwd=11,lwd.bg=12)
panel_contour(a)
panel_annotation(text="no colortable")
panel_new()
panel_raster(p1)
ct1 <- panel_contour(p1,"color",lwd=11,lwd.bg=2)
panel_contour(a)
panel_annotation(text="colortable:category")
panel_new()
panel_raster(p2)
ct2 <- panel_contour(p2,"color",lwd=11,lwd.bg=2)
panel_contour(a)#,cex=0.5)
panel_annotation(text="colortable:interval")
compose_legend(ref,units="reference")
compose_legend(ct0,units="contour")
compose_legend(p1,units="raster")
compose_legend(ct1,units="contour")
compose_legend(p2,units="raster")
compose_legend(ct2,units="contour")
compose_close()
}
# \donttest{
if (exam3 <- TRUE) {
s <- 29
session_grid(NULL)
a <- as.ursa(volcano)
if (FALSE) {
display(a)
a2 <- regrid(a,mul=s,cascade=TRUE,verbose=TRUE)
display(a2)
session_grid(a)
}
compose_open() ## device="windows")
panel_new()
ct1 <- panel_raster(a,ramp=FALSE,interval=TRUE)
ct2 <- panel_contour(a,"label")
rm(ct2)
panel_decor()
if (exists("ct2"))
legend_colorbar(ct2)
else if (exists("ct1"))
legend_colorbar(ct1)
compose_close()
}
# }
Run the code above in your browser using DataLab