The windows for plotting shows up but nothing appears and i get this ValueError: x and y must have same first dimension
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()