axis limits. May be either a vector of 2 elements with lower and upper bounds, or a
single number (which is the upper bound, the lower bound is then assumed to be 0).
N
step size. The eventual intervals will be multiples of the divisors of N or
multiples of N when multiples_only is TRUE. Defaults to 10.
max_breaks
maximum amount of breaks, defaults to 10.
int_only
whether only integer divisors of N may be used as breaks, defaults to TRUE.
multiples_only
whether only multiples of N can be used as breaks, defaults to FALSE.
include_bounds
whether the resulting breaks should encompass min and max. Defaults to TRUE.
A sorted numerical vector with breaks of length |max_breaks|+2 when include_bounds is TRUE
and of size |max_breaks| otherwise.
Details
get_breaks is the base function and creates a vector of breaks ggplot_breaks is a wrapper and
makes usage easier in ggplot2. The limits of the axis may not be known beforehand,
but ggplot_breaks receives it from ggplot and then creates nice breaks.
# NOT RUN {get_breaks(24, N=12, max_breaks=15)
# }# NOT RUN {ggplot() + scale_x_continuous(breaks = ggplot_breaks(N=12, max_breaks=15))
# }# NOT RUN {# }