-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplotter.py
More file actions
101 lines (78 loc) · 2.25 KB
/
Copy pathplotter.py
File metadata and controls
101 lines (78 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import os
import matplotlib.pyplot as plt
from ast import literal_eval as make_tuple
myIndex = int(input("Plotindex: "))
x = []
y = []
currDir = os.path.dirname(__file__)
path = currDir + "/data/ältestesLw/ältestesLw%s.txt"% myIndex
try:
with open(path) as data:
data = data.read().split(";")
data.pop(-1)
lastID = -1;
for i in data:
xCoordinate = make_tuple(i)[0]
yCoordinate = make_tuple(i)[1]
x.append(make_tuple(i)[0])
y.append(make_tuple(i)[1])
plt.plot(x,y)
plt.xlabel("Jahre")
plt.ylabel("Alter in Jahren")
plt.show()
except:
pass
x = []
y = []
path = currDir + "/data/durchschnittsLw/durchschnittsLw%s.txt"% myIndex
try:
with open(path) as data:
data = data.read().split(";")
data.pop(-1)
for i in data:
x.append(make_tuple(i)[0])
y.append(make_tuple(i)[1])
plt.plot(x,y)
plt.xlabel("Jahre")
plt.ylabel("Durchschnittsalter in Jahren")
plt.show()
except:
pass
x = []
y = []
path = currDir + "/data/durchschnittsFitnessLw/durchschnittsFitnessLw%s.txt"% myIndex
try:
with open(path) as data:
data = data.read().split(";")
data.pop(-1)
for i in data:
x.append(make_tuple(i)[0])
y.append(make_tuple(i)[1])
plt.plot(x,y)
plt.xlabel("Jahre")
plt.ylabel("Durchschnittsfitness")
plt.show()
except:
pass
x = []
y1 = []
y2 =[]
path = currDir + "/data/todeUndGeburtenLw/todeUndGeburtenLw%s.txt"% myIndex
try:
with open(path) as data:
data = data.read().split(";")
data.pop(-1)
for i in data:
x.append(make_tuple(i)[0])
y1.append(make_tuple(i)[1])
y2.append(make_tuple(i)[2])
plt.plot(x,y1,"r-")
plt.plot(x,y2,"g-")
plt.xlabel("Jahre")
plt.ylabel("Tode und Geburten")
plt.show()
except:
pass
def plotIDs(dataTuple, currentPlot):
print("calleds")
currentPlot.plot(dataTuple[0], dataTuple[1], "bx", markersize=4)