This function provides a custom fill scale for ggplot2 plots based on the guidelines set by the American Marketing Association.

ama_scale_fill(
  use_color = FALSE,
  palette_name = "OkabeIto",
  grayscale_limits = c(0.2, 0.8)
)

Arguments

use_color

Logical. If TRUE, uses color, otherwise uses grayscale.

palette_name

Character. Name of the color palette to use.

grayscale_limits

Numeric vector. Limits for the grayscale gradient.

Value

A fill scale for a ggplot2 plot.

Examples

if (FALSE) {
library(ggplot2)
ggplot(mtcars, aes(mpg, wt, fill = gear)) + 
geom_point(shape = 21, size = 4) + 
ama_scale_fill()
}