library(feathers) library(dplyr)
This package contains colour palettes inspired by the plumage of Australian birds. For species exhibiting sexual dimorphism (i.e. males and females look different), I have used female colours. Research on birds has historically been biased towards males, and the choice to use female colours in this package is my way of highlighting the often-overlooked beauty of female birds.
This package is hosted on GitHub and can be installed using the devtools package:
devtools::install_github(repo = "shandiya/feathers", ref = "main")
feathers
Colour palettes are stored as a list called feathers_palettes
, and can be accessed thus:
library(feathers) names(feathers_palettes)
get_pal
returns the chosen palette as a vector of hex colour codes.
get_pal("eastern_rosella")
print_pal
displays the colour palette.
eastern_rosella <- get_pal("eastern_rosella") print_pal(eastern_rosella)
Colour palettes can be used for data visualisation in base R
and ggplot2
.
# base R library(palmerpenguins) plot(penguins$flipper_length_mm, penguins$body_mass_g, col = get_pal("rose_crowned_fruit_dove")[factor(penguins$species)], pch = 19) # ggplot2 library(ggplot2) library(palmerpenguins) ggplot(penguins) + geom_point(aes(flipper_length_mm, body_mass_g, colour = species)) + scale_colour_manual(values = get_pal("rose_crowned_fruit_dove"))
The images below show each palette and the bird that inspired it.
er <- get_pal("eastern_rosella") print_pal(er)
knitr::include_graphics("images/eastern_rosella_plot.png") knitr::include_graphics("images/eastern_rosella_img.png")
Image: Duncan McCaskill
pw <- get_pal("plains_wanderer") print_pal(pw)
knitr::include_graphics("images/plains_wanderer_plot.png") knitr::include_graphics("images/plains_wanderer_img.png")
Image: JJ Harrison
sp <- get_pal("spotted_pardalote") print_pal(sp)
knitr::include_graphics("images/spotted_pardalote_plot.png") knitr::include_graphics("images/spotted_pardalote_img.png")
Image: Patrick_K59
rcfd <- get_pal("rose_crowned_fruit_dove") print_pal(rcfd)
knitr::include_graphics("images/rose_crowned_fruit_dove_plot.png") knitr::include_graphics("images/rose_crowned_fruit_dove_img.png")
Image: Sheba_Also
be <- get_pal("bee_eater") print_pal(be)
knitr::include_graphics("images/bee_eater_plot.png") knitr::include_graphics("images/bee_eater_img.png")
Image: Jim Bendon
sfw <- get_pal("superb_fairy_wren") print_pal(sfw)
knitr::include_graphics("images/superb_fairy_wren_plot.png") knitr::include_graphics("images/superb_fairy_wren_img.png")
Image: Patrick_K59
pp <- get_pal("princess_parrot") print_pal(pp)
knitr::include_graphics("images/princess_parrot_plot.png")
oriole <- get_pal("oriole") print_pal(oriole)
knitr::include_graphics("images/oriole_plot.png") knitr::include_graphics("images/oriole_img.png")
Image: Patrick_K59
cass <- get_pal("cassowary") print_pal(cass)
knitr::include_graphics("images/cassowary_plot.png") knitr::include_graphics("images/cassowary_img.png")
Image: Nick Hobgood
robin <- get_pal("yellow_robin") print_pal(robin)
knitr::include_graphics("images/yellow_robin_plot.png") knitr::include_graphics("images/yellow_robin_img.png")
Image: Patrick_K59
gal <- get_pal("galah") print_pal(gal)
knitr::include_graphics("images/galah_plot.png") knitr::include_graphics("images/galah_img.png")
Image: Calistemon
bwk <- get_pal("blue_winged_kookaburra") print_pal(bwk)
knitr::include_graphics("images/blue_winged_kookaburra_plot.png") knitr::include_graphics("images/blue_winged_kookaburra_img.png")
Image: John
The qualitative colour palettes in feathers
may be converted into sequential or diverging palettes for different types of data visualisation using the colorRampPalette()
function.
# choose end colours seq_col <- get_pal("eastern_rosella")[c(2,7)] # create a gradient of 50 shades in between the selected colours colorRampPalette(seq_col)(50)
print_pal(colorRampPalette(seq_col)(50))
# choose end and middle colours div_col <- get_pal("oriole")[c(1,5,10)] # create a gradient of 50 shades in between the selected colours colorRampPalette(div_col)(50)
print_pal(colorRampPalette(div_col)(50))
There are many tools and packages which simulate different types of colour vision deficiency, such as Viz Palette, colorblindcheck, prismatic, and colorblindr. You may find these helpful in guiding your decisions about which colours to include in your visualisation to make it accessible to as many people as possible. Happy plotting!
These colour palettes are now available in Julia as part of the default colour schemes (ColorSchemes.jl). Use these colour palettes as you would any other built-in Julia colour scheme:
using ColorSchemes colorscheme[:cassowary] # or your bird of choice
If you would like to contribute to this package or have suggestions for improvement, please contact me on Bluesky or submit a pull request.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.