Draws a rectangle (2D only) # Input `x`, `y` -- bottom-left corner coordinates `width` -- rectangle width `height` -- rectangle height
(&mut self, x: T, y: T, width: T, height: T)
| 589 | /// * `width` -- rectangle width |
| 590 | /// * `height` -- rectangle height |
| 591 | pub fn draw_rectangle<T>(&mut self, x: T, y: T, width: T, height: T) -> &mut Self |
| 592 | where |
| 593 | T: std::fmt::Display + Num, |
| 594 | { |
| 595 | let opt = self.options_shared(); |
| 596 | write!( |
| 597 | &mut self.buffer, |
| 598 | "p=pat.Rectangle(({},{}),{},{}{})\n\ |
| 599 | plt.gca().add_patch(p)\n", |
| 600 | x, y, width, height, &opt |
| 601 | ) |
| 602 | .unwrap(); |
| 603 | self |
| 604 | } |
| 605 | |
| 606 | /// Draws text at (x, y) in a 2D graph using the primary text style |
| 607 | /// |