Skip to contents

Binned (equal-interval or manual breaks) color scale specification

Usage

color_bin(
  expr,
  palette = NULL,
  bins = 5,
  domain = NULL,
  na_color = "#00000000",
  reverse = FALSE,
  clamp = TRUE
)

Arguments

expr

A formula selecting a numeric column (e.g. ~value).

palette

NULL, a palette name, or a vector of colors.

bins

Number of bins, or a numeric vector of breakpoints.

domain

Optional numeric range c(min, max); defaults to data range.

na_color

Color used for missing values.

reverse

Logical; reverse the palette.

clamp

Logical; if TRUE, clamp values outside domain to the ends.

Value

A color scale specification object.