extract x or y ranges of a ggplot
Usage
yrange(gg, type = "limit", region = "panel")
xrange(gg, type = "limit", region = "panel")
ggrange(gg, var, type = "limit", region = "panel")Arguments
- gg
a ggplot object
- type
one of 'limit' or 'range', if 'region == "plot"', to extract plot limit or plot data range
- region
one of 'panel' or 'plot' to indicate extracting range based on the plot panel (scale expand will be counted) or plot data (scale expand will not be counted)
- var
either 'x' or 'y'