From 0a710fb27ec8743d9320c479fb86058f96116e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=81ysiak?= Date: Thu, 16 May 2019 12:32:08 +0200 Subject: [PATCH] plot generator --- .gitignore | 3 +++ Jenkinsfile | 3 +++ generate_plot.py | 24 +++++++++++++++++++++++- requirements.txt | 3 ++- 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..70e12dc --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea/ +historical_wer_mean_plot.png +historical_srr_plot.png diff --git a/Jenkinsfile b/Jenkinsfile index 90e644b..05b2a1b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,6 +12,9 @@ pipeline { sh 'git --version' sh 'git checkout' sh 'python3 generate_plot.py' + archiveArtifacts artifacts: 'historical_srr_plot' + archiveArtifacts artifacts: 'historical_wer_mean_plot' + } } } diff --git a/generate_plot.py b/generate_plot.py index c806cfe..38b3353 100644 --- a/generate_plot.py +++ b/generate_plot.py @@ -1 +1,23 @@ -print('I am in') \ No newline at end of file +import pandas as pd +from matplotlib.ticker import MaxNLocator + +data = pd.read_csv('./s407259-matrics-data/historical_wer_mean.txt', header=None) + +plot = data.tail(50).plot() + +plot.xaxis.set_major_locator(MaxNLocator(integer=True)) + +plot.get_legend().remove() + +plot.get_figure().savefig('./historical_wer_mean_plot') + + +data = pd.read_csv('./s407259-matrics-data/historical_srr.txt', header=None) + +plot = data.tail(50).plot() + +plot.xaxis.set_major_locator(MaxNLocator(integer=True)) + +plot.get_legend().remove() + +plot.get_figure().savefig('./historical_srr_plot') \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 1411a4a..961b151 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -pandas \ No newline at end of file +pandas +matplotlib \ No newline at end of file