def freeze_margins(axes, margins=[1, 1, 1, 1]):

    axes.resizer = AxesResizer(axes, margins)
    axes.figure.canvas.mpl_connect('resize_event', axes.resizer.on_resize)
Make sure margins of axes stay fixed.
dataset/ETHPy150Open glue-viz/glue/glue/utils/matplotlib.py/freeze_margins