break_inc: Helper function for 'ggplot"s 'scale_x/y_continuous'

View source: R/break_inc.R

break_incR Documentation

Helper function for ggplot's scale_x/y_continuous

Description

Allows faceted free_x and free_y scales to have same break increments

Usage

break_inc(inc = 10, sf = 0.05, ...)

Arguments

inc

increments

sf

scaling factor (multiplicative expand) - higher sf will result in wider margins before ticks begin

Examples

library(ggplot2)
ggplot(data = iris, aes(x = Petal.Width, y = Sepal.Length)) +
  geom_point() +
  facet_grid( ~ Species, scales = "free") +
  scale_x_continuous(breaks=break_inc(inc=0.1, sf=.05),
                     expand = c(0.05, 0))

olsonma/mollr documentation built on Aug. 2, 2022, 9:17 p.m.