pub struct Grid<'a> { /* private fields */ }
Implementations§
Source§impl<'a> Grid<'a>
impl<'a> Grid<'a>
Sourcepub fn rows(&mut self, rows: u64) -> &mut Self
pub fn rows(&mut self, rows: u64) -> &mut Self
The number of rows in the grid. If you provide a 2D subplots
array or a yaxes
array, its length is used as the default. But it’s also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots.
Sourcepub fn roworder(&mut self, roworder: Roworder) -> &mut Self
pub fn roworder(&mut self, roworder: Roworder) -> &mut Self
Is the first row the top or the bottom? Note that columns are always enumerated from left to right.
default: top to bottom
Sourcepub fn columns(&mut self, columns: u64) -> &mut Self
pub fn columns(&mut self, columns: u64) -> &mut Self
The number of columns in the grid. If you provide a 2D subplots
array, the length of its longest row is used as the default. If you give an xaxes
array, its length is used as the default. But it’s also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots.
Sourcepub fn subplots(&mut self, subplots: &'a InfoArray) -> &mut Self
pub fn subplots(&mut self, subplots: &'a InfoArray) -> &mut Self
Used for freeform grids, where some axes may be shared across subplots but others are not. Each entry should be a cartesian subplot id, like xy or x3y2, or ** to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support domain
can place themselves in this grid separately using the gridcell
attribute.
Sourcepub fn xaxes(&mut self, xaxes: &'a InfoArray) -> &mut Self
pub fn xaxes(&mut self, xaxes: &'a InfoArray) -> &mut Self
Used with yaxes
when the x and y axes are shared across columns and rows. Each entry should be an x axis id like x, x2, etc., or ** to not put an x axis in that column. Entries other than ** must be unique. Ignored if subplots
is present. If missing but yaxes
is present, will generate consecutive IDs.
Sourcepub fn yaxes(&mut self, yaxes: &'a InfoArray) -> &mut Self
pub fn yaxes(&mut self, yaxes: &'a InfoArray) -> &mut Self
Used with yaxes
when the x and y axes are shared across columns and rows. Each entry should be an y axis id like y, y2, etc., or ** to not put a y axis in that row. Entries other than ** must be unique. Ignored if subplots
is present. If missing but xaxes
is present, will generate consecutive IDs.
Sourcepub fn pattern(&mut self, pattern: Pattern) -> &mut Self
pub fn pattern(&mut self, pattern: Pattern) -> &mut Self
If no subplots
, xaxes
, or yaxes
are given but we do have rows
and columns
, we can generate defaults using consecutive axis IDs, in two ways: coupled gives one x axis per column and one y axis per row. independent uses a new xy pair for each cell, left-to-right across each row then iterating rows according to roworder
.
default: coupled
Sourcepub fn xgap(&mut self, xgap: f64) -> &mut Self
pub fn xgap(&mut self, xgap: f64) -> &mut Self
Horizontal space between grid cells, expressed as a fraction of the total width available to one cell. Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids.
Sourcepub fn ygap(&mut self, ygap: f64) -> &mut Self
pub fn ygap(&mut self, ygap: f64) -> &mut Self
Vertical space between grid cells, expressed as a fraction of the total height available to one cell. Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids.