chatgpt/btc_tracker/01042023/TheClient/graphing/graph_utils.py

13 lines
349 B
Python
Raw Normal View History

import matplotlib.pyplot as plt
class Graph():
def __init__(self, xdata, ydata):
self.fig, self.ax = plt.subplots()
self.line, = self.ax.plot(xdata, ydata)
def update_graph(self, xdata, ydata):
self.line.set_data(xdata, ydata)
self.ax.relim()
self.ax.autoscale_view()
self.fig.canvas.draw()