calculate appropriate sizes for the subfigures

def getfigsize(plotman):
    '''calculate appropriate sizes for the subfigures
    '''
    xmin = plotman.grid.grid['x'].min()
    xmax = plotman.grid.grid['x'].max()
    zmin = plotman.grid.grid['z'].min()
    zmax = plotman.grid.grid['z'].max()
    if np.abs(zmax - zmin) < np.abs(xmax - xmin):
        sizex = 10 / 2.54
        sizez = 1.2 * sizex * (np.abs(zmax - zmin) / np.abs(xmax - xmin))
    else:
        sizez = 10 / 2.54
        sizex = sizez * (np.abs(xmax - xmin) / np.abs(zmax - zmin))
    # add 1 inch to accommodate colorbar
    sizex += 1.3
    sizez += 1
    return sizex, sizez