gg.matrix: Geom for matrix

View source: R/ggplot.R

gg.matrixR Documentation

Geom for matrix

Description

Creates a tile geom for plotting a matrix

Usage

## S3 method for class 'matrix'
gg(data, mapping = NULL, ...)

Arguments

data

A matrix object.

mapping

a set of aesthetic mappings created by aes. These are passed on to geom_tile.

...

Arguments passed on to geom_tile.

Details

Requires the ggplot2 package.

Value

A geom_tile with reversed y scale.

See Also

Other geomes: gg(), gg.RasterLayer(), gg.SpatRaster(), gg.Spatial, gg.data.frame(), gg.fm_mesh_1d(), gg.fm_mesh_2d(), gg.sf()

Examples

if (require("ggplot2", quietly = TRUE)) {
  A <- matrix(runif(100), nrow = 10)
  ggplot() +
    gg(A)
}

inlabru documentation built on July 28, 2026, 9:07 a.m.