https://github.com/hollylkirk/ochRe
Australia-themed Colour Palettes
https://github.com/hollylkirk/ochRe
ozunconf17 r r-package rstats unconf
Last synced: 3 months ago
JSON representation
Australia-themed Colour Palettes
- Host: GitHub
- URL: https://github.com/hollylkirk/ochRe
- Owner: hollylkirk
- License: other
- Created: 2017-10-25T23:09:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-04T11:37:25.000Z (over 1 year ago)
- Last Synced: 2024-09-18T21:40:37.463Z (9 months ago)
- Topics: ozunconf17, r, r-package, rstats, unconf
- Language: R
- Homepage: https://docs.ropensci.org/ochRe
- Size: 6.29 MB
- Stars: 56
- Watchers: 7
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
---
output:
github_document
---```{r,include=FALSE}
library(ochRe)
```# Australia-themed Colour Palettes
Ochre is a brownish-yellow pigment that occurs naturally in soils across Australia. Historically, ochre has been used for artwork by many indigenous cultures, including the Aboriginal people of Australia.
The goal of `ochRe` is to provide colour palettes inspired by Australian art, landscapes and wildlife. The palettes can be used in conjunction with `ggplot2` or `plot` to provide colours to data plots.
There are `r length(ochre_palettes)` different palettes (at the moment!), each one based on an iconic Australian artwork, landscape or creature.
Some palettes are more suitable for displaying qualitative data, others will look fabulous used in sequential plots.
More information can be found in the vignette, including which palettes work best for those with impaired colour vision.```r
# load the ochRe vignette
vignette("ochre")
```## Installation
You can install `ochRe` from github with:
```r
# You need to install the 'devtools' package first
devtools::install_github("ropenscilabs/ochRe")
```## The Palettes
```{r see_palettes, fig.height = 8}
pal_names <- names(ochre_palettes)par(mfrow=c(length(ochre_palettes)/2, 2), lheight = 2, mar=rep(1, 4), adj = 0)
for (i in 1:length(ochre_palettes)){
viz_palette(ochre_palettes[[i]], pal_names[i])
}
```## Example
This is a basic example of how to use the `namatjira_qual` palette in a plot.
```{r}
library(ochRe)
library(ggplot2)
ggplot(diamonds) + geom_bar(aes(x = cut, fill = clarity)) +
scale_fill_ochre()
```In this example we use the `winmar` palette directly via the `colorRampPalette()` function (for the base plot connoisseurs).
```{r}
## basic example code
pal <- colorRampPalette(ochre_palettes[["winmar"]])
image(volcano, col = pal(20))
```Individual palettes can be visualised using the viz_palette function
```{r}
viz_palette(ochre_palettes[["tasmania"]])
```