Esempio n. 1
0
    def test_circular(self):
        w = [[1, 1, 1], [1, 1, 1], [1, 1, 1]]
        c = [[[1, 1, 1], [1, 1, 1], [1, 1, 1]], [[1, 1, 1], [1, 1, 1], [1, 1, 1]], [[1, 1, 1], [1, 1, 1], [1, 1, 1]]]

        sp.plot_circular(1, [1, 1, 1], topo=self.topo, topomaps=self.maps)
        sp.plot_circular(w, [1, 1, 1], topo=self.topo, topomaps=self.maps)
        sp.plot_circular(1, c, topo=self.topo, topomaps=self.maps)
        sp.plot_circular(w, c, topo=self.topo, topomaps=self.maps)
        sp.plot_circular(w, c, mask=False, topo=self.topo, topomaps=self.maps)
Esempio n. 2
0
    def test_circular(self):
        w = [[1, 1, 1], [1, 1, 1], [1, 1, 1]]
        c = [[[1, 1, 1], [1, 1, 1], [1, 1, 1]],
             [[1, 1, 1], [1, 1, 1], [1, 1, 1]],
             [[1, 1, 1], [1, 1, 1], [1, 1, 1]]]

        sp.plot_circular(1, [1, 1, 1], topo=self.topo, topomaps=self.maps)
        sp.plot_circular(w, [1, 1, 1], topo=self.topo, topomaps=self.maps)
        sp.plot_circular(1, c, topo=self.topo, topomaps=self.maps)
        sp.plot_circular(w, c, topo=self.topo, topomaps=self.maps)
        sp.plot_circular(w, c, mask=False, topo=self.topo, topomaps=self.maps)
Esempio n. 3
0
np.fill_diagonal(alpha['foot'], 0)

order = None
for cls in ['hand', 'foot']:
    np.fill_diagonal(alpha[cls], 0)

    w = alpha[cls]
    m = alpha[cls] > 4

    # use same ordering of components for each class
    if not order:
        order = cuthill_mckee(m)

    # fixed color, but alpha varies with connectivity strength
    r = np.ones(w.shape)
    g = np.zeros(w.shape)
    b = np.zeros(w.shape)
    a = (alpha[cls] - 4) / max(np.max(alpha['hand'] - 4),
                               np.max(alpha['foot'] - 4))
    c = np.dstack([r, g, b, a])

    plotting.plot_circular(colors=c,
                           widths=w,
                           mask=m,
                           topo=topo,
                           topomaps=mixmaps,
                           order=order)
    plt.title(cls)

plotting.show_plots()
Esempio n. 4
0
topo.set_locations(locs)
mixmaps = plotting.prepare_topoplots(topo, ws.mixing_)

# Force diagonal (self-connectivity) to 0
np.fill_diagonal(alpha['hand'], 0)
np.fill_diagonal(alpha['foot'], 0)

order = None
for cls in ['hand', 'foot']:
    np.fill_diagonal(alpha[cls], 0)

    w = alpha[cls]
    m = alpha[cls] > 4

    # use same ordering of components for each class
    if not order:
        order = cuthill_mckee(m)

    # fixed color, but alpha varies with connectivity strength
    r = np.ones(w.shape)
    g = np.zeros(w.shape)
    b = np.zeros(w.shape)
    a = (alpha[cls]-4) / max(np.max(alpha['hand']-4), np.max(alpha['foot']-4))
    c = np.dstack([r, g, b, a])

    plotting.plot_circular(colors=c, widths=w, mask=m, topo=topo,
                           topomaps=mixmaps, order=order)
    plt.title(cls)

plotting.show_plots()