Description Usage See Also Examples
High performance rectangular geom parameterised by
location of center (x
and y
).
1 | geom_raster(aesthetics = list(), na.rm = FALSE)
|
Other rectangular.geoms: geom_bar
,
geom_rect
, geom_tile
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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_raster(), pp20)
if (require("scales")) {
pp20$fill <- cscale(pp20$z, seq_gradient_pal())
}
geom_plot(geom_raster(), pp20)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.