original_docstring: Plots raw signal with event markers on top.
      
      Parameters
      ----------
      recording: dict
          contains EEG channels, events and timestamps
      ch_names: list(str)
          List of channels to create epochs from
      
docstring: Plots raw signal with event markers on top.
  Parameters
  
  dict
  contains EEG channels, events and timestamps
  ch_names: list(str)
  List of channels to create epochs from
docstring_tokens: Plots raw signal with event markers on top . Parameters dict contains EEG channels events and timestamps ch_names : list ( str ) List of channels to create epochs from
code: def mark_events(recording, ch_names = []):
      """Plots raw signal with event markers on top.
      
      Parameters
      ----------
      recording: dict
          contains EEG channels, events and timestamps
      ch_names: list(str)
          List of channels to create epochs from
      """
      events = recording['events']
      #get number of event types
      unique_events =events['code'].unique()
      
      subject_name = recording['subject_name']
      
      # If the user does not specify otherwise, plot all eeg channels overlapping
      if not ch_names:
          ch_names = recording['eeg_names']
      
      #Choose colormap
      colormap = plt.cm.Paired # gist_ncar #nipy_spectral, Set1,Paired   
      colors = [colormap(i) for i in np.linspace(0, 1,len(unique_events))]
      
      color_dict =  {name: colors[i] for i, name in enumerate(unique_events)}
      
      fig, axes = plt.subplots(1,1)
      fig.suptitle(subject_name, fontweight = 'bold')
           
      for electrode_name in ch_names:
  
          
          sig = recording[electrode_name]
          axes.plot(recording["timestamp"], sig, alpha = 0.5, label = electrode_name)
          
          
          ymin, ymax = axes.get_ylim()
           #Pos for annotations
          ypos = ymax - np.abs(ymin) + np.abs(ymax)/3.0
          
      for idx, row in recording["events"].iterrows():
          axes.axvline(idx, linestyle='--',label = row['code'], color = color_dict[row['code']])
          axes.annotate(row['code'], xy = (idx, ypos), rotation = 90, color = color_dict[row['code']], horizontalalignment='right')            
      
      handles, labels = plt.gca().get_legend_handles_labels()
      by_label = OrderedDict(zip(labels, handles))
      plt.legend(by_label.values(), by_label.keys())
code_tokens: def mark_events ( recording , ch_names = [ ] ) : events = recording [ 'events' ] unique_events = events [ 'code' ] . unique ( ) subject_name = recording [ 'subject_name' ] if not ch_names : ch_names = recording [ 'eeg_names' ] colormap = plt . cm . Paired colors = [ colormap ( i ) for i in np . linspace ( 0 , 1 , len ( unique_events ) ) ] color_dict = { name : colors [ i ] for i , name in enumerate ( unique_events ) } fig , axes = plt . subplots ( 1 , 1 ) fig . suptitle ( subject_name , fontweight = 'bold' ) for electrode_name in ch_names : sig = recording [ electrode_name ] axes . plot ( recording [ "timestamp" ] , sig , alpha = 0.5 , label = electrode_name ) ymin , ymax = axes . get_ylim ( ) ypos = ymax - np . abs ( ymin ) + np . abs ( ymax ) / 3.0 for idx , row in recording [ "events" ] . iterrows ( ) : axes . axvline ( idx , linestyle = '--' , label = row [ 'code' ] , color = color_dict [ row [ 'code' ] ] ) axes . annotate ( row [ 'code' ] , xy = ( idx , ypos ) , rotation = 90 , color = color_dict [ row [ 'code' ] ] , horizontalalignment = 'right' ) handles , labels = plt . gca ( ) . get_legend_handles_labels ( ) by_label = OrderedDict ( zip ( labels , handles ) ) plt . legend ( by_label . values ( ) , by_label . keys ( ) )
short_docstring: Plots raw signal with event markers on top.
short_docstring_tokens: Plots raw signal with event markers on top .
comment: """Plots raw signal with event markers on top.
      
      Parameters
      ----------
      recording: dict
          contains EEG channels, events and timestamps
      ch_names: list(str)
          List of channels to create epochs from
      """$SEP$#get number of event types$SEP$# If the user does not specify otherwise, plot all eeg channels overlapping$SEP$#Choose colormap$SEP$# gist_ncar #nipy_spectral, Set1,Paired   $SEP$#Pos for annotations