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

Method draw_arrow

src/canvas.rs:242–258  ·  view source on GitHub ↗

Draws arrow (2D only) # Input `xi`, `yi` -- start point `xf`, `yf` -- end point Use [`set_arrow_style`](Self::set_arrow_style) and [`set_arrow_scale`](Self::set_arrow_scale) to configure.

(&mut self, xi: T, yi: T, xf: T, yf: T)

Source from the content-addressed store, hash-verified

240 ///
241 /// Use [`set_arrow_style`](Self::set_arrow_style) and [`set_arrow_scale`](Self::set_arrow_scale) to configure.
242 pub fn draw_arrow<T>(&mut self, xi: T, yi: T, xf: T, yf: T)
243 where
244 T: std::fmt::Display + Num,
245 {
246 let opt_shared = self.options_shared();
247 let opt_arrow = self.options_arrow();
248 write!(
249 &mut self.buffer,
250 "p=pat.FancyArrowPatch(({},{}),({},{})\
251 ,shrinkA=0,shrinkB=0\
252 ,path_effects=[pff.Stroke(joinstyle='miter')]\
253 {}{})\n\
254 plt.gca().add_patch(p)\n",
255 xi, yi, xf, yf, &opt_shared, &&opt_arrow,
256 )
257 .unwrap();
258 }
259
260 /// Draws circle (2D only)
261 ///

Callers 2

arrow_woksFunction · 0.80
test_canvasFunction · 0.80

Calls 2

options_sharedMethod · 0.80
options_arrowMethod · 0.80

Tested by 2

arrow_woksFunction · 0.64
test_canvasFunction · 0.64