Description Usage Arguments Value Examples
Plots just the legend given a list of named oclors
1 | plot_legend(color_mapping)
|
color_mapping |
a list of named colors |
ggplot object
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.