Displaying 1 result from an estimated 1 matches for "levelplot1".
Did you mean:
levelplot
2011 Dec 31
2
How to color a region in a contour plot with the contour being the boundary?
...)
z <- outer(x, y, FUN=function(x, y) pmax(f(x) + f(y) - 10, 0))
## determine colors
zcols <- c(gray(0.2), gray(seq(0.5, 1, length.out=50)), rep("#FFFFFF", max(z)-51)) # colors with dark gray in the beginning for z <= 0.02 and many whites for z > 50
## trial 1
pdf(file="levelplot1.pdf", width=6, height=6)
image(x, y, z, xaxs="r", yaxs="r", col=zcols)
contour(x, y, z, levels=c(0.02, 1, 5, 10, 20, 50, 500), add=TRUE)
dev.off()
## trial 2
pdf(file="levelplot2.pdf", width=6, height=6)
image(x, y, z, xaxs="r", yaxs="r", col=...