Just change to:
...
for (x, y, z) in zip(xs, ys, zs):
print('Updating scene...')
plt.mlab_source.set(x=x, y=y, z=z)
yield
...
you don't even need the f.scene.render()
, according to documentation mlab_source.set
guarantees the refresh.
Also since shape
of your data doesn't change you don't need to use mlab_source.reset
.
I also tested and works fine.