[R] Horizontal color bar in filled.contour()
Sundar Dorai-Raj
sundar.dorai-raj at PDF.COM
Wed Aug 4 23:31:52 CEST 2004
Jenny Fox wrote:
> Hello.
>
> I was wondering if it is possible to put the color bar (key) on the
> bottom of the graph, like the "horizontal" toggle in image.plot, rather
> than on the right side. Does anyone know if this is possible?
>
> --jenny
>
It does not appear so by taking a rough looking at code for
filled.contour. You should consider using levelplot in package:lattice.
library(lattice)
x <- seq(pi/4, 5 * pi, length = 100)
y <- seq(pi/4, 5 * pi, length = 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))
lset(theme = col.whitebg())
levelplot(z~x*y, grid, cuts = 50, scales=list(log="e"), xlab="",
ylab="", main="Weird Function", sub="with log scales",
colorkey = list(space = "bottom"), region = TRUE)
--sundar
More information about the R-help
mailing list