    scatter = ax.scatter(points['x'], points['y'], marker="d", edgecolor='black')
    tooltip = mpld3.plugins.PointLabelTooltip(scatter, labels=points["labels"])
    ax.legend()
    mpld3.plugins.connect(fig, tooltip)
    #mpld3.save_html(fig, 'test.html')
    mpld3.show()
  
  if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="A tool for analyzing openpilot's end-to-end latency",
                                     formatter_class = argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument("--relative", action="store_true", help="Make timestamps relative to the start of each frame")
 
</s> remove         points["x"].append((event[1]-t0)/1e6)
        points["y"].append(frame_id+0.45)
        points["labels"].append(event[0])
    ax.broken_barh(service_bars, (frame_id, 0.9), facecolors=(["blue", 'green', 'red', 'yellow', 'purple']))

  scatter = ax.scatter(points['x'], points['y'], marker="d", edgecolor='black')
  tooltip = mpld3.plugins.PointLabelTooltip(scatter, labels=points["labels"])
  ax.legend()
 </s> add         points['x'].append((event[1]-t0)/1e6)
        points['y'].append(frame_id)
        points['labels'].append(event[0])
    ax.broken_barh(service_bars, (frame_id-0.45, 0.9), facecolors=(colors), alpha=0.5)

  scatter = ax.scatter(points['x'], points['y'], marker='d', edgecolor='black')
  tooltip = mpld3.plugins.PointLabelTooltip(scatter, labels=points['labels']) </s> remove DEMO_ROUTE = "9f583b1d93915c31|2022-04-01--17-51-29"
 </s> add DEMO_ROUTE = "9f583b1d93915c31|2022-04-06--11-34-03" </s> remove import matplotlib.pyplot as plt
 </s> add 
  plt.legend(handles=[mpatches.Patch(color=colors[i], label=SERVICES[i]) for i in range(len(SERVICES))])
  #mpld3.save_html(fig, 'latencylogger_plot.html')
  mpld3.show(fig)
    scatter = ax.scatter(points['x'], points['y'], marker="d", edgecolor='black')
    tooltip = mpld3.plugins.PointLabelTooltip(scatter, labels=points["labels"])
    ax.legend()
    mpld3.plugins.connect(fig, tooltip)
  plt.legend(handles=[mpatches.Patch(color=colors[i], label=SERVICES[i]) for i in range(len(SERVICES))])
  #mpld3.save_html(fig, 'latencylogger_plot.html')
  mpld3.show(fig)
  plt.legend(handles=[mpatches.Patch(color=colors[i], label=SERVICES[i]) for i in range(len(SERVICES))])
  #mpld3.save_html(fig, 'latencylogger_plot.html')
  mpld3.show(fig)
  
  if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="A tool for analyzing openpilot's end-to-end latency",
                                     formatter_class = argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument("--relative", action="store_true", help="Make timestamps relative to the start of each frame")
keep keep keep keep replace replace keep keep keep keep keep
 latencylogger graph design (#24165)

* latencylogger graph design

* Update tools/latencylogger/latency_logger.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* quotes

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> 
tools/latencylogger/latency_logger.py