'Run the exporter on the given figure
Parameters
fig : matplotlib.Figure instance
The figure to export'

def run(self, fig):

    if (fig.canvas is None):
        fig.canvas = FigureCanvasAgg(fig)
    fig.savefig(io.BytesIO(), format='png', dpi=fig.dpi)
    if self.close_mpl:
        import matplotlib.pyplot as plt
        plt.close(fig)
    self.crawl_fig(fig)
