Set collected guide layout on an 'aplot' object
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
)an 'aplot' object
an 'aplot' object
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.
logical; whether keys inside each individual legend should be filled row-wise when a multi-column legend is created. The default is `FALSE`.
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.
direction used inside each individual legend. Must be one of `"horizontal"` or `"vertical"`. If `NULL`, the current legend direction is left unchanged.
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.
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.
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`.
logical; whether collected legend boxes should be filled row-wise when a wrapped guide group is created. The default is `FALSE`.
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()].
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.