'Plot the given samples from the conditional frequency distribution.
For a cumulative plot, specify cumulative=True.
(Requires Matplotlib to be installed.)
:param samples: The samples to plot
:type samples: list
:param title: The title for the graph
:type title: str
:param conditions: The conditions to plot (default is all)
:type conditions: list'

def plot(self, *args, **kwargs):

    try:
        from matplotlib import pylab
    except ImportError:
        raise ValueError(u'The    plot    function    requires    matplotlib    to    be    installed.See    http://matplotlib.org/')
    cumulative = _get_kwarg(kwargs, u'cumulative', False)
    conditions = _get_kwarg(kwargs, u'conditions', sorted(self.conditions()))
    title = _get_kwarg(kwargs, u'title', u'')
    samples = _get_kwarg(kwargs, u'samples', sorted(set((v for c in conditions for v in self[c]))))
    if (not (u'linewidth' in kwargs)):
        kwargs[u'linewidth'] = 2
    for condition in conditions:
        if cumulative:
            freqs = list(self[condition]._cumulative_frequencies(samples))
            ylabel = u'Cumulative    Counts'
            legend_loc = u'lower    right'
        else:
            freqs = [self[condition][sample] for sample in samples]
            ylabel = u'Counts'
            legend_loc = u'upper    right'
        kwargs[u'label'] = (u'%s' % condition)
        pylab.plot(freqs, *args, **kwargs)
    pylab.legend(loc=legend_loc)
    pylab.grid(True, color=u'silver')
    pylab.xticks(range(len(samples)), [text_type(s) for s in samples], rotation=90)
    if title:
        pylab.title(title)
    pylab.xlabel(u'Samples')
    pylab.ylabel(ylabel)
    pylab.show()
