Skip to contents

Replaces the colour palette of a brain atlas, validating that value is a named character vector and warning if it does not cover every atlas label. This is the setter counterpart to the atlas_palette() accessor; it returns the modified atlas, so it composes with the pipe.

Usage

set_atlas_palette(atlas, value)

Arguments

atlas

a ggseg_atlas object

value

Named character vector of colours keyed by atlas label.

Value

The ggseg_atlas with its palette replaced.

See also

atlas_palette() to read the palette.

Examples

a <- aseg()
labs <- atlas_labels(a)
a <- set_atlas_palette(a, setNames(grDevices::rainbow(length(labs)), labs))