pkgdown/extra.css

Skip to contents

scale_color_hpa() creates a ggplot2 scale for color aesthetics using the color palettes from the Human Protein Atlas (HPA) project.

Usage

scale_color_hpa(palette)

Arguments

palette

The name of the palette to use. It should be one of the palettes from get_hpa_palettes().

Value

A ggplot2 scale for color aesthetics.

Examples

# Create an example dataframe
data <- data.frame(
  var1 = 1:10,
  var2 = seq(2, 20, by = 2),
  Sex = rep(c("M", "F"), each = 5)
)

# Create a plot
plot <- ggplot2::ggplot(data, ggplot2::aes(x = var1, y = var2, color = Sex)) +
  ggplot2::geom_point()
plot


# Add a custom palette
plot + scale_color_hpa("sex_hpa")