This commit is contained in:
Tulis
2025-08-25 19:37:48 +02:00
parent ee25c170be
commit 5560f6b2e6
23 changed files with 1268 additions and 1087 deletions

26
ploting.py Normal file
View File

@ -0,0 +1,26 @@
import matplotlib.pyplot as plt
import queue
data_queue = queue.Queue()
x_data, y_data = [], []
fig, ax = plt.subplots()
line, = ax.plot([], [], 'r-')
def init():
ax.set_xlim(0, 100)
ax.set_ylim(0, 10)
return line,
def update(frame):
# sprawdzamy, czy są nowe dane w kolejce
while not data_queue.empty():
value = data_queue.get()
x_data.append(len(x_data))
y_data.append(value)
if len(x_data) > 100:
x_data.pop(0)
y_data.pop(0)
line.set_data(x_data, y_data)
return line,