'get the topmost SubplotSpec instance associated with the subplot'

def get_topmost_subplotspec(self):

    gridspec = self.get_gridspec()
    if hasattr(gridspec, u'get_topmost_subplotspec'):
        return gridspec.get_topmost_subplotspec()
    else:
        return self
