def plot_all_spk_clusters(self,plot_mean = True,figure_size=(10,10),dpi=600): """ Plot all spike cluster. If event list contains HFO raise error. Parameters ---------- plot_mean: boolean True (default) - plot mean line figure_size: tuple (5,5) (default) - Size of figure, tuple of integers with width, height in inches dpi: int 600 - DPI resolution """ if len(self.event) == 0: raise Exception('No events to plot') htypes = self.__getlist__('htype') if 'HFO' in htypes: raise Exception('HFO htype not accepted') cluster = self.__getlist__('cluster') num_clus = int(np.max(cluster))+1 ncols = int(math.ceil(math.sqrt(num_clus))) nrows = int(math.floor(math.sqrt(num_clus))) fig,sb = plt.subplots(nrows,ncols,sharey=True,figsize=figure_size,dpi=dpi) c = 0 l = 0 for clus in range(num_clus): if c == ncols: c = 0 l += 1 plot_spk_cluster(self, clus, ax = sb[l,c]) sb[l,c].set_title('Cluster ' + str(clus)) c +=1
def ploting(self,idx): clear_output() if self.event[0].htype == 'Spike': plot_spk_cluster(self,idx,color=color, spines = spines, plot_mean = plot_mean, figure_size=figure_size, dpi = dpi) if self.event[0].htype == 'HFO': evlist = [self.event[x] for x in range(len(self.event)) if self.event[x].cluster==idx] plot_mean_hfo(evlist, color = color, xlim =xlim, figure_size=figure_size,dpi=dpi,saveplot=saveplot) plt.suptitle('Cluster ' + str(idx))
def ploting(self,idx,idx2): clear_output() evlist = [self.event[x] for x in range(len(self.event)) if self.event[x].cluster==idx and self.event[x].channel == idx2] if self.event[0].htype == 'Spike': if len(evlist) > 0: plot_spk_cluster(self,idx,idx2,color=color, spines = spines, plot_mean = plot_mean, figure_size=figure_size, dpi = dpi, ax=ax) if self.event[0].htype == 'HFO': plot_mean_hfo(evlist, color = color, xlim =xlim, figure_size=figure_size,dpi=dpi,saveplot=saveplot) plt.suptitle('Channel ' + str(idx2) + ', Cluster ' + str(idx) +' (' +str(len(evlist)) +')') plt.show()
def plot_all_spk_clusters(self, plot_mean=True, figure_size=(10, 10), dpi=600): """ Plot all spike cluster. If event list contains HFO raise error. Parameters ---------- plot_mean: boolean True (default) - plot mean line figure_size: tuple (5,5) (default) - Size of figure, tuple of integers with width, height in inches dpi: int 600 - DPI resolution """ if len(self.event) == 0: raise Exception('No events to plot') htypes = self.__getlist__('htype') if 'HFO' in htypes: raise Exception('HFO htype not accepted') cluster = self.__getlist__('cluster') num_clus = int(np.max(cluster)) + 1 ncols = int(math.ceil(math.sqrt(num_clus))) nrows = int(math.floor(math.sqrt(num_clus))) fig, sb = plt.subplots(nrows, ncols, sharey=True, figsize=figure_size, dpi=dpi) c = 0 l = 0 for clus in range(num_clus): if c == ncols: c = 0 l += 1 plot_spk_cluster(self, clus, ax=sb[l, c]) sb[l, c].set_title('Cluster ' + str(clus)) c += 1
def ploting(self, idx): clear_output() if self.event[0].htype == 'Spike': plot_spk_cluster(self, idx, color=color, spines=spines, plot_mean=plot_mean, figure_size=figure_size, dpi=dpi) if self.event[0].htype == 'HFO': evlist = [ self.event[x] for x in range(len(self.event)) if self.event[x].cluster == idx ] plot_mean_hfo(evlist, color=color, xlim=xlim, figure_size=figure_size, dpi=dpi, saveplot=saveplot) plt.suptitle('Cluster ' + str(idx))