def plot_trajectory2d_with_matplotlib(<EOL>obs, plane='<STR_LIT>', max_count=<NUM_LIT:10>, figsize=<NUM_LIT:6>, legend=True,<EOL>wireframe=False, grid=True, noaxis=False, plot_range=None, **kwargs):
import matplotlib.pyplot as plt<EOL>plane = plane.lower()<EOL>if len(plane) != <NUM_LIT:2> or plane[<NUM_LIT:0>] not in ('<STR_LIT:x>', '<STR_LIT:y>', '<STR_LIT:z>') or plane[<NUM_LIT:1>] not in ('<STR_LIT:x>', '<STR_LIT:y>', '<STR_LIT:z>'):<EOL><INDENT>raise ValueError("<STR_LIT>".format(repr(plane)))<EOL><DEDENT>xidx = <NUM_LIT:0> if plane[<NUM_LIT:0>] == '<STR_LIT:x>' else (<NUM_LIT:1> if plane[<NUM_LIT:0>] == '<STR_LIT:y>' else <NUM_LIT:2>)<EOL>yidx = <NUM_LIT:0> if plane[<NUM_LIT:1>] == '<STR_LIT:x>' else (<NUM_LIT:1> if plane[<NUM_LIT:1>] == '<STR_LIT:y>' else <NUM_LIT:2>)<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>wrange = __get_range_of_trajectories(data, plot_range)<EOL>wrange = (wrange['<STR_LIT:x>'], wrange['<STR_LIT:y>'], wrange['<STR_LIT:z>'])<EOL>wrange = {'<STR_LIT:x>': wrange[xidx], '<STR_LIT:y>': wrange[yidx]}<EOL>fig, ax = __prepare_plot_with_matplotlib(<EOL>wrange, figsize, grid, wireframe, noaxis)<EOL>ax.set_xlabel(plane[<NUM_LIT:0>].upper())<EOL>ax.set_ylabel(plane[<NUM_LIT:1>].upper())<EOL>lines = []<EOL>for i, y in enumerate(data):<EOL><INDENT>xarr, yarr, zarr = [], [], []<EOL>for pos in y:<EOL><INDENT>xarr.append(pos[xidx])<EOL>yarr.append(pos[yidx])<EOL><DEDENT>lines.append((xarr, yarr))<EOL><DEDENT>__plot_trajectory2d_with_matplotlib(lines, ax, **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>plt.show()<EOL>
Make a 2D plot from received instance of TrajectoryObserver and show it
on IPython notebook.

Parameters
----------
obs : TrajectoryObserver
    TrajectoryObserver to render.
plane : str, default 'xy'
    'xy', 'yz', 'zx'.
max_count : Integer, default 10
    The maximum number of particles to show. If None, show all.
figsize : float, default 6
    Size of the plotting area. Given in inch.
legend : bool, default True
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.