Этот код не компилируется.fig, ax = plt.subplots()
posX = 0
posY = 0
scat = ax.scatter(pos, 0, c="b", s=5, label=f'der sich bewegende punkt')
ax.set(xlim=[-5, 5], ylim=[-1, 1], xlabel='Ort', ylabel='garnix is 1D')
ax.legend()
def update(frame, posX, posY):
# for each frame, update the data stored on each artist.
x = posX + random.gauss()
y = posY + random.gauss()
posX = posX + random.gauss()
posY = posY + random.gauss()
# update the scatter plot:
scat.set_offsets([x,y])
return (x,y)
ani = animation.FuncAnimation(fig=fig, func=update(posX, posY), frames=240, interval=50)
ani.save('test.mp4')
< /code>
Я ожидал, что он будет хорошо работать. Так же, как код ниже < /p>
fig, ax = plt.subplots()
pos = 0
scat = ax.scatter(pos, 0, c="b", s=5, label=f'der sich bewegende punkt')
ax.set(xlim=[-5, 5], ylim=[-1, 1], xlabel='Ort', ylabel='garnix is 1D')
ax.legend()
def update(frame):
# for each frame, update the data stored on each artist.
x = pos + random.gauss()`
# update the scatter plot:
scat.set_offsets([x,0])
return (x)
ani = animation.FuncAnimation(fig=fig, func=update, frames=40, interval=30)
ani.save('test.mp4')
Подробнее здесь: https://stackoverflow.com/questions/795 ... d-the-synt
Параметр не найден, хотя присутствует в функциональном вызове (не понимайте синтаксис) в Python ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение