def graph_no_correct(self,average=False): if average == True: no_correct = Graphs(title=self.title,xlabel="Time in Seconds",ylabel="Absorbance",y_names=self.unique_names) fig, ax = no_correct.basic_plot(x_data=self.x_data,y_data=self.averages) plt.show() elif average == False: no_correct = Graphs(title=self.title,xlabel="Time in Seconds",ylabel="Absorbance",y_names=list(self.names)) fig, ax = no_correct.basic_plot(x_data=self.x_data,y_data=self.y_data) plt.show()
def graph_corrected_normalized(self,average=False): if self.dic == None and average == False: baseline = raw_input("Which well had the baseline? ") for i in xrange(0,len(self.names)): if baseline == self.names[i]: baseline_number = i else: pass elif self.dic != None and average == False: for index, name in enumerate(self.names): if name.lower() == 'baseline': baseline_number = index new_names = self.names new_names.pop(baseline_number) baseline_list = self.y_data[baseline_number] data = self.y_data y_data_baseline = [] elif self.dic != None and average == True: for index, name in enumerate(self.unique_names): if name.lower() == 'baseline': baseline_number = index new_names = self.unique_names new_names.pop(baseline_number) baseline_list = self.averages[baseline_number] data = self.averages y_data_baseline = [] for i in xrange(0,len(data)): y_dat = data[i] if i == baseline_number: pass else: for j in xrange(0,len(y_dat)): y_dat[j] = y_dat[j] - baseline_list[j] y_data_baseline.append(y_dat) y_data_normalized = [] for i in xrange(0,len(y_data_baseline)): y_dat = y_data_baseline[i] normalizer = y_dat[0] for j in xrange(0,len(y_dat)): y_dat[j] = y_dat[j] - normalizer y_data_normalized.append(y_dat) no_correct = Graphs(title=self.title,xlabel="Time in Seconds",ylabel="Absorbance",y_names=new_names) fig, ax = no_correct.basic_plot(x_data=self.x_data,y_data=y_data_normalized) plt.show()