mplot3d animations

Hello,

I would like to do animations of a 3d scene. Thus I would need do to animation of some mplot3d-generated plot. Has somebody already tried it ? Is it possible at all ? My first test don’t work, but I never did an animation in matplotlib before. I would like to be sure this is not a dead end befor digging deeper.

Thank you !

Hi,

Animations of 3d scenes is a bit tricky, because set_data() functions
for wireframe and surface plots are not available. However, you can
still do it by creating new surfaces or wireframes every frame, and
removing the old one. I've attached an example that does this and will
be added to svn soon.

You could also rotate the 3d axes:

from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import numpy as np

plt.ion()

fig = plt.figure()
ax = axes3d.Axes3D(fig)
X, Y, Z = axes3d.get_test_data(0.1)
ax.plot_wireframe(X, Y, Z, rstride=5, cstride=5)

for angle in range(0, 360):
    ax.view_init(30, angle)
    plt.draw()

Regards,
Reinier

2009/11/25 Sébastien Barthélemy <barthelemy@...1709...>:

wire3d_animation_demo.py (744 Bytes)

···

Hello,

I would like to do animations of a 3d scene. Thus I would need do to
animation of some mplot3d-generated plot. Has somebody already tried it ? Is
it possible at all ? My first test don't work, but I never did an animation
in matplotlib before. I would like to be sure this is not a dead end befor
digging deeper.

Thank you !

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Reinier Heeres
Tel: +31 6 10852639