Add ploting

This commit is contained in:
Dawid Jurkiewicz 2020-04-03 15:06:42 +02:00
parent 5bb7658378
commit 7774ef986e
3 changed files with 21 additions and 3 deletions

View File

@ -7,3 +7,4 @@ RUN gcc --version
RUN apt install -y build-essential
RUN apt install -y moreutils
RUN python --version
RUN pip install matplotlib

5
Jenkinsfile vendored
View File

@ -9,7 +9,10 @@ pipeline {
}
stage('Plot') {
steps {
sh label: '', script: './plot.py'
sh label: '', script: './plot.py wer.txt wer.png'
sh label: '', script: './plot.py srr.txt srr.png'
archiveArtifacts 'wer.png'
archiveArtifacts 'srr.png'
}
}
}

16
plot.py
View File

@ -1,7 +1,21 @@
#!/usr/bin/env python
import matplotlib.pyplot as plt
import sys
def read_file(filename):
values = []
with open(filename) as f:
for line in f:
values.append(float(line.rstrip('\n')))
return values
def main():
pass
values = read_file(sys.argv[1])
plt.plot(values)
plt.savefig(sys.argv[2], dpi=1000)
plt.close()
if __name__ == "__main__":