@animate
def test_mesh_sphere_anim(obj=None, r=1.0, npts=(100, 100), colormap='jet'):
    obj = obj if obj is not None else test_mesh_sphere(r, npts, colormap)
    pi = numpy.pi
    cos = numpy.cos
    np_phi = npts[0] * 1j
    np_theta = npts[1] * 1j
    phi, theta = numpy.mgrid[0:pi:np_phi, 0:2 * pi:np_theta]

    ms = obj.mlab_source
    for i in range(1, 10):
        z = (r + i * 0.25) * cos(phi)
        ms.set(z=z, scalars=z)
        yield
Create a simple sphere and animate it.
dataset/ETHPy150Open enthought/mayavi/mayavi/tools/helper_functions.py/test_mesh_sphere_anim