get_ranges: Get ggplot scale ranges

View source: R/formatting.R

get_rangesR Documentation

Get ggplot scale ranges

Description

Given a ggplot object, get the ranges of the x and y scales.

Usage

get_ranges(p)

Arguments

p

A ggplot object

Value

Named list with x and y axis ranges

Examples

library(ggplot2)
p <- ggplot(data.frame(x1=1:100,y1=50:-49), aes(x=x1,y=y1)) + geom_point()
get_ranges(p)


BIO-RSG/oceancolouR documentation built on April 25, 2024, 12:28 p.m.