From 1f20bc40d85e559edd4de8fd53f48697aa484ce5 Mon Sep 17 00:00:00 2001 From: itraviv Date: Thu, 12 Jan 2017 18:27:38 +0200 Subject: fixed missing-information issue when presenting time. Signed-off-by: itraviv --- doc/TRexDataAnalysisV2.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/TRexDataAnalysisV2.py b/doc/TRexDataAnalysisV2.py index 28894ea2..f154efbe 100755 --- a/doc/TRexDataAnalysisV2.py +++ b/doc/TRexDataAnalysisV2.py @@ -2,10 +2,14 @@ import pandas as pd import numpy as np import matplotlib + matplotlib.use('Agg') from matplotlib import pyplot as plt +from matplotlib import dates as matdates +from matplotlib import lines as matlines import os import time +from datetime import datetime """ This Module is structured to work with a raw data at the following JSON format: @@ -124,8 +128,14 @@ class Setup: self.all_tests_data_table = reduce(lambda x, y: pd.merge(x, y, how='outer'), all_tests_trend_data) def plot_trend_graph_all_tests(self, save_path='', file_name='_trend_graph.png'): - for test_name in self.test_names: - self.all_tests_data_table[test_name].plot(style=['.-']) + time_format = '%d-%m-%Y-%H:%M' + for test in self.tests: + test_data = test.results_df[test.results_df.columns[2]].tolist() + test_time_stamps = test.results_df[test.results_df.columns[3]].tolist() + test_time_stamps.append(self.end_date+'-23:59') + test_data.append(test_data[-1]) + float_test_time_stamps = [matdates.date2num(datetime.strptime(x, time_format)) for x in test_time_stamps] + plt.plot_date(x=float_test_time_stamps, y=test_data, label=test.name, fmt='-', xdate=True) plt.legend(fontsize='small', loc='best') plt.ylabel('MPPS/Core (Norm)') plt.title('Setup: ' + self.name) -- cgit 1.2.3-korg