def getColorRange(x):
    """ Determines the range of colors, centered at zero, for normalizing cmap """
    vmax = x.max()
    vmin = x.min()
    if vmax < 0 and vmin < 0:
        direction = 'negative'
    elif vmax > 0 and vmin > 0:
        direction = 'positive'
    else:
        direction = 'both'
    if direction == 'both':
        vmax = max([vmax, abs(vmin)])
        vmin = -1 * vmax
        return vmax, vmin
    else:
        return vmax, vmin
