Python script update
This commit is contained in:
parent
5f287f23eb
commit
92a900376f
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
test.png
|
||||
wer.png
|
||||
srr.png
|
||||
wer.txt
|
||||
srr.txt
|
||||
plot.png
|
7
Jenkinsfile
vendored
7
Jenkinsfile
vendored
@ -3,7 +3,12 @@ pipeline {
|
||||
stages {
|
||||
stage('Generate plot') {
|
||||
steps {
|
||||
sh label: '', script: 'python plot.py'
|
||||
sh label: '', script: 'python plot.py'
|
||||
}
|
||||
}
|
||||
stage('Archive') {
|
||||
steps {
|
||||
archiveArtifacts 'plot.png'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
31
plot.py
31
plot.py
@ -1,6 +1,31 @@
|
||||
import matplotlib
|
||||
matplotlib.use('Agg')
|
||||
import matplotlib.pyplot as plt
|
||||
plt.plot([1, 2, 3, 4])
|
||||
plt.ylabel('some numbers')
|
||||
plt.savefig('test.png')
|
||||
import csv
|
||||
|
||||
x1 = []
|
||||
y1 = []
|
||||
x2 = []
|
||||
y2 = []
|
||||
counter = 0
|
||||
|
||||
with open('wer.txt','r') as txtfile:
|
||||
plots = csv.reader(txtfile)
|
||||
for row in plots:
|
||||
x1.append(counter)
|
||||
y1.append(float(row[0]))
|
||||
counter += 1
|
||||
|
||||
counter = 0
|
||||
with open('srr.txt','r') as txtfile:
|
||||
plots = csv.reader(txtfile)
|
||||
for row in plots:
|
||||
x2.append(counter)
|
||||
y2.append(float(row[0]))
|
||||
counter += 1
|
||||
|
||||
plt.plot(x1,y1,x2,y2)
|
||||
plt.title('Wykres')
|
||||
plt.legend()
|
||||
#plt.show()
|
||||
plt.savefig('plot.png')
|
||||
|
Loading…
Reference in New Issue
Block a user