Skip to content

5_style_guide

Mark Ravinet edited this page Sep 12, 2025 · 6 revisions

Style guide - for working with sparrow data

Introduction

Now that we have been working with the Passer sparrow data over multiple years, we have developed some general themes and colour palettes that I would like to keep consistent across publications and presentations.

However, the emphasis here is that this is a style guide - i.e. it is not mandatory. These are resources that you might want to use to develop how you visualise your own data.

That said, if there is one thing I would like to ensure we use as much as possible, it is the same colours for the key species (i.e. house, Spanish, Italian).

Also, this guide is ocnstantly evolving so please do keep checking back and feel free to make suggestions of your own.

ggplot themes

For a lot of my plots, I use a ggplot theme that I declare at the start of my R scripts. See the code block below for this:

common_theme <- theme(legend.title = element_blank(),
                      legend.text = element_text(size = 13),
                      panel.grid.minor.x = element_blank(),
                      panel.grid.minor.y = element_blank(),
                      panel.grid.major.x = element_blank(),
                      panel.grid.major.y = element_blank(),
                      axis.title = element_text(size = 14),
                      axis.text = element_text(size = 13))

This basically removes the legend title, removes all the grid panels and increases the text on the axes. I typically combine it with the inbuilt ggplot theme - theme_light().

Colour pallettes

As highlighted above, I would like to keep colour palletes for the species as consistent as possible. The key colours are listed in the table below alongside their R colour name, their hexidecimal code and RGB values.

Species/subspecies Colour name hexidecimal R G B
bactrianus navyblue #000080 0 0 128
biblicus green4 #008B00 0 129 0
domesticus dodgerblue #1E90FF 30 144 255
hispaniolensis red4 #8B0000 139 0 0
hyrcanus springgreen1 #00FF7F 0 255 127
indicus. lightpink #FFAEB9 255 174 185
italiae gold #FFD700 255 215 0
persicus chocolate1 #FF7F24 255 127 36

General tips

  • When drawing PCA plots, ensure you use the + coord_equal() option. It is important that PCA coordinates on both axes are proportional so as not to over exaggerate divergence along a particular axis (i.e. typically PC2).

Clone this wiki locally