def plot_GoRTs(self): fig = plt.gcf() fig.subplots_adjust(bottom=0.2) base = np.array([np.mean(subj) for subj in self.GoRT['intact']]) tags = self.tags[1:] for t,tag in enumerate(tags): diff_scores = [np.mean(subj) for subj in self.GoRT[tag]]-base plt.bar(t-.4, np.mean(diff_scores)*self.ms, yerr=sem(diff_scores)*self.ms, color='.7', label=tag, ecolor='k') plt.xticks(range(len(self.names)), self.names) #np.linspace(0.5,len(self.tags),len(self.tags)-.5), self.tags) plt.ylabel('GoRT relative to intact (ms)') plt.ylim(-20*self.ms,20*self.ms) #plt.tick_params(labelsize='medium') #plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.) ax = plt.gca() fontsize = 13 for tick in ax.xaxis.get_major_ticks(): tick.label1.set_fontsize(fontsize) for tick in ax.yaxis.get_major_ticks(): tick.label1.set_fontsize(fontsize)
def calc_cond_mean_std(data, cond, col): cond_idx = np.where(cond)[0] cond_data = data[cond_idx] cond_data_mean = np.mean(cond_data[col], axis=0) cond_data_median = np.median(cond_data[col], axis=0) cond_data_sem = sem(cond_data[col], axis=0) return (cond_data, cond_data_mean, cond_data_median, cond_data_sem)
def plot_SSDs(self): fig = plt.gcf() fig.subplots_adjust(bottom=0.2) base = np.array([np.mean(subj) for subj in self.SSD['intact']]) tags = self.tags[1:] for t, tag in enumerate(tags): plt.bar(t - .4, np.mean([np.mean(subj) for subj in self.SSD[tag]] - base) * self.ms, yerr=sem([np.mean(subj) for subj in self.SSD[tag]]) * self.ms, color='.7', label=tag, ecolor='k') plt.xticks( range(len(self.names)), self.names ) #np.linspace(0.5,len(self.tags),len(self.tags)-.5), self.tags) plt.ylabel('SSD relative to intact (ms)') #plt.tick_params(labelsize='medium') plt.ylim(-20 * self.ms, 20 * self.ms) ax = plt.gca() fontsize = 13 for tick in ax.xaxis.get_major_ticks(): tick.label1.set_fontsize(fontsize) for tick in ax.yaxis.get_major_ticks(): tick.label1.set_fontsize(fontsize)
def plot_SSDs(self): fig = plt.gcf() fig.subplots_adjust(bottom=0.2) base = np.array([np.mean(subj) for subj in self.SSD['intact']]) tags = self.tags[1:] for t,tag in enumerate(tags): plt.bar(t-.4, np.mean([np.mean(subj) for subj in self.SSD[tag]]-base)*self.ms, yerr=sem([np.mean(subj) for subj in self.SSD[tag]])*self.ms, color='.7', label=tag, ecolor='k') plt.xticks(range(len(self.names)), self.names) #np.linspace(0.5,len(self.tags),len(self.tags)-.5), self.tags) plt.ylabel('SSD relative to intact (ms)') #plt.tick_params(labelsize='medium') plt.ylim(-20*self.ms,20*self.ms) ax = plt.gca() fontsize = 13 for tick in ax.xaxis.get_major_ticks(): tick.label1.set_fontsize(fontsize) for tick in ax.yaxis.get_major_ticks(): tick.label1.set_fontsize(fontsize)