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")
Colour palettes are stored as a list called feathers_palettes
, and can
be accessed thus:
library(feathers)
names(feathers_palettes)
## [1] "spotted_pardalote" "plains_wanderer"
## [3] "bee_eater" "rose_crowned_fruit_dove"
## [5] "eastern_rosella" "oriole"
## [7] "princess_parrot" "superb_fairy_wren"
## [9] "cassowary" "yellow_robin"
## [11] "galah"
get_pal
returns the chosen palette as a vector of hex colour codes.
get_pal("eastern_rosella")
## [1] "#cd3122" "#f4c623" "#bee183" "#6c905e" "#2f533c" "#b8c9dc" "#2f7ab9"
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.
Image: Duncan McCaskill
Image: JJ Harrison
Image: Patrick_K59
Image: Sheba_Also
Image: Jim Bendon
Image: Patrick_K59
Image: Patrick_K59
Image: Nick Hobgood
Image: Patrick_K59
Image: Calistemon
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)
# 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)
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 ShandiyaB on Twitter or submit a pull request.