Nothing
knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.height = 4, fig.width = 6 )
library(nic) library(tidyr) library(ggplot2) library(palmerpenguins) theme_set(theme_minimal())
The Sri Lanka Nature Inspired Color Palettes (nic) package contains a wide range of color palettes that you can use for your visualizations. All the color palettes are inspired by the natural color palettes in Sri Lanka. Color palettes are mainly divided to three categories based on their capability to show case colors.
In this tutorial we will be exploring all of the color palettes available within the nic
package. The names of the color palettes available within the nic
package are as follows.
names(nic_palettes)
penguins %>% drop_na() %>% ggplot(aes(x = bill_length_mm,y = bill_depth_mm,color=body_mass_g))+ geom_point()+ scale_color_gradientn(colors = nic_palette("orchid_12",12))+ labs(x = "Length of bill in milimetres",y = "Depth of bill in milimetres",color = "Body mass in grams")+ theme(legend.position = "top")
diamonds %>% ggplot(aes(x = cut,y = price,fill = cut))+ geom_violin()+ scale_fill_manual(values = nic_palette("ixora_8",5))
set.seed(42) tibble(Date = seq.Date(from = as.Date("2021-1-1"), to = as.Date("2021-12-31"),by = "day"), Returns = as.numeric(arima.sim(n = 365,list(ar = c(0.501))))) %>% ggplot(aes(x = Date,y = Returns,color = Returns))+ geom_line()+ scale_color_gradientn(colors = nic_palette("kandyan_dancer_6"))+ theme(legend.position = "bottom")
penguins %>% drop_na() %>% ggplot(aes(x = bill_length_mm,y = bill_depth_mm,color=species))+ geom_point()+ scale_color_manual(values = nic_palette("moss_rose_5",4))+ labs(x = "Length of bill in milimetres",y = "Depth of bill in milimetres",color = "Species")+ theme(legend.position = "top")
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.