From 426b56dfb54218750cc18cc55241f98f1d3a1160 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Fri, 18 Sep 2020 14:10:50 -0700 Subject: [PATCH] No issue: change x axis to dates instead of epoch time. --- fenix-retrieval/generate_applink_data.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fenix-retrieval/generate_applink_data.py b/fenix-retrieval/generate_applink_data.py index c984907..f0dc2b2 100755 --- a/fenix-retrieval/generate_applink_data.py +++ b/fenix-retrieval/generate_applink_data.py @@ -158,7 +158,7 @@ def build_csv( allph.append( (artifact["url"], ph, ph.split("-")[0], data["task.id"][c]) ) - + ## Download the perfherder data and get its commit date nallph = [] for url, file, rev, taskid in allph: @@ -203,13 +203,20 @@ def build_csv( try: from matplotlib import pyplot as plt + plot_allphs = optimize_for_plotting(allphs) plt.figure() - plt.scatter([v[0] for v in allphs], [v[1] for v in allphs]) + plt.plot_date([v[0] for v in plot_allphs], [v[1] for v in plot_allphs]) plt.show() except ImportError: print("Skipping print stage, cannot find matplotlib") return +def optimize_for_plotting(data): + import matplotlib.dates + def transform_row(row): + matplot_date = matplotlib.dates.epoch2num(row[0]) + return [matplot_date] + row[1:] + return [transform_row(list(row)) for row in data] if __name__=="__main__": args = csv_generation_parser().parse_args()