Die Fenster für Shows bis Plotten aber nichts erscheint und ich bekomme diese Valueerror: x und y müssen gleiche erste DimensionMatplotlib Python Animation nicht Linie zeigt
import psutil
import matplotlib.pyplot as plt
import matplotlib.animation as animation
a = [i for i in range(1000)]
ram_avaliable = []
fig, ax = plt.subplots()
def update(n):
ram = psutil.virtual_memory()
ram_avaliable.append(float(ram[1])/1073741824)
print (a[n],ram_avaliable[n])
ax.plot(a[n],ram_avaliable[n])
ani = animation.FuncAnimation(fig,update,interval=100)
plt.show()
Wenn ich diesen Code ausführen, erscheint nichts im Fenster, aber Ihr Code druckt die Punkte aus und ich bekomme keine Fehler. – whrrgarbl