Skip to contents

Adds a histogram layer with automatic binning.

Usage

mark_histogram(
  plot,
  mapping = NULL,
  data = NULL,
  position = NULL,
  ...,
  rasterize = FALSE,
  rasterize_dpi = 300,
  rasterize_dev = "cairo"
)

Arguments

plot

A plotit object

mapping

Optional new aesthetics

data

Optional data for this layer

position

Position adjustment.

...

Other arguments passed to geom_histogram

rasterize

If TRUE, rasterize via ggrastr::rasterise().

rasterize_dpi

DPI for rasterization (default 300).

rasterize_dev

Graphics device for rasterization (default "cairo").

Value

Modified plotit object

Examples

plotit(iris, encode(x = Sepal.Width)) |> mark_histogram()
#> `stat_bin()` using `bins = 30`. Pick better value `binwidth`.