A tile grid drawn without cell borders — the right choice for a dense heatmap or an image, where borders would swamp the data.

geom_raster(mapping = NULL, data = NULL, color = NULL, alpha = NULL)

Arguments

mapping, data, color, alpha

As in geom_point().

Value

A Layer to add with +.

Examples

g <- expand.grid(x = 1:20, y = 1:20)
g$z <- as.vector(outer(1:20, 1:20, function(a, b) sin(a / 3) * cos(b / 3)))
ggnext(g, aes(x, y, color = z)) + geom_raster()
#> <ggnext plot>
#>   data:  400 x 3
#>   aes:   x = x, y = y, color = z
#>   layers: 1 
#>   coord: cartesian
#>   mode:  static