From 604701755180371ba12f743f9cd21d266df914c8 Mon Sep 17 00:00:00 2001 From: fruchti Date: Sat, 17 Dec 2022 20:20:17 +0100 Subject: [PATCH] Add convenience function to draw frame --- lib/plot.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/plot.py b/lib/plot.py index 68b0c69..13b0e51 100644 --- a/lib/plot.py +++ b/lib/plot.py @@ -153,6 +153,13 @@ class Plotter: self.pen_down = True self.position = point + def draw_frame(self): + self.move_to(self.paper.bottom_left()) + self.line_to(self.paper.bottom_right()) + self.line_to(self.paper.top_right()) + self.line_to(self.paper.top_left()) + self.line_to(self.paper.bottom_left()) + class SVGPlotter(Plotter): @@ -290,4 +297,8 @@ class MultiPlotter(Plotter): plotter.finalise() def register_plotter(self, plotter): - self.plotters.append(plotter) \ No newline at end of file + self.plotters.append(plotter) + + @property + def paper(self): + return self.plotters[0].paper \ No newline at end of file