% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/guide-layout.R
\name{set_guide_layout}
\alias{set_guide_layout}
\title{set_guide_layout}
\usage{
set_guide_layout(
  x,
  legend_ncol = NULL,
  legend_byrow = FALSE,
  legend_title_position = NULL,
  legend_direction = NULL,
  legend_keywidth = NULL,
  legend_keyheight = NULL,
  legend_spacing_x = NULL,
  legend_spacing_y = NULL,
  guides_ncol = NULL,
  guides_byrow = FALSE,
  guides_direction = NULL
)
}
\arguments{
\item{x}{an 'aplot' object}

\item{legend_ncol}{number of columns used inside each individual legend.
Must be a positive integer. If `NULL`, the internal column layout of each
legend is left unchanged.}

\item{legend_byrow}{logical; whether keys inside each individual legend
should be filled row-wise when a multi-column legend is created. The
default is `FALSE`.}

\item{legend_title_position}{title position used inside each individual
legend. Must be one of `"top"`, `"bottom"`, `"left"`, or `"right"`.
If `NULL`, the current title position is left unchanged.}

\item{legend_direction}{direction used inside each individual legend. Must
be one of `"horizontal"` or `"vertical"`. If `NULL`, the current legend
direction is left unchanged.}

\item{legend_keywidth, legend_keyheight}{legend key size in millimeters for
each individual legend. These values are converted to
`grid::unit(..., "mm")` and passed to [ggplot2::guide_legend()]. If
`NULL`, the corresponding key dimension is left unchanged.}

\item{legend_spacing_x, legend_spacing_y}{spacing between legend items in
millimeters inside each individual legend. These values are converted to
`grid::unit(..., "mm")` and applied through [ggplot2::theme()] as
`legend.spacing.x` and `legend.spacing.y`. If `NULL`, the corresponding
spacing is left unchanged.}

\item{guides_ncol}{number of columns used to arrange multiple collected
legend boxes as a group. Must be a positive integer. If `NULL`, the group
layout stays in a single strip determined by `guides_direction`.}

\item{guides_byrow}{logical; whether collected legend boxes should be filled
row-wise when a wrapped guide group is created. The default is `FALSE`.}

\item{guides_direction}{overall direction used to arrange multiple collected
legend boxes. Must be one of `"horizontal"` or `"vertical"`. If `NULL`,
the default follows the guide placement side used by [set_guide_area()].}
}
\value{
an 'aplot' object
}
\description{
Set collected guide layout on an 'aplot' object
}
\details{
Control collected guides at two semantic levels when an 'aplot' object is
rendered. Use [set_guide_area()] to decide where guides should go, and use
`set_guide_layout()` to decide how they should be arranged once placed.
}
