R/limits_from_ggplot.R

Defines functions limits_from_ggplot

limits_from_ggplot <- function(gg,
                               variable = "x"){
    lim <- c(min(ggplot2::ggplot_build(gg)$data[[1]][variable],
                  na.rm = TRUE),
              max(ggplot2::ggplot_build(gg)$data[[1]][variable],
                  na.rm = TRUE)
             )
    return(lim)
}
RajLabMSSM/echoannot documentation built on Oct. 26, 2023, 2:41 p.m.