From ef7d6eb04b2aabf0e381dcd733b6ace8036c5c93 Mon Sep 17 00:00:00 2001 From: Alexander Munch-Hansen Date: Thu, 8 Mar 2018 16:36:16 +0100 Subject: [PATCH] plot.py --- plot.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 plot.py diff --git a/plot.py b/plot.py new file mode 100644 index 0000000..ed81069 --- /dev/null +++ b/plot.py @@ -0,0 +1,28 @@ +import sys +import pandas as pd +from datetime import datetime +import csv +import matplotlib.pyplot as plt +import matplotlib.ticker as mtick +import matplotlib.dates as mdates +from matplotlib.backends.backend_pdf import PdfPages +headers = ['Phase', 'Method', 'Total episodes', 'Episodes', 'Sum', 'Mean'] +df = pd.read_csv(sys.stdin, sep=";", names=headers) + +print(df) + +x = df['Total episodes'] +y = df['Mean'] + +fig, ax = plt.subplots(1, 1) +plt.title('Mean over episodes') +plt.xlabel('Episodes') +plt.ylabel('Mean') +plt.grid(True) + +plt.plot(x,y) +plt.show() + +pp = PdfPages(sys.argv[1]) +pp.savefig() +pp.close()