Learn R Programming

tinyplot (version 0.8.0)

build_legend_env: Build legend environment

Description

Creates the legend environment by:

  • Initializing environment with metadata

  • Calling build_legend_args() to construct legend arguments

  • Populating environment with arguments and positioning flags

  • Initializing margins and dimensions

Usage

build_legend_env(
  legend,
  legend_args,
  by_dep,
  lgnd_labs,
  labeller = NULL,
  type,
  type_hints = NULL,
  pch,
  lty,
  lwd,
  col,
  bg,
  cex,
  gradient,
  lmar,
  has_sub = FALSE,
  has_cap = FALSE,
  cap_text = NULL,
  new_plot = TRUE,
  dynmar_title_mar = NULL
)

Value

Environment with complete legend specification

Arguments

legend

Legend placement keyword or list

legend_args

Additional legend arguments

by_dep

The (deparsed) "by" grouping variable name

lgnd_labs

The legend labels

labeller

Function, character keyword, or dictionary (named vector or list) for formatting or relabelling the labels. See tinylabel for the accepted forms.

type

Plot type

pch

Plotting character(s)

lty

Line type(s)

lwd

Line width(s)

col

Color(s)

bg

Background fill color(s)

cex

Character expansion(s)

gradient

Logical indicating gradient legend

lmar

Legend margins (inner, outer)

has_sub

Logical indicating presence of sub-caption

new_plot

Logical indicating if plot.new should be called