library(oce)
## simplest use
imagep(volcano)
## something oceanographic (internal-wave speed)
par(mfrow=c(1,1))
h <- seq(0, 50, length.out=200)
drho <- seq(1, 3, length.out=200)
speed <- outer(drho, h, function(drho, h) sqrt(9.8 * drho * h / 1024))
imagep(h, drho, speed, xlab="Equivalent depth [m]",
ylab=expression(paste(Delta*rho, "[kg/m^3]")),
zlab="Internal-wave speed [m/s]")
## fancy labelling on atan() function
x <- seq(0, 1, 0.01)
y <- seq(0, 1, 0.01)
angle <- outer(x,y,function(x,y) atan2(y,x))
imagep(x, y, angle, filledContour=TRUE, breaks=c(0, pi/4, pi/2),
col=c("lightgray", "darkgray"),
at=c(0, pi/4, pi/2),
labels=c(0, expression(pi/4), expression(pi/2)))
Run the code above in your browser using DataLab