Skip to contents

Creates a function that generates pretty axis breaks with Norwegian number formatting.

Usage

pretty_breaks(n = 5, formatting_fn = csstyle::format_num_as_nor_num_0, ...)

Arguments

n

Number of desired breaks. Default 5.

formatting_fn

Function applied to the break labels. Default format_num_as_nor_num_0().

...

Further arguments passed to pretty().

Value

A function that you can use for axis breaks.

See also

format_num_as_nor_num_0 is the default formatting_fn. every_nth thins labels on a discrete axis instead. The "Pretty breaks" section of vignette("csstyle") demonstrates pretty_breaks().

Examples

library(ggplot2)

# Use pretty breaks with default formatting
ggplot(mtcars, aes(x = mpg, y = hp)) +
  geom_point() +
  scale_x_continuous(breaks = pretty_breaks(n = 4))