scale_color_mn | R Documentation |
Setup colour palette for ggplot2
scale_color_mn(
palette = "primary_extended",
discrete = TRUE,
alpha = 1,
reverse = FALSE,
...
)
scale_colour_mn(
palette = "primary_extended",
discrete = TRUE,
alpha = 1,
reverse = FALSE,
...
)
palette |
Choose from 'mn_palettes' list |
discrete |
whether to use a discrete colour palette |
alpha |
transparency |
reverse |
logical, Reverse the order of the colours? |
... |
additional arguments to pass to scale_color_gradientn |
library(tidyverse)
ggplot(mpg, aes(hwy)) +
geom_bar(aes(fill = class)) +
scale_fill_mn(palette = "accent")
ggplot(mtcars, aes(wt, mpg)) +
geom_point(aes(color = hp), size = 5, alpha = 0.9) +
scale_color_mn(palette = "blue", discrete = FALSE, reverse = TRUE)
ggplot(mpg) +
geom_point(aes(x = cty, y = hwy, color = class), size = 5, alpha = 0.7) +
scale_color_mn(palette = "primary_accent")
ggplot(diamonds) +
geom_bar(aes(x = cut, fill = clarity)) +
scale_fill_mn("primary_extended")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.