Skip to content

NHSD colour scales#4

Open
mirober wants to merge 4 commits into
codonlibrary:mainfrom
mirober:cols
Open

NHSD colour scales#4
mirober wants to merge 4 commits into
codonlibrary:mainfrom
mirober:cols

Conversation

@mirober

@mirober mirober commented Jan 28, 2020

Copy link
Copy Markdown

Adds a couple of utilities for creating consistently coloured GG plot graphs, with most colours taken from here.

The main ones are scale_colour_nhsd and scale_fill_nhs, example usage:

library(gapminder)
library(tidyverse)

countries <- c("United Kingdom", "China", "Gambia")

gapminder %>%
  filter(country %in% countries) %>%
  ggplot(aes(year, lifeExp, colour=country)) +
  geom_smooth(se = FALSE) +
  labs(
    title = "Life expectancy",
    x = "Year",
    y = "Expectancy",
    caption = "Source: gapminder (2020)"
    ) +
  theme_minimal() +
  scale_colour_nhsd("blue") +
  ggsave("test.png",
         type = "cairo",
         width = 7,
         height = 4,
  )

@murd0 murd0 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for being the first contributor, Mike!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants