% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/legend.R
\name{build_legend_env}
\alias{build_legend_env}
\title{Build legend environment}
\usage{
build_legend_env(
  legend,
  legend_args,
  by_dep,
  lgnd_labs,
  labeller = NULL,
  type,
  pch,
  lty,
  lwd,
  col,
  bg,
  cex,
  gradient,
  lmar,
  has_sub = FALSE,
  has_cap = FALSE,
  cap_text = NULL,
  new_plot = TRUE,
  dynmar_title_mar = NULL
)
}
\arguments{
\item{legend}{Legend placement keyword or list}

\item{legend_args}{Additional legend arguments}

\item{by_dep}{The (deparsed) "by" grouping variable name}

\item{lgnd_labs}{The legend labels}

\item{labeller}{Character or function for formatting labels}

\item{type}{Plot type}

\item{pch}{Plotting character(s)}

\item{lty}{Line type(s)}

\item{lwd}{Line width(s)}

\item{col}{Color(s)}

\item{bg}{Background fill color(s)}

\item{cex}{Character expansion(s)}

\item{gradient}{Logical indicating gradient legend}

\item{lmar}{Legend margins (inner, outer)}

\item{has_sub}{Logical indicating presence of sub-caption}

\item{new_plot}{Logical indicating if plot.new should be called}
}
\value{
Environment with complete legend specification
}
\description{
Creates the legend environment by:
\itemize{
\item Initializing environment with metadata
\item Calling build_legend_args() to construct legend arguments
\item Populating environment with arguments and positioning flags
\item Initializing margins and dimensions
}
}
\keyword{internal}
