Stream

Struct Stream 

Source
pub struct Stream { /* private fields */ }
Expand description

Implements functions to illustrate vector fields using streamlines and quiver plots

Implementations§

Source§

impl Stream

Source

pub fn new() -> Self

Creates a new Stream object

Source

pub fn draw<'a, T, U>(&mut self, xx: &'a T, yy: &'a T, uu: &'a T, vv: &'a T)
where T: AsMatrix<'a, U>, U: 'a + Display + Num,

Draws streamlines (stream plot) given x,y matrices and u,v matrices

From Matplotlib’s documentation:

  • xx, yy – 2D arrays. Evenly spaced strictly increasing arrays to make a grid. All rows of x must be equal and all columns of y must be equal; i.e., they must be as if generated by np.meshgrid(x, y).
  • uu, vv – 2D arrays. x and y-velocities. The number of rows and columns must match the length of y and x, respectively.
Source

pub fn draw_alt<'a, V, M, U>( &mut self, x: &'a V, y: &'a V, uu: &'a M, vv: &'a M, )
where V: AsVector<'a, U>, M: AsMatrix<'a, U>, U: 'a + Display + Num,

Draws streamlines (stream plot) given x,y vectors and u,v matrices

From Matplotlib’s documentation:

  • x, y – 1D arrays. Evenly spaced strictly increasing arrays to make a grid.
  • u, v – 2D arrays. x and y-velocities. The number of rows and columns must match the length of y and x, respectively.
Source

pub fn draw_arrows<'a, T, U>( &mut self, xx: &'a T, yy: &'a T, uu: &'a T, vv: &'a T, )
where T: AsMatrix<'a, U>, U: 'a + Display + Num,

Draws arrows (quiver plot) given matrices

From Matplotlib’s documentation:

  • xx, yy – 2D arrays. The x and y coordinates of the arrow locations.
  • uu, vv – 2D arrays. The x and y direction components of the arrow vectors.
Source

pub fn draw_arrows_alt<'a, T, U>( &mut self, x: &'a T, y: &'a T, u: &'a T, v: &'a T, )
where T: AsVector<'a, U>, U: 'a + Display + Num,

Draws arrows (quiver plot) given vectors

From Matplotlib’s documentation:

  • x, y – 1D arrays. The x and y coordinates of the arrow locations.
  • u, v – 1D arrays. The x and y direction components of the arrow vectors.
Source

pub fn set_color(&mut self, color: &str) -> &mut Self

Sets the line color (quiver or streamlines)

Source

pub fn set_streamline_linewidth(&mut self, width: f64) -> &mut Self

Sets the line width of streamlines

Source

pub fn set_streamplot_arrow_style(&mut self, style: &str) -> &mut Self

Sets the arrow style

Options:

  • -” – Curve : None
  • ->” – CurveB : head_length=0.4,head_width=0.2
  • -[” – BracketB : widthB=1.0,lengthB=0.2,angleB=None
  • -|>” – CurveFilledB : head_length=0.4,head_width=0.2
  • <-” – CurveA : head_length=0.4,head_width=0.2
  • <->” – CurveAB : head_length=0.4,head_width=0.2
  • <|-” – CurveFilledA : head_length=0.4,head_width=0.2
  • <|-|>” – CurveFilledAB : head_length=0.4,head_width=0.2
  • ]-” – BracketA : widthA=1.0,lengthA=0.2,angleA=None
  • ]-[” – BracketAB : widthA=1.0,lengthA=0.2,angleA=None,widthB=1.0,lengthB=0.2,angleB=None
  • fancy” – Fancy : head_length=0.4,head_width=0.4,tail_width=0.4
  • simple” – Simple : head_length=0.5,head_width=0.5,tail_width=0.2
  • wedge” – Wedge : tail_width=0.3,shrink_factor=0.5
  • |-|” – BarAB : widthA=1.0,angleA=None,widthB=1.0,angleB=None
  • As defined in https://matplotlib.org/stable/api/_as_gen/matplotlib.patches.FancyArrowPatch.html
Source

pub fn set_streamplot_density(&mut self, density: f64) -> &mut Self

Sets the density of streamlines

Source

pub fn set_streamline_zorder(&mut self, zorder: usize) -> &mut Self

Sets the z-order of streamlines

Source

pub fn set_streamplot_extra(&mut self, extra: &str) -> &mut Self

Source

pub fn set_quiver_inv_scale(&mut self, scale: f64) -> &mut Self

Sets the quiver inverse scale

Source

pub fn set_quiver_pivot(&mut self, pivot: &str) -> &mut Self

Sets the quiver pivot

Options: ‘tail’, ‘mid’, ‘middle’, ‘tip’

Default = ‘tail’

Source

pub fn set_quiver_zorder(&mut self, zorder: usize) -> &mut Self

Sets the quiver z-order

Source

pub fn set_quiver_extra(&mut self, extra: &str) -> &mut Self

Trait Implementations§

Source§

impl GraphMaker for Stream

Source§

fn get_buffer<'a>(&'a self) -> &'a String

Returns the text buffer with Python3 commands
Source§

fn clear_buffer(&mut self)

Clear the text buffer with Python commands

Auto Trait Implementations§

§

impl Freeze for Stream

§

impl RefUnwindSafe for Stream

§

impl Send for Stream

§

impl Sync for Stream

§

impl Unpin for Stream

§

impl UnwindSafe for Stream

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.