hypo_legend_flag_pair: Constructs a legend of paired flags

View source: R/hypoimg_flags.R

hypo_legend_flag_pairR Documentation

Constructs a legend of paired flags

Description

hypo_legend_flag_pair combines several paired flag legend elements

Usage

hypo_legend_flag_pair(
  left,
  right,
  color_map,
  flag_lwd = 1,
  flag_line_color = NA,
  flag_radius_scale = 1,
  circle_color = NA,
  circle_lwd = 0.5,
  plot_names = FALSE,
  plot_name_size = 3,
  font_family = "sans",
  plot = TRUE
)

Arguments

left

string vector (manatory), one of the available flag IDs

right

string vector (manatory), one of the available flag IDs

color_map

color vector (a string, optional), the color map (must match the species vector in length)

flag_lwd

numeric skalar (optional), line width of the optional frame of the flag annotation

flag_line_color

color skalar (a string, optional), line width of the optional frame of the flag annotation

flag_radius_scale

numeric skalar (optional), scaling of the optional flag annotation frames diameter

circle_color

color skalar (a string, optional), the color of the background circle outline

circle_lwd

numeric skalar (optional), the width of the background circle outlines

plot_names

logical skalar (optional), should the species label be added?

plot_name_size

numeric skalar (optional), the species label size

font_family

string skalar (optional), the species label font family

plot

logical scalar (optional), toggle the output to be either a plot or a list of plots

Details

The function hypo_legend_flag_pair constructs a paired flag legend from two vectors of flags and a choosen color map (matching in length).

See Also

hypo_legend_single, hypo_legend_pair

Examples

clr <- RColorBrewer::brewer.pal(3,'Blues')

left_flag <- c('anguilla','barbados','trinidad_and_tobago')
right_flag <- c('usa','virgin_islands','cuba')

hypo_legend_flag_pair(left = left_flag, right = right_flag,
                      color_map = clr,
                      flag_lwd = 1, flag_line_color = 'black',
                      flag_radius_scale = 1,
                      circle_color = 'black', plot_names = TRUE)

k-hench/hypoimg documentation built on June 2, 2022, 1:49 a.m.