Skip to contents

This function creates a binned fill scale using the MNB (Magyar Nemzeti Bank) divergent color palette for ggplot2.

Usage

scale_color_mnb_divergent_b(
  n.breaks = NULL,
  breaks = waiver(),
  rev = FALSE,
  ...
)

Arguments

n.breaks

Optional. Number of breaks for the binned scale. If NULL, the number of breaks is determined by the breaks parameter.

breaks

Optional. A vector of break points for the binned scale. Default is waiver(), which lets ggplot2 determine the breaks.

rev

Logical. If TRUE, reverses the order of the colors. Default is FALSE.

...

Additional arguments passed to ggplot2::binned_scale().

Value

A ggplot2 binned fill scale object using the MNB divergent color palette.

Examples

library(ggplot2)
ggplot(iris, aes(Sepal.Length, Sepal.Width, fill = Petal.Length)) + 
  geom_point() +
  scale_color_mnb_divergent_b(n.breaks = 5, rev = TRUE)
#> Error in as.vector(x, "character"): cannot coerce type 'closure' to vector of type 'character'