答案 0 :(得分:1)
这样的东西?
library(lattice)
x <- seq(pi / 4, 5 * pi, length.out = 100)
y <- seq(pi / 4, 5 * pi, length.out = 100)
r <- as.vector(sqrt(outer(x ^ 2, y ^ 2, "+")))
grid <- expand.grid(x = x, y = y)
grid$z <- cos(r ^ 2) * exp(-r / (pi ^ 3))
levelplot(z ~ x * y, grid, cuts = 50,
scales = list(y = list(at = c(pi, 2 * pi, 3 * pi, 4 * pi),
label = c("pi", "2pi", "3pi", "4pi"))))
顺便说一句,请在下次创建自己的可重复示例。