plot_legend: Plot the legend

Description Usage Arguments Value Examples

View source: R/plotting.R

Description

Plots just the legend given a list of named oclors

Usage

1
plot_legend(color_mapping)

Arguments

color_mapping

a list of named colors

Value

ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(TraMineR)
data(mvad)
seqstatl(mvad[, 17:86])
mvad.alphabet <- c("employment", "FE", "HE", "joblessness", "school",
                   "training")
mvad.labels <- c("employment", "further education", "higher education",
                 "joblessness", "school", "training")
mvad.seq <- seqdef(mvad, 17:86, alphabet = mvad.alphabet,
                   labels = mvad.labels, xtstep = 6)
color_mapping <- viridis::viridis_pal()(length(alphabet(mvad.seq)))
names(color_mapping) <- alphabet(mvad.seq)
plot_legend(color_mapping)

joemarlo/sequenchr documentation built on Sept. 29, 2021, 12:23 a.m.