Adjust the space between the panels

def spaceout_and_resize_panels(self):
        """
        Adjust the space between the panels
        """
        # Only deal with the aspect ratio
        figure = self.figure
        theme = self.theme

        try:
            aspect_ratio = theme.themeables.property('aspect_ratio')
        except KeyError:
            aspect_ratio = self.coordinates.aspect(
                    self.layout.panel_params[0])

        if aspect_ratio is None:
            return

        left = figure.subplotpars.left
        right = figure.subplotpars.right
        top = figure.subplotpars.top
        bottom = figure.subplotpars.bottom
        W, H = figure.get_size_inches()

        w = (right-left)*W
        h = w*aspect_ratio
        H = h / (top-bottom)

        figure.set_figheight(H)