discrete_breaks: Discrete Breaks

View source: R/scales.R

discrete_breaksR Documentation

Discrete Breaks

Description

Creates a function that can be passed to scales for creating discrete breaks at multilples of resolution.

Usage

discrete_breaks(resolution = 1)

Arguments

resolution

Resolution of the breaks

Value

A function that can be passed to scales functions as the breaks argument.

Examples

x <- rbinom(100, 100, 0.4)
p <- gf_bar( ~ x)
p |> gf_refine(scale_x_continuous(breaks = discrete_breaks()))
p |> gf_refine(scale_x_continuous(breaks = discrete_breaks(5)))
p |> gf_refine(scale_x_continuous(breaks = discrete_breaks(2)))

ggformula documentation built on Nov. 9, 2023, 5:08 p.m.