Struct Grid

Source
pub struct Grid<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Grid<'a>

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

pub fn domain(&mut self) -> &mut Domain<'a>

Source

pub fn xside(&mut self, xside: Xside) -> &mut Self

Sets where the x axis labels and titles go. bottom means the very bottom of the grid. bottom plot is the lowest plot that each x axis is used in. top and top plot are similar.

default: bottom plot

Source

pub fn yside(&mut self, yside: Yside) -> &mut Self

Sets where the y axis labels and titles go. left means the very left edge of the grid. left plot is the leftmost plot that each y axis is used in. right and right plot are similar.

default: left plot

Trait Implementations§

Source§

impl<'a> Default for Grid<'a>

Source§

fn default() -> Grid<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> Serialize for Grid<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Grid<'a>

§

impl<'a> RefUnwindSafe for Grid<'a>

§

impl<'a> Send for Grid<'a>

§

impl<'a> Sync for Grid<'a>

§

impl<'a> Unpin for Grid<'a>

§

impl<'a> UnwindSafe for Grid<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.