Skip to main content

Module layout

Module layout 

Source
Expand description

Layout engine for computing plot area and margins.

This module determines where the plot area, title, axis labels, tick labels, and legend are positioned within the figure dimensions. It implements a mini tight-layout algorithm to prevent clipping and produce well-spaced plots.

Structs§

LayoutConfig
Configuration for layout computation.
LayoutResult
Result of the layout computation.
Margins
Margins in pixels around the plot area.

Functions§

compute_layout
Computes the layout for a single axes within a figure.
compute_layout_in_rect
Convenience wrapper that runs compute_layout within a specific rectangle (e.g., one cell of a subplot grid).
compute_subplot_rects
Computes subplot positions for a grid of axes.