legend_timeline {colorist}R Documentation

Make an HCL legend for a linear sequence of distributions

Description

This function creates a legend to accompany a map describing a linear sequence of distributions.

Usage

legend_timeline(
  palette,
  specificity = TRUE,
  time_labels = NULL,
  label_i = "Maximum\nintensity",
  label_l = "Layer",
  label_s = c("Low specificity", "Moderate specificity", "High specificity"),
  axis_i = c("low", "high"),
  return_df = FALSE
)

Arguments

palette

data frame containing a color palette generated by palette_timeline.

specificity

logical indicating whether to visualize intensity and layer information for three specificity values (i.e., 0, 50, 100) or for a single specificity value (i.e., 100). Typically, a single specificity value is appropriate for map_multiples visualizations.

time_labels

character vector with two elements to be used as labels for the start and end points of the time axis (i.e. x-axis) in the legend.

label_i

character vector with a single element describing the meaning of intensity values.

label_l

character vector with a single element describing the meaning of layer values.

label_s

character vector with three elements describing differences in the meaning of specificity across three legend wheels.

axis_i

character vector with two elements describing the meaning of low and high intensity values.

return_df

logical indicating whether to return the legend as a ggplot2 object or return a data frame containing the necessary data to build the legend.

Value

A ggplot2 plot object of the legend. Alternatively, return_df = TRUE will return a data frame containing a data frame containing the data needed to build the legend. The data frame columns are:

See Also

legend_timecycle for cyclical sequences of distributions and legend_set for distributions of distinct groups.

Other legend: legend_set(), legend_timecycle()

Examples

# load fisher data
data(fisher_ud)

# generate hcl palette
pal <- palette_timeline(fisher_ud)

# create legend for palette
legend_timeline(pal)

[Package colorist version 0.1.2 Index]