Skip to contents

scale_x_integer() and scale_y_integer() are convenience wrappers around ggplot2::scale_x_continuous() and ggplot2::scale_y_continuous() that prefer clean integer breaks (for example avoiding 2.5-step breaks on ranges around 10).

Usage

scale_x_integer(n_breaks = 5, ...)

scale_y_integer(n_breaks = 5, ...)

Arguments

n_breaks

Approximate number of integer-preferred breaks, passed to base::pretty() as n.

...

Named arguments passed through to ggplot2::scale_x_continuous() or ggplot2::scale_y_continuous(), except breaks.

Breaks are generated using floor(pretty(x, n_breaks)). If you need to supply breaks directly, use ggplot2::scale_x_continuous() or ggplot2::scale_y_continuous() instead.

Value

A ggplot2 scale object.