scale_color_doypa {DOYPAColors}R Documentation

Color scale for ggplot2 with DOYPAColors color palettes

Description

This function sets the color scale for ggplot2 using DOYPAColors color palettes.

Usage

scale_color_doypa(
  palette = NULL,
  n = NULL,
  reverse = FALSE,
  ramp = FALSE,
  discrete = FALSE,
  ...
)

Arguments

palette

Character string specifying the desired palette name. Available palettes: list_doypa_pals().

n

Number of colors needed.

reverse

Boolean indicating whether to reverse the order of colors in the palette (default: FALSE).

ramp

Boolean indicating whether to use a color ramp (gradient) or a vector of colors (default: FALSE).

discrete

Boolean indicating whether to generate a discrete or continuous palette (default: continuous).

...

Additional parameters to pass to ggplot2's scale_color functions.

Value

A 'ggplot2' color scale suitable for adding to a 'ggplot2' object to control color aesthetics.

Examples

library(ggplot2)

# Discrete data
data(iris)
disc <- ggplot(iris, aes(x = Petal.Width, y = Petal.Length, color = Species)) +
  geom_point() + theme_classic()
disc <- disc + scale_color_doypa(palette = "buzz", discrete = TRUE)
print(disc)

# Continuous data
cont <- ggplot(iris, aes(x = Petal.Width, y = Petal.Length, color = Sepal.Length)) +
  geom_point() + theme_classic()
cont <- cont + scale_color_doypa(palette = "buzz")
print(cont)

[Package DOYPAColors version 0.0.1 Index]