예제 #1
0
def bars(pairs, dim, threshold):
    pairs = sorted(pairs)
    births = persistence.births(pairs, dim, threshold)
    deaths = persistence.deaths(pairs, dim, threshold)
    indexes = range(len(births))
    lifetimes = list(deaths[i] - births[i] for i in indexes)

    return plt.bar(indexes, lifetimes, 1.0, births)
예제 #2
0
def deathsVersusBirthsHistogram(pairs, dim, threshold, nbins=100):
    pairs = [ p for p in pairs if p[1] < infinity ]
    births = persistence.births(pairs, dim, threshold)
    deaths = persistence.deaths(pairs, dim, threshold)

    axmin = min([min(births), min(deaths),0])
    axmax = max([max(births), max(deaths), 0])

    return plt.hist2d(births,deaths,[nbins,nbins],[[axmin,axmax],[axmin,axmax]],False,None,1,norm=col.LogNorm())
예제 #3
0
def weightsVersusPersistence(pairs, dim, threshold):
    births = persistence.births(pairs, dim, threshold)
    deaths = persistence.deaths(pairs, dim, threshold)
    spans = tuple(d - b for (b, d) in zip(births, deaths))
    weights = persistence.weights(pairs, dim, threshold)
    if max(weights) > 0:
        return plt.semilogy(spans, weights, '.')
    else:
        return plt.plot(spans, weights, '.')
예제 #4
0
def weightsVersusPersistence(pairs, dim, threshold):
    births = persistence.births(pairs, dim, threshold)
    deaths = persistence.deaths(pairs, dim, threshold)
    spans = tuple(d - b for (b, d) in zip(births, deaths))
    weights = persistence.weights(pairs, dim, threshold)
    if max(weights) > 0:
        return plt.semilogy(spans, weights, '.')
    else:
        return plt.plot(spans, weights, '.')
예제 #5
0
def deathsVersusBirthsHistogram(pairs, dim, threshold, nbins=100):
    pairs = [p for p in pairs if p[1] < infinity]
    births = persistence.births(pairs, dim, threshold)
    deaths = persistence.deaths(pairs, dim, threshold)

    axmin = min([min(births), min(deaths), 0])
    axmax = max([max(births), max(deaths), 0])

    return plt.hist2d(births,
                      deaths, [nbins, nbins], [[axmin, axmax], [axmin, axmax]],
                      False,
                      None,
                      1,
                      norm=col.LogNorm())
예제 #6
0
def deathsVersusBirths(pairs, dim, threshold):
    births = persistence.births(pairs, dim, threshold)
    deaths = persistence.deaths(pairs, dim, threshold)
    return plt.plot(births, deaths, '.')
예제 #7
0
def deathsVersusBirths(pairs, dim, threshold):
    births = persistence.births(pairs, dim, threshold)
    deaths = persistence.deaths(pairs, dim, threshold)
    return plt.plot(births, deaths, '.')