save_grid
Mojo function 🡭
save_grid
fn def save_grid(plots: List[AnyChart], cells: List[GridCell], width: Int, height: Int, path: String, row_weights: List[Float64] = List(), col_weights: List[Float64] = List(), shared_y_scale: Bool = False, shared_x_scale: Bool = False, align_axes: Bool = False, title: String = "", dpi: Float64 = 72, tight: Bool = False)render_grid()’s counterpart that writes a file, picking the format from plots[0]’s theme or the path’s extension.
SVG output takes its accessible markup from plots[0]’s .labels(),
the same best-effort rule save_facets() uses: the <svg> root
needs exactly one title for a figure with many cells.
Args:
- plots (
List[AnyChart]): The charts, one per cell. - cells (
List[GridCell]): Where each plot goes. - width (
Int): Figure width. - height (
Int): Figure height. - path (
String): Where to write. - row_weights (
List[Float64]): Relative row heights, empty for equal rows. - col_weights (
List[Float64]): Relative column widths, empty for equal columns. - shared_y_scale (
Bool): Give every cell one y-domain. - shared_x_scale (
Bool): Give every cell one x-domain. The continuous marks pool their x extents; categorical cells must name the same categories in the same order. - align_axes (
Bool): Share plot-rect edges, asrender_grid(). - title (
String): A figure title above the cells, asrender_grid(). - dpi (
Float64): Pixels per inch for a raster export, assave()’s (#701):widthandheightare points, so 300 scales the figure, every cell’sTheme.scaleand the title band together. The vector formats ignore it. - tight (
Bool): Crop every format to the figure’s ink, assave()’s.
Raises:
Error: Whatever render_grid() raises, or a write failure.