R/number_ticks.R

Defines functions number_ticks

Documented in number_ticks

#' Number of ticks for \code{ggplot2} plots
#'
#' Function for determining number of ticks on axis of \code{ggplot2} plots.
#' @param n Integer giving the desired number of ticks on axis of
#' \code{ggplot2} plots. Non-integer values are rounded down.
#' @section Details:
#' Based on function \code{pretty} (\code{dampack} package).
#' @export
number_ticks <- function(n) {
  function(limits) {
    pretty(limits, n + 1)
  }
}
SC-COSMO/sccosmomcma documentation built on Dec. 18, 2021, 11:56 a.m.