'Parameters
positions : 1D array-like object
Each value is an event.
orientation : {None, \'horizontal\', \'vertical\'}, optional
The orientation of the **collection** (the event bars are along
the orthogonal direction). Defaults to \'horizontal\' if not
specified or None.
lineoffset : scalar, optional, default: 0
The offset of the center of the markers from the origin, in the
direction orthogonal to *orientation*.
linelength : scalar, optional, default: 1
The total height of the marker (i.e. the marker stretches from
``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).
linewidth : scalar or None, optional, default: None
If it is None, defaults to its rcParams setting, in sequence form.
color : color, sequence of colors or None, optional, default: None
If it is None, defaults to its rcParams setting, in sequence form.
linestyle : str or tuple, optional, default: \'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.
antialiased : {None, 1, 2}, optional
If it is None, defaults to its rcParams setting, in sequence form.
**kwargs : optional
Other keyword arguments are line collection properties.  See
:class:`~matplotlib.collections.LineCollection` for a list of
the valid properties.
Examples
.. plot:: mpl_examples/lines_bars_and_markers/eventcollection_demo.py'

def __init__(self, positions, orientation=None, lineoffset=0, linelength=1, linewidth=None, color=None, linestyle=u'solid', antialiased=None, **kwargs):

    segment = ((lineoffset + (linelength / 2.0)), (lineoffset - (linelength / 2.0)))
    if ((positions is None) or (len(positions) == 0)):
        segments = []
    elif (hasattr(positions, u'ndim') and (positions.ndim > 1)):
        raise ValueError(u'positions    cannot    be    an    array    with    more    than    one    dimension.')
    elif ((orientation is None) or (orientation.lower() == u'none') or (orientation.lower() == u'horizontal')):
        positions.sort()
        segments = [[(coord1, coord2) for coord2 in segment] for coord1 in positions]
        self._is_horizontal = True
    elif (orientation.lower() == u'vertical'):
        positions.sort()
        segments = [[(coord2, coord1) for coord2 in segment] for coord1 in positions]
        self._is_horizontal = False
    else:
        raise ValueError(u"orientation    must    be    'horizontal'    or    'vertical'")
    LineCollection.__init__(self, segments, linewidths=linewidth, colors=color, antialiaseds=antialiased, linestyles=linestyle, **kwargs)
    self._linelength = linelength
    self._lineoffset = lineoffset
