'Method to draw a histogram of the number of new links
discovered at each depth.
(i.e. show how many links are required to reach a link)'

def depthReport(self):

    try:
        from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
        self.FigureCanvas = FigureCanvas
        from matplotlib.figure import Figure
        self.Figure = Figure
        from numpy import arange
    except ImportError:
        return
    self.reporter('Analysis    of    link    depth')
    fig = Figure(figsize=(4, 2.5))
    width = 0.9
    rect = [0.12, 0.08, 0.9, 0.85]
    ax = fig.add_axes(rect)
    left = arange(len(self.linkDepth))
    plot = ax.bar(left, self.linkDepth, width=width)
    ax.set_xticks((left + (width * 0.5)))
    ax.set_xticklabels(left)
    chart = StringIO()
    canvas = self.FigureCanvas(fig)
    canvas.print_figure(chart)
    image = chart.getvalue()
    import base64
    base64Img = base64.b64encode(image)
    image = ('<img    src="data:image/png;base64,%s">' % base64Img)
    self.reporter(image)
