def plot_movie_of_trajectory_with_matplotlib(<EOL>obs, figsize=<NUM_LIT:6>, grid=True,<EOL>wireframe=False, max_count=None, angle=None, noaxis=False,<EOL>interval=<NUM_LIT>, repeat_delay=<NUM_LIT>, stride=<NUM_LIT:1>, rotate=None,<EOL>legend=True, output=None, crf=<NUM_LIT:10>, bitrate='<STR_LIT>', plot_range=None, **kwargs):
import matplotlib.pyplot as plt<EOL>import matplotlib.animation as animation<EOL>from ecell4_base.core import Species, FixedIntervalHDF5Observer<EOL>from .simulation import load_world<EOL>import math<EOL>data = obs.data()<EOL>if max_count is not None and len(data) > max_count:<EOL><INDENT>data = random.sample(data, max_count)<EOL><DEDENT>lines = []<EOL>num_frames = <NUM_LIT:0><EOL>for i, y in enumerate(data):<EOL><INDENT>xarr, yarr, zarr = [], [], []<EOL>for pos in y:<EOL><INDENT>xarr.append(pos[<NUM_LIT:0>])<EOL>yarr.append(pos[<NUM_LIT:1>])<EOL>zarr.append(pos[<NUM_LIT:2>])<EOL><DEDENT>lines.append((xarr, yarr, zarr))<EOL>num_frames = max(num_frames, len(y))<EOL><DEDENT>num_frames = int(math.ceil(float(num_frames) / stride))<EOL>fig, ax = __prepare_mplot3d_with_matplotlib(<EOL>__get_range_of_trajectories(data, plot_range),<EOL>figsize, grid, wireframe, angle, noaxis)<EOL>def _update_plot(i, plots, lines):<EOL><INDENT>upto = i * stride<EOL>for plot, line in zip(plots, lines):<EOL><INDENT>plot.set_data(line[<NUM_LIT:0>][: upto], line[<NUM_LIT:1>][: upto])<EOL>plot.set_3d_properties(line[<NUM_LIT:2>][: upto])<EOL><DEDENT>if rotate is not None:<EOL><INDENT>ax.elev += rotate[<NUM_LIT:0>]<EOL>ax.azim += rotate[<NUM_LIT:1>]<EOL><DEDENT>fig.canvas.draw()<EOL><DEDENT>plots = __plot_trajectory_with_matplotlib(lines, ax, <NUM_LIT:0>, **kwargs)<EOL>if legend is not None and legend is not False:<EOL><INDENT>legend_opts = {"<STR_LIT>": "<STR_LIT>", "<STR_LIT>": True}<EOL>if isinstance(legend, dict):<EOL><INDENT>legend_opts.update(legend)<EOL><DEDENT>ax.legend(**legend_opts)<EOL><DEDENT>ani = animation.FuncAnimation(<EOL>fig, _update_plot, fargs=(plots, lines),<EOL>frames=num_frames, interval=interval, blit=False)<EOL>plt.close(ani._fig)<EOL>display_anim(ani, output, fps=<NUM_LIT:1.0> / interval, crf=crf, bitrate=bitrate)<EOL>
Generate a move from the received list of instances of World,
and show it on IPython notebook. This function may require ffmpeg.

Parameters
----------
worlds : list or FixedIntervalHDF5Observer
    A list of Worlds to render.
marker_size : float, default 3
    Marker size for all species. Size is passed to scatter function
    as argument, s=(2 ** marker_size).
figsize : float, default 6
    Size of the plotting area. Given in inch.
max_count : Integer, default None
    The maximum number of particles to show for each species.
    None means no limitation.
angle : tuple, default None
    A tuple of view angle which is given as (azim, elev, dist).
    If None, use default assumed to be (-60, 30, 10).
interval : Integer, default 0.16
    Parameters for matplotlib.animation.ArtistAnimation.
stride : Integer, default 1
    Stride per frame.
rotate : tuple, default None
    A pair of rotation angles, elev and azim, for animation.
    None means no rotation, same as (0, 0).
legend : bool, default True
output : str, default None
    An output filename. '.webm' or '.mp4' is only accepted.
    If None, display a movie on IPython Notebook.
crf : int, default 10
    The CRF value can be from 4-63. Lower values mean better quality.
bitrate : str, default '1M'
    Target bitrate
plot_range : tuple, default None
    Range for plotting. A triplet of pairs suggesting (rangex, rangey, rangez).
    If None, the minimum volume containing all the trajectories is used.