def plot_setups(experiments,save=True): for i,ex in enumerate(experiments): figure(figsize=(25,2)) plo.eplotsetup(ex,'rsync') title("similarity "+str(ex.similarity)) if save: savefig(ex.name+'.pdf', bbox_inches='tight')
def plotsetup(self, measure=None): """ plot the network, input region and region of interest of the selected measure""" plo.eplotsetup(self, measure)
def plot_setups(experiments): for ex in experiments: figure(figsize=(0.15 * N, 0.15 * M)) plo.eplotsetup(ex, '$R_{syn}$') if save: savefig(par + '_' + ex.name + '.pdf', bbox_inches='tight')
scattervalues = [0,5,10] names = ['A','B','C'] experiments = [] for name,scatter in zip(names,scattervalues): pattern = net.scramble_stimulus(network,line,sct=scatter,seed=1) experiments.append(lab.experiment(network,seeds,inputc=pattern,transient=1000, name=name, verbose=True, downsample=downsample,con_upstr_exc=con_upstr_exc, measures=[lab.spikey_rsync(roi=pattern,name="$R_{syn}$", tau=10.0/downsample), lab.spikey_rsync(roi=pattern,window="growing",increment=2000/downsample,name="$R_{syn, t}$", tau=10.0/downsample), lab.mean_spikecount(roi=pattern,window="growing",increment=2000/downsample,name="$spikecount_{t}$") ])) # # Plot close('all') plo.eplotsetup(experiments[0], measurename='$R_{syn}$') experiments[0].viewtrial() savefig(par+'_example_trial.pdf', bbox_inches='tight') delta_t = experiments[0].simulation_kwargs['delta_t'] plo.compare(experiments,grid_as="graph",plot_as='boxplot',measurename="$R_{syn}$", vrange=[0, 1], label_names=True) savefig(par+'_overview_graphs.pdf', bbox_inches='tight') plo.compare_windowed(experiments,'$R_{syn, t}$', unit=delta_t*downsample/1000, plot_as='bandplot', do_title=False) savefig(par+'_rsync_change.pdf', bbox_inches='tight') plo.compare_windowed(experiments,'$spikecount_{t}$', unit=delta_t*downsample/1000, do_title=False) savefig(par+'_spikecount_change.pdf', bbox_inches='tight')
# Scatter plot do_scatter_plot(experiments) savefig('rsync_scatter.pdf', bbox_inches='tight') # Connectivity plot doboxplot([[e.network_match for e in bin] for bin in experiments_binned], [0]+bins) title('connectivity of inout-receiving cells') ylabel("# connections / # input-receiving") ylim(ymin=-0.1) xlabel("Similarity index") savefig('network_sampling_variability.pdf', bbox_inches='tight') # Low synchrony, high similarity plot figure(figsize=(25,2)) lowest_sync_highest_similarity = experiments_binned[-2][np.argmin([exp.getresults('rsync') for exp in experiments_binned[-2]])] plo.eplotsetup(lowest_sync_highest_similarity, measurename='rsync') title('example of a situation with low sync\ndespite high similarity index') savefig('low_sync_high_similarity.pdf', bbox_inches='tight') x = [ex.similarity for ex in experiments] y = [ex.getresults('rsync')[0] for ex in experiments] with open('results_4.txt', 'w') as f: f.write('similarities_binned:\n' + str(similarities_binned) + '\n\nrsyncs (binned):\n' + str(rsyncs) + '\n\n') f.write('similarities:\n' + str(x) + '\n\nrsyncs:\n' + str(y)) print('\a')