Эй, я пытался увеличить четвертую гистограмму на моей гистограмме на три каждый раз, когда запускается функция animattion_frame, но независимо от того, что я делаю, она не хочет работать.
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
N = 5
menMeans = [20, 35, 30, 35, 27]
ind = np.arange(N) # the x locations for the groups
width = 0.35 # the width of the bars: can also be len(x) sequence
fig, ax1 = plt.subplots()
#plt.bar(ind, menMeans, width)
ax=plt.yticks(np.arange(0, 81, 10))
def animation_frame(ind,i,menMeans):
#x_data.append(i * 10)
menMeans[3]=menMeans[3]+3
ax=plt.clear()
ax=plt.bar(ind,menMeans,width)
return ax
animation = FuncAnimation(fig,fargs=(menMeans,ind), func=animation_frame, interval=100)
plt.show()