'Revert figure layout to allow plotly to resize.
By default, PlotlyRenderer tries its hardest to precisely mimic an
mpl figure. However, plotly is pretty good with aesthetics. By
running PlotlyRenderer.resize(), layout parameters are deleted. This
lets plotly choose them instead of mpl.'

def resize(self):

    self.msg += 'Resizing    figure,    deleting    keys    from    layout\n'
    for key in ['width', 'height', 'autosize', 'margin']:
        try:
            del self.plotly_fig['layout'][key]
        except KeyError:
            pass
