pub struct Stream { /* private fields */ }Expand description
Implements functions to illustrate vector fields using streamlines and quiver plots
Implementations§
Source§impl Stream
impl Stream
Sourcepub fn draw<'a, T, U>(&mut self, xx: &'a T, yy: &'a T, uu: &'a T, vv: &'a T)
pub fn draw<'a, T, U>(&mut self, xx: &'a T, yy: &'a T, uu: &'a T, vv: &'a T)
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.
Sourcepub fn draw_alt<'a, V, M, U>(
&mut self,
x: &'a V,
y: &'a V,
uu: &'a M,
vv: &'a M,
)
pub fn draw_alt<'a, V, M, U>( &mut self, x: &'a V, y: &'a V, uu: &'a M, vv: &'a M, )
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.
Sourcepub fn draw_arrows<'a, T, U>(
&mut self,
xx: &'a T,
yy: &'a T,
uu: &'a T,
vv: &'a T,
)
pub fn draw_arrows<'a, T, U>( &mut self, xx: &'a T, yy: &'a T, uu: &'a T, vv: &'a T, )
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.
Sourcepub fn draw_arrows_alt<'a, T, U>(
&mut self,
x: &'a T,
y: &'a T,
u: &'a T,
v: &'a T,
)
pub fn draw_arrows_alt<'a, T, U>( &mut self, x: &'a T, y: &'a T, u: &'a T, v: &'a T, )
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.
Sourcepub fn set_color(&mut self, color: &str) -> &mut Self
pub fn set_color(&mut self, color: &str) -> &mut Self
Sets the line color (quiver or streamlines)
Sourcepub fn set_streamline_linewidth(&mut self, width: f64) -> &mut Self
pub fn set_streamline_linewidth(&mut self, width: f64) -> &mut Self
Sets the line width of streamlines
Sourcepub fn set_streamplot_arrow_style(&mut self, style: &str) -> &mut Self
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
Sourcepub fn set_streamplot_density(&mut self, density: f64) -> &mut Self
pub fn set_streamplot_density(&mut self, density: f64) -> &mut Self
Sets the density of streamlines
Sourcepub fn set_streamline_zorder(&mut self, zorder: usize) -> &mut Self
pub fn set_streamline_zorder(&mut self, zorder: usize) -> &mut Self
Sets the z-order of streamlines
Sourcepub fn set_streamplot_extra(&mut self, extra: &str) -> &mut Self
pub fn set_streamplot_extra(&mut self, extra: &str) -> &mut Self
Sets extra options for streamlines
See https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.streamplot.html
Sourcepub fn set_quiver_inv_scale(&mut self, scale: f64) -> &mut Self
pub fn set_quiver_inv_scale(&mut self, scale: f64) -> &mut Self
Sets the quiver inverse scale
Sourcepub fn set_quiver_pivot(&mut self, pivot: &str) -> &mut Self
pub fn set_quiver_pivot(&mut self, pivot: &str) -> &mut Self
Sets the quiver pivot
Options: ‘tail’, ‘mid’, ‘middle’, ‘tip’
Default = ‘tail’
Sourcepub fn set_quiver_zorder(&mut self, zorder: usize) -> &mut Self
pub fn set_quiver_zorder(&mut self, zorder: usize) -> &mut Self
Sets the quiver z-order
Sourcepub fn set_quiver_extra(&mut self, extra: &str) -> &mut Self
pub fn set_quiver_extra(&mut self, extra: &str) -> &mut Self
Sets extra options for quiver
See https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.quiver.html