'Plot identical parallel lines at the given positions.
*positions* should be a 1D or 2D array-like object, with each row
corresponding to a row or column of lines.
This type of plot is commonly used in neuroscience for representing
neural events, where it is usually called a spike raster, dot raster,
or raster plot.
However, it is useful in any situation where you wish to show the
timing or position of multiple sets of discrete events, such as the
arrival times of people to a business on each day of the month or the
date of hurricanes each year of the last century.
Parameters
positions : 1D or 2D array-like object
Each value is an event. If *positions* is a 2D array-like, each
row corresponds to a row or a column of lines (depending on the
*orientation* parameter).
orientation : {\'horizontal\', \'vertical\'}, optional
Controls the direction of the event collections:
- \'horizontal\' : the lines are arranged horizontally in rows,
and are vertical.
- \'vertical\' : the lines are arranged vertically in columns,
and are horizontal.
lineoffsets : scalar or sequence of scalars, optional, default: 1
The offset of the center of the lines from the origin, in the
direction orthogonal to *orientation*.
linelengths : scalar or sequence of scalars, optional, default: 1
The total height of the lines (i.e. the lines stretches from
``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).
linewidths : scalar, scalar sequence or None, optional, default: None
The line width(s) of the event lines, in points. If it is None,
defaults to its rcParams setting.
colors : color, sequence of colors or None, optional, default: None
The color(s) of the event lines. If it is None, defaults to its
rcParams setting.
linestyles : str or tuple or a sequence of such values, optional
Default is \'solid\'. Valid strings are [\'solid\', \'dashed\',
\'dashdot\', \'dotted\', \'-\', \'--\', \'-.\', \':\']. Dash tuples
should be of the form::
(offset, onoffseq),
where *onoffseq* is an even length tuple of on and off ink
in points.
**kwargs : optional
Other keyword arguments are line collection properties.  See
:class:`~matplotlib.collections.LineCollection` for a list of
the valid properties.
Returns
A list of :class:`matplotlib.collections.EventCollection` objects that
were added.
Notes
For *linelengths*, *linewidths*, *colors*, and *linestyles*, if only
a single value is given, that value is applied to all lines.  If an
array-like is given, it must have the same length as *positions*, and
each value will be applied to the corresponding row of the array.
Examples
.. plot:: mpl_examples/lines_bars_and_markers/eventplot_demo.py'

@_preprocess_data(replace_names=[u'positions', u'lineoffsets', u'linelengths', u'linewidths', u'colors', u'linestyles'], label_namer=None)
@docstring.dedent_interpd
def eventplot(self, positions, orientation=u'horizontal', lineoffsets=1, linelengths=1, linewidths=None, colors=None, linestyles=u'solid', **kwargs):

    self._process_unit_info(xdata=positions, ydata=[lineoffsets, linelengths], kwargs=kwargs)
    positions = self.convert_xunits(positions)
    lineoffsets = self.convert_yunits(lineoffsets)
    linelengths = self.convert_yunits(linelengths)
    if (not iterable(positions)):
        positions = [positions]
    elif any((iterable(position) for position in positions)):
        positions = [np.asanyarray(position) for position in positions]
    else:
        positions = [np.asanyarray(positions)]
    if (len(positions) == 0):
        return []
    colors = cbook.local_over_kwdict(colors, kwargs, u'color')
    linewidths = cbook.local_over_kwdict(linewidths, kwargs, u'linewidth')
    linestyles = cbook.local_over_kwdict(linestyles, kwargs, u'linestyle')
    if (not iterable(lineoffsets)):
        lineoffsets = [lineoffsets]
    if (not iterable(linelengths)):
        linelengths = [linelengths]
    if (not iterable(linewidths)):
        linewidths = [linewidths]
    if (not iterable(colors)):
        colors = [colors]
    if (hasattr(linestyles, u'lower') or (not iterable(linestyles))):
        linestyles = [linestyles]
    lineoffsets = np.asarray(lineoffsets)
    linelengths = np.asarray(linelengths)
    linewidths = np.asarray(linewidths)
    if (len(lineoffsets) == 0):
        lineoffsets = [None]
    if (len(linelengths) == 0):
        linelengths = [None]
    if (len(linewidths) == 0):
        lineoffsets = [None]
    if (len(linewidths) == 0):
        lineoffsets = [None]
    if (len(colors) == 0):
        colors = [None]
    try:
        colors = mcolors.to_rgba_array(colors)
    except ValueError:
        pass
    if ((len(lineoffsets) == 1) and (len(positions) != 1)):
        lineoffsets = np.tile(lineoffsets, len(positions))
        lineoffsets[0] = 0
        lineoffsets = np.cumsum(lineoffsets)
    if (len(linelengths) == 1):
        linelengths = np.tile(linelengths, len(positions))
    if (len(linewidths) == 1):
        linewidths = np.tile(linewidths, len(positions))
    if (len(colors) == 1):
        colors = list(colors)
        colors = (colors * len(positions))
    if (len(linestyles) == 1):
        linestyles = ([linestyles] * len(positions))
    if (len(lineoffsets) != len(positions)):
        raise ValueError(u'lineoffsets    and    positions    are    unequal    sized    sequences')
    if (len(linelengths) != len(positions)):
        raise ValueError(u'linelengths    and    positions    are    unequal    sized    sequences')
    if (len(linewidths) != len(positions)):
        raise ValueError(u'linewidths    and    positions    are    unequal    sized    sequences')
    if (len(colors) != len(positions)):
        raise ValueError(u'colors    and    positions    are    unequal    sized    sequences')
    if (len(linestyles) != len(positions)):
        raise ValueError(u'linestyles    and    positions    are    unequal    sized    sequences')
    colls = []
    for (position, lineoffset, linelength, linewidth, color, linestyle) in zip(positions, lineoffsets, linelengths, linewidths, colors, linestyles):
        coll = mcoll.EventCollection(position, orientation=orientation, lineoffset=lineoffset, linelength=linelength, linewidth=linewidth, color=color, linestyle=linestyle)
        self.add_collection(coll, autolim=False)
        coll.update(kwargs)
        colls.append(coll)
    if (len(positions) > 0):
        min_max = [(np.min(_p), np.max(_p)) for _p in positions if (len(_p) > 0)]
        if (len(min_max) > 0):
            (mins, maxes) = zip(*min_max)
            minpos = np.min(mins)
            maxpos = np.max(maxes)
            minline = (lineoffsets - linelengths).min()
            maxline = (lineoffsets + linelengths).max()
            if colls[0].is_horizontal():
                corners = ((minpos, minline), (maxpos, maxline))
            else:
                corners = ((minline, minpos), (maxline, maxpos))
            self.update_datalim(corners)
            self.autoscale_view()
    return colls
