code: def plotTimeline(dataTask, filename):
      
  
      fig = plt.figure()
      ax = fig.gca()
  
      worker_names = [x for x in dataTask.keys() if "broker" not in x]
  
      min_time = getMinimumTime(dataTask)
      ystep = 1. / (len(worker_names) + 1)
  
      y = 0
      for worker, vals in dataTask.items():
          if "broker" in worker:
              continue
          y += ystep
          if hasattr(vals, 'values'):
              for future in vals.values():
                  start_time = [future['start_time'][0] - min_time]
                  end_time = [future['end_time'][0] - min_time]
                  timelines(ax, y, start_time, end_time)
  
      #ax.xaxis_date()
      #myFmt = DateFormatter('%H:%M:%S')
      #ax.xaxis.set_major_formatter(myFmt)
      #ax.xaxis.set_major_locator(SecondLocator(0, interval=20))
  
      #delta = (stop.max() - start.min())/10
      ax.set_yticks(np.arange(ystep, 1, ystep))
      ax.set_yticklabels(worker_names)
      ax.set_ylim(0, 1)
      #fig.xlim()
      ax.set_xlabel('Time')
      fig.savefig(filename)
docs: Build a timeline