Beispiel #1
0
        gs = GridSpec(nrows=nrows, ncols=ncols)

        fig.suptitle('RANK {}'.format(RANK))
        counter = 0
        # somatic traces
        tvec = np.arange(PSET.tstop / PSET.dt + 1) * PSET.dt
        tinds = tvec >= PSET.TRANSIENT
        for i, name in enumerate(PSET.populationParameters['me_type']):
            population = network.populations[name]
            for j, cell in enumerate(population.cells):
                ax = fig.add_subplot(gs[counter, 0])
                if counter == 0:
                    ax.set_title('somatic voltages')
                ax.plot(tvec[tinds][::PSET.decimate_q],
                        decimate(cell.somav[tinds], q=PSET.decimate_q),
                        color=colors[i],
                        lw=1.5,
                        label=name)
                ax.set_ylabel('gid {}'.format(population.gids[j]),
                              rotation='horizontal',
                              labelpad=30)
                ax.axis(ax.axis('tight'))
                ax.set_ylim(-90, -20)
                ax.legend(loc='best')
                ax.yaxis.set_major_locator(MaxNLocator(nbins=3))
                counter += 1
                if counter == nrows:
                    ax.set_xlabel('time (ms)')
                else:
                    ax.set_xticklabels([])
     
 gs = GridSpec(nrows=nrows, ncols=ncols)
 
 fig.suptitle('RANK {}'.format(RANK))
 counter = 0
 # somatic traces
 tvec = np.arange(PSET.tstop / PSET.dt + 1)*PSET.dt
 tinds = tvec >= PSET.TRANSIENT
 for i, name in enumerate(PSET.populationParameters['me_type']):
     population = network.populations[name]
     for j, cell in enumerate(population.cells):
         ax = fig.add_subplot(gs[counter, 0])
         if counter == 0:
             ax.set_title('somatic voltages')
         ax.plot(tvec[tinds][::PSET.decimate_q],
                 decimate(cell.somav[tinds],
                          q=PSET.decimate_q),
                 color=colors[i], lw=1.5, label=name)
         ax.set_ylabel('gid {}'.format(population.gids[j]),
                                  rotation='horizontal', labelpad=30)
         ax.axis(ax.axis('tight'))
         ax.set_ylim(-90, -20)
         ax.legend(loc='best')
         ax.yaxis.set_major_locator(MaxNLocator(nbins=3))
         counter += 1
         if counter == nrows:
             ax.set_xlabel('time (ms)')
         else: 
             ax.set_xticklabels([])
 
 # save figure output
 fig.savefig(os.path.join(PSET.OUTPUTPATH,
Beispiel #3
0
        fontsize=16, fontweight='demibold',
        transform=axes[0].transAxes)




    # PANEL C Extracellular potential
    gs0 = GridSpecFromSubplotSpec(12, 1, subplot_spec=gs[:2, 2])
    ax = fig.add_subplot(gs0[:-2])
    f = h5py.File(os.path.join(PSET.OUTPUTPATH, 'example_parallel_network_output.h5'), 'r')
    for data, title, color in zip(
                           [f['SUMMED_OUTPUT'].value['imem']],
                           ['extracellular potentials, summed'],
                           ['k']):
        ax.set_title(title)
        vlimround = plotting.draw_lineplot(ax=ax, data=plotting.decimate(data, q=PSET.decimate_q),
                                  dt=PSET.dt*PSET.decimate_q,
                                  T=T, color=color, scalebarbasis='log10')
    f.close()

    ax.set_xticklabels([])
    ax.set_xlabel('')
    ax.set_ylabel('')
    ax.text(-0.1, 1.055, alphabet[2],
        horizontalalignment='center',
        verticalalignment='center',
        fontsize=16, fontweight='demibold',
        transform=ax.transAxes)


Beispiel #4
0
                 verticalalignment='center',
                 fontsize=16,
                 fontweight='demibold',
                 transform=axes[0].transAxes)

    # PANEL C Extracellular potential
    gs0 = GridSpecFromSubplotSpec(12, 1, subplot_spec=gs[:2, 2])
    ax = fig.add_subplot(gs0[:-2])
    f = h5py.File(
        os.path.join(PSET.OUTPUTPATH, 'example_parallel_network_output.h5'),
        'r')
    for data, title, color in zip([f['SUMMED_OUTPUT'][()]['imem']],
                                  ['extracellular potentials, summed'], ['k']):
        ax.set_title(title)
        vlimround = plotting.draw_lineplot(ax=ax,
                                           data=plotting.decimate(
                                               data, q=PSET.decimate_q),
                                           dt=PSET.dt * PSET.decimate_q,
                                           T=T,
                                           color=color,
                                           scalebarbasis='log10')
    f.close()

    ax.set_xticklabels([])
    ax.set_xlabel('')
    ax.set_ylabel('')
    ax.text(-0.1,
            1.055,
            alphabet[2],
            horizontalalignment='center',
            verticalalignment='center',
            fontsize=16,
Beispiel #5
0
    # Set up figure and subplots 
    fig = plt.figure(figsize=(16, 12))
    gs = GridSpec(15, 5, left=0.075, right=0.975,
                  top=0.95, bottom=0.05, wspace=0.3, hspace=0.2)
    alphabet = 'ABCDEFGHIJKLMNOPQ'


    for j, (m_type, me_type) in enumerate(zip(PSET.populationParameters['m_type'], PSET.populationParameters['me_type'])):
        ax = fig.add_subplot(gs[:8, j])
        f = h5py.File(os.path.join(PSET.OUTPUTPATH, 'example_parallel_network_output.h5'), 'r')
        for data, title, color in zip(
                               [f['SUMMED_OUTPUT'].value[me_type]],
                               [m_type],
                               ['k']):
            ax.set_title(title)
            vlimround = plotting.draw_lineplot(ax=ax, data=plotting.decimate(data, q=PSET.decimate_q),
                                      dt=PSET.dt*PSET.decimate_q,
                                      T=T, color=color,
                                      scalebarbasis='log10')
        
        if j > 0:
            ax.set_yticklabels([])
            ax.set_ylabel('')
        
        ax.text(-0.1, 1.05, alphabet[j],
            horizontalalignment='center',
            verticalalignment='center',
            fontsize=16, fontweight='demibold',
            transform=ax.transAxes)
        
        
Beispiel #6
0
    gs0 = GridSpecFromSubplotSpec(12, 1, subplot_spec=gs[:2, 2])
    ax = fig.add_subplot(gs0[:-2])
    f = h5py.File(
        os.path.join(
            PSET.OUTPUTPATH,
            'example_parallel_network_output.h5'),
        'r')
    for data, title, color in zip(
        [f['SUMMED_OUTPUT'][()]['imem']],
        ['extracellular potentials, summed'],
            ['k']):
        ax.set_title(title)
        vlimround = plotting.draw_lineplot(
            ax=ax,
            data=plotting.decimate(
                data,
                q=PSET.decimate_q),
            dt=PSET.dt *
            PSET.decimate_q,
            T=T,
            color=color,
            scalebarbasis='log10')
    f.close()

    ax.set_xticklabels([])
    ax.set_xlabel('')
    ax.set_ylabel('')
    ax.text(-0.1, 1.055, alphabet[2],
            horizontalalignment='center',
            verticalalignment='center',
            fontsize=16, fontweight='demibold',
Beispiel #7
0
                  wspace=0.3,
                  hspace=0.2)
    alphabet = 'ABCDEFGHIJKLMNOPQ'

    for j, (m_type, me_type) in enumerate(
            zip(PSET.populationParameters['m_type'],
                PSET.populationParameters['me_type'])):
        ax = fig.add_subplot(gs[:8, j])
        f = h5py.File(
            os.path.join(PSET.OUTPUTPATH,
                         'example_parallel_network_output.h5'), 'r')
        for data, title, color in zip([f['SUMMED_OUTPUT'][()][me_type]],
                                      [m_type], ['k']):
            ax.set_title(title)
            vlimround = plotting.draw_lineplot(ax=ax,
                                               data=plotting.decimate(
                                                   data, q=PSET.decimate_q),
                                               dt=PSET.dt * PSET.decimate_q,
                                               T=T,
                                               color=color,
                                               scalebarbasis='log10')

        if j > 0:
            ax.set_yticklabels([])
            ax.set_ylabel('')

        ax.text(-0.1,
                1.05,
                alphabet[j],
                horizontalalignment='center',
                verticalalignment='center',
                fontsize=16,