def dim_ratios(axis, figsize):
    """Get the proportions of the figure taken up by each axes

    adapted from seaborn
    """
    figdim = figsize[axis]
    dendrogram = min(2.0 / figdim, 0.2)
    colorbar_width = 0.8 * dendrogram
    colorbar_height = 0.2 * dendrogram
    if axis == 0:
        ratios = [colorbar_width, colorbar_height]
    else:
        ratios = [colorbar_height, colorbar_width]
    ratios += [0.8]
    return ratios
