[R] xyplot ontop a contourplot (package: lattice)
Jay
josip.2000 at gmail.com
Fri Apr 16 15:43:42 CEST 2010
Hello,
I have a contourplot plot that shows the data I want. However, I would
like to point a certain amount of points from this plot via a
xyplot().
Example:
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, panel.xyplot(x~y))
But the point does not show up. What is the correct way to achieve
this?
More information about the R-help
mailing list