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)
| 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 | /// |