Description Usage See Also Examples
Rectangular geom parameterised by location of center
(x
and y
) and size (width
,
height
).
1 |
Other rectangular.geoms: geom_bar
,
geom_raster
, geom_rect
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | pp <- function (n,r=4) {
x <- seq(-r*pi, r*pi, len=n)
df <- expand.grid(x=x, y=x)
df$r <- sqrt(df$x^2 + df$y^2)
df$z <- cos(df$r^2)*exp(-df$r/6)
df
}
pp20 <- pp(20)
geom_plot(geom_tile(), pp20)
if (require("scales")) {
pp20$fill <- cscale(pp20$z, seq_gradient_pal())
}
geom_plot(geom_tile(), pp20)
geom_plot(geom_tile(list(width = 0.95, height = 0.95)), pp20)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.