pub struct SubplotGrid { /* private fields */ }Expand description
A structure representing a subplot grid layout.
The SubplotGrid struct facilitates the creation of multi-plot layouts arranged in a grid configuration.
Plots are automatically arranged in rows and columns in row-major order (left-to-right, top-to-bottom).
Each subplot retains its own title, axis labels, and legend, providing flexibility for displaying
multiple related visualizations in a single figure.
§Features
- Automatic grid layout with configurable rows and columns
- Individual subplot titles (extracted from plot titles)
- Independent axis labels for each subplot
- Configurable horizontal and vertical spacing
- Overall figure title
- Sparse grid support (fewer plots than grid capacity)
Implementations§
Source§impl SubplotGrid
impl SubplotGrid
Sourcepub fn regular<'f1, 'f2>() -> SubplotGridRegularBuilder<'f1, 'f2>
pub fn regular<'f1, 'f2>() -> SubplotGridRegularBuilder<'f1, 'f2>
Creates a subplot grid layout.
Arranges plots in a row * column grid with automatic positioning. Plots are placed
in row-major order (left-to-right, top-to-bottom). Each subplot retains its individual title
(from the plot’s plot_title), axis labels, and legend.
§Arguments
plots- Vector of plot references to arrange in the grid. Plots are positioned in row-major order.rows- Number of rows in the grid (default: 1).cols- Number of columns in the grid (default: 1).title- Overall title for the entire subplot figure (optional).h_gap- Horizontal spacing between columns (range: 0.0 to 1.0, default: 0.1).v_gap- Vertical spacing between rows (range: 0.0 to 1.0, default: 0.1).

Sourcepub fn irregular<'f1, 'f2>() -> SubplotGridIrregularBuilder<'f1, 'f2>
pub fn irregular<'f1, 'f2>() -> SubplotGridIrregularBuilder<'f1, 'f2>
Creates an irregular grid subplot layout with custom row/column spanning.
Allows plots to span multiple rows and/or columns, enabling dashboard-style layouts and asymmetric grid arrangements. Each plot explicitly specifies its position and span.
§Arguments
plots- Vector of tuples(plot, row, col, rowspan, colspan)where:plot: Reference to the plotrow: Starting row (0-indexed)col: Starting column (0-indexed)rowspan: Number of rows to span (minimum 1)colspan: Number of columns to span (minimum 1)
rows- Total number of rows in the grid (default: 1).cols- Total number of columns in the grid (default: 1).title- Overall title for the subplot figure (optional).h_gap- Horizontal spacing between columns (range: 0.0 to 1.0, default: 0.1).v_gap- Vertical spacing between rows (range: 0.0 to 1.0, default: 0.1).

Source§impl SubplotGrid
impl SubplotGrid
Sourcepub fn write_html(&self, path: impl Into<String>)
pub fn write_html(&self, path: impl Into<String>)
Write the subplot grid to an HTML file.
Sourcepub fn to_inline_html(&self, plot_div_id: Option<&str>) -> String
pub fn to_inline_html(&self, plot_div_id: Option<&str>) -> String
Render the subplot grid as an inline HTML snippet (no DOCTYPE/head).
Trait Implementations§
Source§impl Clone for SubplotGrid
impl Clone for SubplotGrid
Source§fn clone(&self) -> SubplotGrid
fn clone(&self) -> SubplotGrid
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SubplotGrid
impl !RefUnwindSafe for SubplotGrid
impl !Send for SubplotGrid
impl !Sync for SubplotGrid
impl Unpin for SubplotGrid
impl UnsafeUnpin for SubplotGrid
impl !UnwindSafe for SubplotGrid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more