knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
moRandi is a R package for Morandi color palette, Morandi colors refer to a muted and pale color palette, which is not bright as if covered with a layer of gray tone. Morandi colors has rich connotation without a tendency to show off, releasing the soothing elegance.
Giorgio Morandi (1890-1964) was an Italian painter and printmaker who specialized in still life. His paintings are noted for their tonal subtlety in depicting apparently simple subjects, which were limited mainly to vases, bottles, bowls, flowers and landscapes.
Morandi Palette Reference: morandi_color_palette.
Codes are deeply inspired by wesanderson.
Any contributions or improvements are very welcome.
library(devtools) devtools::install_github("narcisoyu/moRandi")
library(moRandi) morandi_show()
Choose the color(s) that you like!
NOTE: a numeric vector (in the following example, the x
is required, and the numbers are the colors you liked from the pie palette)
x <- c(6, 8, 13, 15, 28, 56) my_morandi_colors <- morandi_diy(my_colors = x) my_morandi_colors
library(moRandi) #For two variables plot morandi("Two_Variables1") morandi("Two_Variables2") #For three variables plot morandi("Three_Variables1") morandi("Three_Variables2") #Other options morandi("Cava") morandi("WildDream") morandi("SweetDream") morandi("MistyForest") morandi("Melancholy") morandi("Unicorn")
library("ggplot2") ggplot(mtcars, aes(factor(cyl), fill=factor(vs))) + geom_bar() + scale_fill_manual(values = morandi("Two_Variables2"))
morandi_heatmap_palette <- morandi("Melancholy", 100, type = "continuous") ## make some dummy data set.seed(123) data <- matrix(rnorm(100, 0, 10), nrow = 10, ncol = 10) colnames(data) <- paste0("col", 1:10) rownames(data) <- paste0("row", 1:10) ## apply morandi palette heatmap(data, col = morandi_heatmap_palette)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.