From d7138d89aff04b2775a2996f5c25b9f22589466b Mon Sep 17 00:00:00 2001 From: Christopher Stone Date: Mon, 12 Feb 2018 23:33:36 +0000 Subject: [PATCH] Added basis for line-drawing function, big comment on plans for multiline graphs --- telemetry/code/monitor/graph_plotter_rewrite.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+), 0 deletions(-) diff --git a/telemetry/code/monitor/graph_plotter_rewrite.py b/telemetry/code/monitor/graph_plotter_rewrite.py index 55f9c41..e39bf99 100755 --- a/telemetry/code/monitor/graph_plotter_rewrite.py +++ b/telemetry/code/monitor/graph_plotter_rewrite.py @@ -26,6 +26,16 @@ timeout=1 class Series: def __init__(self, points=100, title="Series title", xname="x-axis name", yname="y-axis name"): """Set up an object to store a 2D data series""" + # Proposal: + # In order to neatly handle multiple lines on the same graph + # a series is not so much a set of 2D data points, but a number + # of series sharing an x axis. For example + # (time, temperature) + # (time, xaccel, yaccel, zaccel) + # The latter seta of points much be of like nature and share an axis + # (time, temperature, xaccel) + # would be a meaningless thing to plot on a single graph anyway + self.title = title self.xname = xname self.yname = yname @@ -74,6 +84,10 @@ class Plot(pyglet.window.Window): x=self.width/2, y=self.height-(self.margins[1]), anchor_x='center', anchor_y='top') heading.draw() + + def drawLine(self): + for point in self.series.data: + pass def drawAxis(self, axis): # axis=0 is x, 1 is y """Draw the gridlines and labels for one axis, specified in the last argument""" -- libgit2 0.21.2