getPlotDims {FastUtils}R Documentation

Get the xmin, xmax, ymin, ymax of a ggplot Object

Description

This function retrieves the minimum and maximum x and y dimensions of a ggplot object. Note that it is the dimension of the plot within the x and y axis and not the dimensions of the actual output image itself. This may be useful for numerical computations when modifying plots, but can be slow since it builds the actual plot first.

Usage

getPlotDims(plt)

Arguments

plt

A ggplot object.

Value

A list with elements xr (a vector of xmin and xmax) and yr (a vector of ymin and ymax).

Examples

library(ggplot2)
getPlotDims(ggplot(mtcars) + geom_point(aes(mpg, cyl)))


[Package FastUtils version 0.1.1 Index]