Skip to content
Cividis color scale for R
Branch: master
Clone or download
Latest commit 2ab965f Jan 21, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
data-raw reimplement cividis Jan 21, 2018
data
man
tests
.Rbuildignore
.gitignore reimplement cividis Jan 21, 2018
.travis.yml reimplement cividis Jan 21, 2018
DESCRIPTION reimplement cividis Jan 21, 2018
LICENSE reimplement cividis Jan 21, 2018
NAMESPACE reimplement cividis Jan 21, 2018
README-unnamed-chunk-10-1.png reimplement cividis Jan 21, 2018
README-unnamed-chunk-2-1.png reimplement cividis Jan 21, 2018
README-unnamed-chunk-3-1.png reimplement cividis Jan 21, 2018
README-unnamed-chunk-4-1.png
README-unnamed-chunk-41-1.png reimplement cividis Jan 21, 2018
README-unnamed-chunk-5-1.png
README-unnamed-chunk-9-1.png
README.Rmd
README.html
README.md
cividis.Rproj
codecov.yml

README.md

cividis

Build Status codecov

Jamie R. Nuñez, Christopher R. Anderton, and Ryan S. Renslow recently introduced optimized color maps for the scientific community. This so-called "cividis" colormap is generated by optimizing the "viridis" colormap and is optimal for viewing by those with or without color vision deficiency (CVD), a different visual perception of colors that affects 8.5% of the human population. It is designed to be perfectly perceptually-uniform, both in regular form and also when converted to black-and-white, and can be perceived by readers with all forms of color blindness. The cividis colormap was developed as a Python module called "cmaputil".

Because of the high interest of the scientific community in R, we make this new colormap available for R!

This is how it looks like:

... and like this in action (coloring neutral landscape models from NLMR):

Installation

To install the developmental version of cividis, use the following R code:

# install.packages("devtools")
devtools::install_github("marcosci/cividis")

Example

This is a basic example which shows you how to solve a common problem:

## basic example code

# load packages
library(NLMR)
library(rasterVis)
library(cividis)

# simulate NLM
x <- nlm_random(ncol = 100,
                nrow = 100)

# plot it
gplot(x) +
 geom_tile(aes(fill = value)) +
 labs(x = "Easting",
      y = "Northing") +
 theme_nlm() +
 scale_fill_cividis(
    na.value = "transparent",
    name = "",
    guide = ggplot2::guide_colorbar(
      barheight = ggplot2::unit(40, units = "mm"),
      barwidth = ggplot2::unit(1, units = "mm"),
      draw.ulim = FALSE,
      title.hjust = 0.5,
      title.vjust = 1.5,
      label.hjust = 0.5
 )) -> p1
#> Scale for 'fill' is already present. Adding another scale for 'fill',
#> which will replace the existing scale.

Maintainer(s)

Marco Sciaini - [@msciain](https://twitter.com/msciain) - sciaini.marco@gmail.com

Author(s)

Marco Sciaini - [@msciain](https://twitter.com/msciain) - sciaini.marco@gmail.com Cédric Scherer - [@CedScherer](https://twitter.com/CedScherer) - cedricphilippscherer@gmail.com

References

The colormap in the cividis package was created and published by Jamie R. Nuñez and her colleagues.

The package is mainly a cheeky copy of the beautiful viridis package for R that was created by Simon Garnier, Noam Ross, and Bob Rudis.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.