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

Method draw

src/text.rs:93–103  ·  view source on GitHub ↗

Draws text at (x, y) in a 2D plot # Input `x`, `y` -- coordinates (data coordinates) `message` -- text string to display See also: [`draw_3d`](Self::draw_3d) for 3D text

(&mut self, x: T, y: T, message: &str)

Source from the content-addressed store, hash-verified

91 ///
92 /// See also: [`draw_3d`](Self::draw_3d) for 3D text
93 pub fn draw<T>(&mut self, x: T, y: T, message: &str)
94 where
95 T: std::fmt::Display + Num,
96 {
97 let opt = self.options();
98 write!(&mut self.buffer, "t=plt.text({},{},r'{}'{})\n", x, y, message, &opt).unwrap();
99 if self.bbox {
100 let opt_bbox = self.options_bbox();
101 write!(&mut self.buffer, "t.set_bbox(dict({}))\n", opt_bbox).unwrap();
102 }
103 }
104
105 /// Draws text at (x, y, z) in a 3D plot
106 ///

Callers 15

draw_cylinderMethod · 0.45
draw_plane_nzzMethod · 0.45
draw_hemisphereMethod · 0.45
draw_superquadricMethod · 0.45
draw_worksFunction · 0.45
legendMethod · 0.45
test_inset_axes_1Function · 0.45
test_inset_axes_2Function · 0.45
test_inset_axes_3Function · 0.45
test_inset_axes_4Function · 0.45
test_inset_axes_5Function · 0.45
test_inset_axes_6Function · 0.45

Calls 2

options_bboxMethod · 0.80
optionsMethod · 0.45

Tested by 15

draw_worksFunction · 0.36
test_inset_axes_1Function · 0.36
test_inset_axes_2Function · 0.36
test_inset_axes_3Function · 0.36
test_inset_axes_4Function · 0.36
test_inset_axes_5Function · 0.36
test_inset_axes_6Function · 0.36
test_inset_axes_7Function · 0.36
test_slope_icon_belowFunction · 0.36
test_slope_icon_aboveFunction · 0.36