flpalette: A high-contrast palette to use in ggplotFL

flpaletteR Documentation

A high-contrast palette to use in ggplotFL

Description

Plot methods defined in the ggplotFL package make use by default of a palette with a high contrast, useful to separate time series or categories. The palette consist of seven colours: red, blue, green, violet, orange, yellow and brown. This palette can be inspected at the [colorbrewe2.org site](http://colorbrewer2.org/?type=qualitative&scheme=Set1&n=7#type=qualitative&scheme=Set1&n=7).

Usage

flpalette

flpalette_colours(n = length(flpalette))

flpalette_grads(palette = flpalette, reverse = FALSE, ...)

scale_colour_flr(palette = flpalette, discrete = TRUE, reverse = FALSE, ...)

Arguments

n

Number of colours or individual colours to return, or number of colours to interpolate.

palette

Palette subset to create a gradual scale from, defaults to *flpalette*.

reverse

Should the palette be reversed, FALSE.

...

Elements to subset from palette, by name or position.

discrete

Is the palette to be applied to a discrete variable, TRUE.

Format

An object of class character of length 8.

Details

The palette is accessible as a named vector, *flpalette*. Two functions are also available to manipualte the palette. One to extract a subset of the palette, *flpalette_colours*, and another to create a gradation of colours between two or more of the palette colours, *flpalette_grads*.

Value

A named vector of colors and HEX codes, or a function to obtain a gradient of colors fo a given length.

Author(s)

The FLR Team

See Also

FLComp

Examples

# CHECK flpalette
 flpalette
 scales::show_col(flpalette)
flpalette_colours()
flpalette_colours(5)
flpalette_colours(2:3)
flpalette_grads(flpalette_colours(3))(20)

flr/ggplotFL documentation built on Feb. 10, 2024, 3:57 p.m.