get_geom_defaults: Resolve and get geom defaults

View source: R/geom-defaults.R

get_geom_defaultsR Documentation

Resolve and get geom defaults

Description

Resolve and get geom defaults

Usage

get_geom_defaults(geom, theme = theme_get())

Arguments

geom

Some definition of a geom:

  • A function that creates a layer, e.g. geom_path().

  • A layer created by such function

  • A string naming a geom class in snake case without the geom_-prefix, e.g. "contour_filled".

  • A geom class object.

theme

A theme object. Defaults to the current global theme.

Value

A list of aesthetics

Examples

# Using a function
get_geom_defaults(geom_raster)

# Using a layer includes static aesthetics as default
get_geom_defaults(geom_tile(fill = "white"))

# Using a class name
get_geom_defaults("density_2d")

# Using a class
get_geom_defaults(GeomPoint)

# Changed theme
get_geom_defaults("point", theme(geom = element_geom(ink = "purple")))

tidyverse/ggplot2 documentation built on Jan. 29, 2025, 6:53 a.m.