MCPcopy Create free account
hub / github.com/cpmech/plotpy / draw_arrows

Method draw_arrows

src/stream.rs:106–117  ·  view source on GitHub ↗

Draws arrows (quiver plot) given matrices From [Matplotlib's documentation](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.quiver.html): 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.

(&mut self, xx: &'a T, yy: &'a T, uu: &'a T, vv: &'a T)

Source from the content-addressed store, hash-verified

104 /// * xx, yy -- 2D arrays. The x and y coordinates of the arrow locations.
105 /// * uu, vv -- 2D arrays. The x and y direction components of the arrow vectors.
106 pub fn draw_arrows<'a, T, U>(&mut self, xx: &'a T, yy: &'a T, uu: &'a T, vv: &'a T)
107 where
108 T: AsMatrix<'a, U>,
109 U: 'a + std::fmt::Display + Num,
110 {
111 matrix_to_array(&mut self.buffer, "xx", xx);
112 matrix_to_array(&mut self.buffer, "yy", yy);
113 matrix_to_array(&mut self.buffer, "uu", uu);
114 matrix_to_array(&mut self.buffer, "vv", vv);
115 let opt = self.options_quiver();
116 write!(&mut self.buffer, "plt.quiver(xx,yy,uu,vv{})\n", &opt).unwrap();
117 }
118
119 /// Draws arrows (quiver plot) given vectors
120 ///

Callers 1

test_stream_arrows_1Function · 0.80

Calls 2

matrix_to_arrayFunction · 0.85
options_quiverMethod · 0.80

Tested by 1

test_stream_arrows_1Function · 0.64