Learn R Programming

tinyplot (version 0.8.0)

build_legend_args: Build legend arguments list

Description

Constructs and configures the legend_args list by:

  • Sanitizing legend input

  • Setting defaults for all legend parameters

  • Computing positioning flags from original position (before transformation)

  • Adjusting position anchors for outer legends

  • Adjusting for special cases (gradient, horizontal, multi-column)

  • Populating legend_env with args and positioning flags

Usage

build_legend_args(
  legend_env,
  legend,
  legend_args,
  by_dep,
  lgnd_labs,
  labeller = NULL,
  type,
  pch,
  lty,
  lwd,
  col,
  bg,
  cex,
  gradient
)

Value

NULL (modifies legend_env in-place)

Arguments

legend_env

Legend environment to populate

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