docs: def plotSyncs (include =['allCells', 'eachPop'], timeRanges = None, timeRangeLabels = None, colors = None, figSize = ((5,5)), saveData = None, 
          saveFig = None, showFig = True):
      ''' 
      Calculate avg and peak rate of different subsets of cells for specific time period
          - include (['all',|'allCells','allNetStims',|,120,|,'E1'|,('L2', 56)|,('L5',[4,5,6])]): List of data series to include. 
              Note: one line per item, not grouped (default: ['allCells', 'eachPop'])
          - timeRanges ([[start1:stop1], [start2:stop2]]): List of time range of spikes shown; if None shows all (default: None)
          - timeRangeLabels (['preStim', 'postStim']): List of labels for each time range period (default: None)
          - figSize ((width, height)): Size of figure (default: (10,8))
          - saveData (None|True|'fileName'): File name where to save the final data used to generate the figure; 
              if set to True uses filename from simConfig (default: None)
          - saveFig (None|True|'fileName'): File name where to save the figure (default: None)
              if set to True uses filename from simConfig (default: None)
          - showFig (True|False): Whether to show the figure or not (default: True)
  
          - Returns figs
      '''
      from .. import sim
  
      if not colors: colors = colorList
  
      syncs = []
      if not timeRangeLabels:
          timeRangeLabels = ['%f-%f ms'%(t[0], t[1]) for t in timeRanges] #['period '+i for i in range(len(timeRanges))]
  
      for i, timeRange in enumerate(timeRanges):
          print(timeRange)
          _, sync = sim.analysis.plotSpikeStats (include = include, timeRange = timeRange, stats = ['sync'], saveFig = False, showFig =False)
          print(sync)
          sync = [s[0] for s in sync]
          syncs.append(sync)
  
      fig1,ax1 = plt.subplots(figsize=figSize)
  
      # avg
      fontsiz=14
      ax1.set_color_cycle(colors)
      ax1.plot(syncs, marker='o')
      ax1.set_xlabel('Time period', fontsize=fontsiz)
      ax1.set_ylabel('Spiking synchrony', fontsize=fontsiz)
      ax1.set_xticks(list(range(len(timeRangeLabels))))
      ax1.set_xticklabels(timeRangeLabels)
      ax1.set_xlim(-0.5, len(syncs)-0.5)
      ax1.legend(include)
  
      # save figure
      if saveFig: 
          if isinstance(saveFig, basestring):
              filename = saveFig
          else:
              filename = sim.cfg.filename+'_'+'sync.png'
          plt.savefig(filename)
  
      # show fig 
      if showFig: _showFigure()
  
      # save figure data
      if saveData:
          figData = {'includeList': includeList, 'timeRanges': timeRanges, 'syncs': syncs}
  
          _saveFigData(figData, saveData, 'raster')
   
  
  
      return fig1, syncs