Tufte-like breaks for axes
Usage
base_breaks(x, scale = "x", addSegment = TRUE, ...)
base_breaks_x(x, addSegment = TRUE, ...)
base_breaks_y(x, addSegment = TRUE, ...)Value
A continuous position scale (class ScaleContinuousPosition)
with breaks spanning x. When addSegment = TRUE, a list containing
an axis-segment layer and the scale, suitable for adding to a
ggplot2 plot.
Functions
base_breaks_x(): Tufte-like breaks for X axisbase_breaks_y(): Tufte-like breaks for Y axis
Examples
p <- ggplot(mtcars, aes(x = wt, y = mpg)) +
geom_point() +
theme_minimal()
p
p + base_breaks(mtcars$wt, scale = "x") +
base_breaks(mtcars$mpg, scale = "y")