viridis_magma_palette: Viridis-Magma Palette Function

Description Usage Arguments Details Value See Also Examples

View source: R/palettes.R

Description

A function that returns a color palette function based off of the viridis package.

Usage

1
2
3
4
viridis_magma_palette(viridis_number = 800,
  viridis_range = 300:viridis_number, viridis_rev = TRUE,
  magma_number = 500, magma_range = 50:magma_number,
  magma_rev = FALSE, ...)

Arguments

viridis_number

The total number of colors used to generate the viridis palette. Default: 800

viridis_range

Tne range of colors in the viridis palette to use. Default: 300:viridis_number

viridis_rev

A logical for reversing the viridis palette. Default: TRUE

magma_number

The total number of colors used to generate the magma palette. Default: 500

magma_range

The range of colors in the magma palette to use. Default: 0:magma_number

magma_rev

A logical for reversing the magma palette. Default: FALSE

...

These dots are optionally used as both the magma and viridis function parameters.

Details

The primary purpose of this function is to return a palette-function for generating virdis style color palettes. By taking the viridis::viridis() and the viridis::magma() colors, and manipulating them, this function can help create a unique set of colors that you can distinguish on a busy plot. The hopes of this function is to help improve plots that use more than 20 colors. Use the provided example to view the color palette.

Value

The output of this function is another function (grDevoces::colorRampPalette), which takes a number to generate an interpolated color palette as a character vector.

See Also

combination_palette

viridis, magma

colorRamp

Other Color Palettes: combination_palette, get_color_palette, scico_palette, viridis_palette

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
if(interactive()){
 # Use the default values
 > pal_func <- viridis_palette()

 # Get a palette with 20 colors
 > pal <- pal_func(20)

 # Make a pie plot of the colros.
 > pie(rep(1, length(pal)), col=pal)
 }

## End(Not run)

vallenderlab/MicrobiomeR documentation built on Aug. 30, 2019, 11:24 p.m.