@staticmethod<EOL><INDENT>def save(filename, n_frames=<NUM_LIT:1>, axis=np.array([<NUM_LIT:0.>,<NUM_LIT:0.>,<NUM_LIT:1.>]), clf=True, **kwargs):<DEDENT>
if n_frames ><NUM_LIT:1> and os.path.splitext(filename)[<NUM_LIT:1>] != '<STR_LIT>':<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>v = SceneViewer(Visualizer3D._scene,<EOL>size=Visualizer3D._init_size,<EOL>animate=(n_frames > <NUM_LIT:1>),<EOL>animate_axis=axis,<EOL>max_frames=n_frames,<EOL>**kwargs)<EOL>data = [m.data for m in v.saved_frames]<EOL>if len(data) > <NUM_LIT:1>:<EOL><INDENT>imageio.mimwrite(filename, data, fps=v._animate_rate, palettesize=<NUM_LIT>, subrectangles=True)<EOL><DEDENT>else:<EOL><INDENT>imageio.imwrite(filename, data[<NUM_LIT:0>])<EOL><DEDENT>if clf:<EOL><INDENT>Visualizer3D.clf()<EOL><DEDENT>
Save frames from the viewer out to a file.

        Parameters
        ----------
        filename : str
            The filename in which to save the output image. If more than one frame,
            should have extension .gif.
        n_frames : int
            Number of frames to render. If more than one, the scene will animate.
        axis : (3,) float or None
            If present, the animation will rotate about the given axis in world coordinates.
            Otherwise, the animation will rotate in azimuth.
        clf : bool
            If true, the Visualizer is cleared after rendering the figure.
        kwargs : dict
            Other keyword arguments for the SceneViewer instance.