scale_fill_profinit {profiplots}R Documentation

Fill scale constructor for Profinit colors.

Description

Fill scale constructor for Profinit colors.

scale_fill_profinit_d - Discrete Profinit fill scale (similar to scale_fill_viridis_d). It can't be used with continuous variables.

scale_fill_profinit_c - Continuous Profinit fill scale (similar to scale_fill_viridis_c). It can't be used with discrete variables.

Usage

scale_fill_profinit(
  palette = "blue-red",
  discrete = TRUE,
  reverse = FALSE,
  exact = NULL,
  ...
)

scale_fill_profinit_d(palette = "blue-red", ...)

scale_fill_profinit_c(palette = "blue-red", ...)

Arguments

palette

Character name of palette in profinit_palettes

discrete

Boolean, indicating whether color aesthetic is discrete or not

reverse

Boolean, indicating whether the palette should be reversed

exact

Indicates whether the color scale is supposed to be followed exactly. Be ware, you may run out of colors. Defaults to TRUE for discrete palette names, FALSE otherwise.

...

Additional arguments passed to discrete_scale() or scale_fill_gradientn(), used respectively when discrete is TRUE or FALSE

Value

Ggplot2 fill scale constructor based on Profinit color palette.

Examples

library(ggplot2)
plt <- ggplot(ggplot2::diamonds, ggplot2::aes(x = clarity, y = price, fill = clarity)) +
  geom_boxplot() +
  theme_profinit()

plt + scale_fill_profinit()

# Discrete scale, follow exact color codes (default for the `discrete` palette).
# ! You may run out of colors - see the example below.
# Use either exact = FALSE (next example) or `discrete-full` palette.
plt + scale_fill_profinit("discrete")

# Now, the colors are approximated
plt + scale_fill_profinit("discrete", exact = FALSE)


[Package profiplots version 0.2.3 Index]