def plot_connectivity_significance(s, fs=2, freq_range=(-np.inf, np.inf), diagonal=0, border=False, fig=None):

    a = np.atleast_3d(s)
    [_, m, f] = a.shape
    freq = np.linspace(0, fs / 2, f)

    left = max(freq_range[0], freq[0])
    right = min(freq_range[1], freq[-1])

    imext = (freq[0], freq[-1], -1e25, 1e25)

    if fig is None:
        fig = new_figure()

    axes = []
    for i in range(m):
        if diagonal == 1:
            jrange = [i]
        elif diagonal == 0:
            jrange = range(m)
        else:
            jrange = [j for j in range(m) if j != i]
        for j in jrange:
            if border:
                ax = fig.add_subplot(m+1, m+1, j + (i+1) * (m+1) + 2)
            else:
                ax = fig.add_subplot(m, m, j + i * m + 1)
            axes.append((i, j, ax))
            ax.imshow(s[i, j, np.newaxis], vmin=0, vmax=2, cmap='binary', aspect='auto', extent=imext, zorder=-999)

            ax.xaxis.set_major_locator(MaxNLocator(max(1, 7 - m)))
            ax.yaxis.set_major_locator(MaxNLocator(max(1, 7 - m)))
            ax.set_xlim(left, right)

            if 0 < i < m - 1:
                ax.set_xticks([])
            if 0 < j < m - 1:
                ax.set_yticks([])

            if j == 0:
                ax.yaxis.tick_left()
            if j == m-1:
                ax.yaxis.tick_right()

    _plot_labels(fig,
                 {'x': 0.5, 'y': 0.025, 's': 'frequency (Hz)', 'horizontalalignment': 'center'},
                 {'x': 0.05, 'y': 0.5, 's': 'magnitude', 'horizontalalignment': 'center', 'rotation': 'vertical'})

    return fig
Increment stats for a particular kind.
dataset/ETHPy150Open scot-dev/scot/scot/plotting.py/plot_connectivity_significance--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/datastore/datastore_stats_generator.py/DatastoreStatsProcessor.__Increment