From 6dbc3a2cee0df00747d649de1aa14d3f28760974 Mon Sep 17 00:00:00 2001 From: Christopher Stone Date: Fri, 9 Feb 2018 23:26:22 +0000 Subject: [PATCH] fixed line coordintes --- telemetry/code/monitor/.graph_plotter_rewrite.py.kate-swp | Bin 167 -> 0 bytes telemetry/code/monitor/graph_plotter_rewrite.py | 15 +++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 telemetry/code/monitor/.graph_plotter_rewrite.py.kate-swp diff --git a/telemetry/code/monitor/.graph_plotter_rewrite.py.kate-swp b/telemetry/code/monitor/.graph_plotter_rewrite.py.kate-swp deleted file mode 100644 index ac169c0..0000000 Binary files a/telemetry/code/monitor/.graph_plotter_rewrite.py.kate-swp and /dev/null differ diff --git a/telemetry/code/monitor/graph_plotter_rewrite.py b/telemetry/code/monitor/graph_plotter_rewrite.py index 41c0ca4..090db40 100755 --- a/telemetry/code/monitor/graph_plotter_rewrite.py +++ b/telemetry/code/monitor/graph_plotter_rewrite.py @@ -35,16 +35,15 @@ class Plot(pyglet.window.Window): self.series = series self.title = self.series.title self.font = 'Arkhip' - self.margins = (0.02, 0.02) # Fractions of window size + self.margins = (0.05, 0.05) # Fractions of window size self.lines = (12, 8) #self.resizable = True self.set_caption(self.title) + + def on_resize(self, width, height): self.bounds = ((int(self.width * self.margins[0]), int(self.width * (1 - self.margins[0]))), - (int(self.height * self.margins[1]), int(self.height * (1 - self.margins[1])))) - - #def on_resize(self, width, height): - """Handle a pyglet resize event""" - # pass + (int(self.height * self.margins[1]), int(self.height * (1 - self.margins[1])))) + pyglet.window.Window.on_resize(self, width, height) def on_draw(self): """Draw all the components of the graph""" @@ -59,13 +58,13 @@ class Plot(pyglet.window.Window): def drawHeading(self): """Draw a title for the graph (duplicated in the window titlebar, if present""" heading = pyglet.text.Label(self.title, color=BLACK, - font_name=self.font, font_size=self.width*self.margins[0], x=self.width/2, y=self.height, + font_name=self.font, font_size=self.height*self.margins[0]*0.8, x=self.width/2, y=self.height, anchor_x='center', anchor_y='top') heading.draw() def drawXAxis(self): pyglet.graphics.draw(2, pyglet.gl.GL_LINES, ('v2i', (self.bounds[0][0], self.bounds[1][0], - self.bounds[1][0], self.bounds[1][1])), + self.bounds[0][0], self.bounds[1][1])), ('c3B', (0, 0, 0, 0, 0, 0))) -- libgit2 0.21.2