Ich versuche mit Matplotlib ein Diagramm zu erstellen, das die Echtzeitergebnisse widerspiegelt. Ich mache das wahrscheinlich nicht richtig, weil das Bewegen des Fensters, das Ändern von Fenstern oder das Klicken auf Dinge dazu führt, dass das Diagramm einfriert. Unten ist ein Beispiel dafür, was ich meine.matplotlib draw() friert das Fenster ein
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
def function1(fig, varse):
ax = fig.add_subplot(111, projection='3d')
color_grade_classes = ['#80FF00','#FFFF00','#FF8000', '#FF0000']
varse = varse +1
ax.set_xlabel('X')
ax.set_ylabel('Y')
for colors, rows in zip(color_grade_classes, [3,2,1,0]):
indexs = np.arange(5)
heights = [varse,varse/2,varse/3,0,0]
ax.bar(indexs, heights, zs = rows, zdir='y', color=colors, alpha=0.8)
plt.ion()
plt.draw()
plt.show()
plt.ioff()
return varse
varse = 0
plt.ion()
fig = plt.figure()
plt.ioff()
while(1):
varse = function1(fig, varse)
Ist klar, warum das nötig war? – Yann