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)
Run the code above in your browser using DataLab