1234567891011121314151617181920212223242526272829 |
- import matplotlib
- from matplotlib.figure import Figure
- from matplotlib import style
- from .globals import *
- style.use("ggplot")
-
- class Plot():
- def __init__(self, n):
- self.fig = Figure()
- self.ax = self.fig.add_subplot(111)
- self.xs = range(n)
- self.ys = [0] * n
- self.i = 0
- self.n = n
- def update(self, y):
- # Add x and y to lists
- ys[i] = y
- i = i+1 if i+1 < self.n else 0
- ax.clear()
- ax.plot(xs, ys, "#00A3E0", label="1. Graph")
- ax.legend(bbox_to_anchor=(0, 1.02, 1, .102), loc=3, ncol=2, borderaxespad=0)
- ax.set_title('Windkanal')
|