get_axis_range: Get axis range of a ggplot object

View source: R/get_axis_range.R

get_axis_rangeR Documentation

Get axis range of a ggplot object

Description

A function to calculate the range of x- and y- axes.

Usage

get_axis_range(plot)

Arguments

plot

ggplot output from csv_to_ggplot()

Value

A list object that has two elements, each of which has two vector values. The first element stores the minimum and maximum values of the plot's x-axis range, while the second element stores the minimum and maximum values of the plot's y-axis range.

Examples

library(ggplot2)
ggplot(mtcars) + geom_point(aes(mpg, disp)) -> p1
get_axis_range(p1)


ggsem documentation built on Oct. 16, 2026, 1:06 a.m.