get_coordinate_system: Which coordinate system does a plot use?

View source: R/coordinates.R

get_coordinate_systemR Documentation

Which coordinate system does a plot use?

Description

Which coordinate system does a plot use?

Usage

get_coordinate_system(p)

Arguments

p

A ggplot2 object

Value

A character string that corresponds to the suffix of a ggplot2 coord_ function, e.g. "cartesian".

See Also

Other functions for checking coordinate systems: uses_coordinate_system()

Examples

require(ggplot2)
p <- ggplot(data = mpg, mapping = aes(x = displ, y = hwy)) +
  geom_point(mapping = aes(color = class)) +
  geom_smooth() +
  coord_polar()
get_coordinate_system(p)

rstudio-education/ggcheck documentation built on May 12, 2023, 11:33 a.m.