PNWColors

A Pacific Northwest inspired R color palette package

https://github.com/jakelawlor/pnwcolors

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
    Links to: springer.com, acs.org, zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.3%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

A Pacific Northwest inspired R color palette package

Basic Info
  • Host: GitHub
  • Owner: jakelawlor
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 11.3 MB
Statistics
  • Stars: 271
  • Watchers: 1
  • Forks: 21
  • Open Issues: 1
  • Releases: 0
Created almost 7 years ago · Last pushed almost 4 years ago
Metadata Files
Readme

README.md

PNWColors

Four years spent in the most beautiful place in the world, immortalized in an R color palette package. May the colors of Washington State and the Pacific Northwest live on in our presentation figures forever.

Palettes are pulled from photos I took in some of the dreamiest, most colorful, PNW-iest places I know. The Pantone Studio iPhone app helped me extract colors, and Chroma.js Color Palette Helper helped me adjust values to ensure that all palettes are color-blind safe to be used for attractive and inclusive data viz.

Structure of the code was inspired by the wesanderson and LaCroixColoR packages. See more examples on twitter.

Installation
Palettes
Functions
Examples
As Seen In
Contact

CRAN Downloads <!-- DOI --->

Install Package

```r

from CRAN

install.packages("PNWColors")

or dev version:

install.packages("devtools") devtools::install_github("jakelawlor/PNWColors") ```

Usage

```r library(PNWColors)

names(pnw_palettes) [1] "Starfish" "Shuksan" "Bay" "Winter" "Lake" "Sunset" "Shuksan2" [8] "Cascades" "Sailboat" "Moth" "Spring" "Mushroom" "Sunset2" "Anemone"
```

Palettes

  • Low Tide -- San Juan Islands, Washington

  • Mount Shuksan from Mount Baker Ski Resort -- North Cascades, Washington

  • A nice night for a late-summer sunset paddle -- Bellingham Bay, Washington

  • Seattle Snowpocalypse 2019 -- Anacortes, Washington

  • Best after-work sun spot West of the Mississippi -- Whistle Lake, Anacortes, Washington

  • Washington Park sunset -- Anacortes, Washington

  • Mount Shuksan, golden hour -- North Cascades, Washington ***

  • Watson Lake Trail End -- North Cascades, Washington

  • The most beautiful moth -- Vendovi Island, Washington

  • S/V Funky Dory, the maiden voyage -- Anacortes, Washington

  • Oyster Dome Sunset -- Chuckanut, Washington

  • Cherry Blossom Season -- Anacortes, Washington

  • Fieldtrip -- Anacortes, Washington

  • Life on a log -- Orcas Island, Washington

Building Palettes

Use the pnw_palette() function to build and view palettes. Inputs are 'name', 'n', and 'type' (continuous or discrete). 'Name' is required. If 'n' is blank, function will assume n is equal to the number of colors in the palette (5-8), but if n > palette length, it will automatically interpolate colors between. If 'type' is missing, the function will assume "discrete" if n < palette length, and "continuous" if n > palette length.

r pnw_palette(name="Starfish",n=7,type="discrete")

r pnw_palette("Winter",100)

r pnw_palette("Bay",8,type="continuous")

r pnw_palette("Moth",12)

Example Plots

Palettes can be easily integrated into Base R imaging or ggplot2.

r pal <- pnw_palette("Shuksan",100) image(volcano, col = pal)

r pal=pnw_palette("Lake",5, type = "discrete") ggplot(diamonds, aes(carat, fill = cut)) + geom_density(position = "stack") + scale_fill_manual(values=pal) + theme_classic()

```r pal=pnwpalette("Shuksan2",100) ggplot(data.frame(x = rnorm(1e4), y = rnorm(1e4)), aes(x = x, y = y)) + geomhex() + coordfixed() + scalefillgradientn(colours = pal) + themeclassic()

# Or, to switch the order, use rev(), see below scalefillgradientn(colours = rev(pal)) ```

r library(palmerpenguins) ggplot(data = penguins, aes(x = flipper_length_mm, y = body_mass_g)) + geom_point(aes(color = species, shape = species), size = 3) + scale_color_manual(values = pnw_palette("Bay",3)) + labs(title = "Penguin size, Palmer Station LTER", subtitle = "Flipper length and body mass for Adelie, Chinstrap and Gentoo Penguins", x = "Flipper length (mm)", y = "Body mass (g)", color = "Penguin species", shape = "Penguin species") + theme_classic()

r pal <- pnw_palette("Anemone",3) ToothGrowth$dose <- as.factor(ToothGrowth$dose) ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) + geom_violin(trim=FALSE)+ geom_boxplot(width=0.1, fill="white")+ labs(title="Plot of length by dose",x="Dose (mg)", y = "Length")+ scale_fill_manual(values=pal)+ theme_classic()

```r library(tidyverse) library(urbnmapr) pal <- pnwpalette("Winter",100) countydata %>% leftjoin(counties, by = "countyfips") %>% filter(statename =="Washington") %>% ggplot(mapping=aes(long,lat,group = group, fill = horate)) + geompolygon(color="black",size=.25) + scalefillgradientn(colours = pal) + coordmap(projection="albers",lat0=39,lat1=45) + theme(legend.title = elementtext(), legend.key.width = unit(.5,"in")) + labs(fill="Homeownership rate") + themevoid()

```

As Seen In:

Have you used PNWColors in something? Please share to grow the list!


Lawlor and Arellano 2020, Scientific Reports, Bay palette


Patel et al. 2020, Biogeochemistry, Sailboat palette


Nicholas et al. 2020, Journal of Physical Chemistry C, Sunset2 palette


Sobocinski, K.L. (2021). Salish Sea Institute, Starfish palette


Linardich et al. (2021). Global Change Biology, Bay palette


Green et al. (2022). Proceedings B., Bay palette



Contact

Reach me at jake.lawlor@mail.mcgill.ca or @Jake_Lawlor1

For Citation Information, see here: DOI

Jake Lawlor (2020). PNWColors: Color Palettes Inspired by Nature in the US Pacific Northwest. R package version 0.1.0. https://CRAN.R-project.org/package=PNWColors

This work was supported by NSF grant #1538626

Owner

  • Name: Jake Lawlor
  • Login: jakelawlor
  • Kind: user
  • Location: Montreal, QC

Researcher, ecologist, tide pool enthusiast | Asking why things are where they are and where else they might be someday.

GitHub Events

Total
  • Watch event: 23
  • Fork event: 4
Last Year
  • Watch event: 23
  • Fork event: 4

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 204
  • Total Committers: 3
  • Avg Commits per committer: 68.0
  • Development Distribution Score (DDS): 0.426
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Jake Lawlor 5****r 117
Jake Lawlor j****r@g****m 80
Cole Brookson c****n@g****m 7

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 2
  • Total pull requests: 2
  • Average time to close issues: 6 days
  • Average time to close pull requests: about 1 month
  • Total issue authors: 2
  • Total pull request authors: 1
  • Average comments per issue: 2.5
  • Average comments per pull request: 1.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • davidski (1)
  • bryevdv (1)
Pull Request Authors
  • colebrookson (2)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 339 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 1
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: PNWColors

Color Palettes Inspired by Nature in the US Pacific Northwest

  • Versions: 1
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 339 Last month
Rankings
Stargazers count: 1.9%
Forks count: 5.2%
Average: 17.2%
Dependent packages count: 18.1%
Dependent repos count: 23.9%
Downloads: 36.9%
Maintainers (1)
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • ggplot2 * suggests