-
Notifications
You must be signed in to change notification settings - Fork 1
/
graph.py
76 lines (55 loc) · 3.16 KB
/
graph.py
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
import pandas as pd
import numpy as np
from reading_spans import get_span as gs
import matplotlib.pyplot as plt
import seaborn as sns
from fine import Master as gm
from summ import summary
class plot:
def get_plot(spanid,df):
fig, ax = plt.subplots()
z=df.loc[df['hdd']==True,['Chainage']]
y=df.loc[df['hdd_marker']]
plt.plot(z['Chainage'],[2]*len(z),'o',color='grey',label="HDD",alpha=1,markersize=2)
plt.plot(y['Chainage'],[2]*len(y),'|',color='grey',markersize=20,alpha=0.3)
z=df.loc[df['tnd_ot']==True,['Chainage']]
y=df.loc[df['tnd_ot_marker']==True,['Chainage']]
plt.plot(z['Chainage'],[2]*len(z),'o',color='green',label="OT",alpha=0.7,markersize=3.5)
plt.plot(y['Chainage'],[2]*len(y),'|',color='green',markersize=20,alpha=0.3)
z=df.loc[df['tnd_overlap']==True,['Chainage']]
#y=df.loc[df['tnd_ot_marker']==True,['Chainage']]
plt.plot(z['Chainage'],[2]*len(z),'o',color='red',label="tnd overlap",markersize=3)
#plt.plot(y['Chainage'],[2]*len(y),'|',color='green',markersize=20,alpha=0.3)
z=df.loc[df['drt']==True,['Chainage']]
y=df.loc[df['drt_marker']==True,['Chainage']]
plt.plot(z['Chainage'],[2]*len(z),'o',color='blue',label="DRT",alpha=0.3,markersize=5)
plt.plot(y['Chainage'],[2]*len(y),'|',color='blue',markersize=20,alpha=0.3)
z=df.loc[df['drt_duct_dam']==True,['Chainage']]
y=df.loc[df['drt_duct_dam_marker']==True,['Chainage']]
plt.plot(z['Chainage'],[3]*len(z),'o',color='brown',label="Duct_Dam",alpha=0.4,markersize=5)
plt.plot(y['Chainage'],[3]*len(y),'|',color='brown',markersize=20,alpha=0.3)
z=df.loc[df['dit_duct_miss']==True,['Chainage']]
y=df.loc[df['dit_duct_miss_marker']==True,['Chainage']]
plt.plot(z['Chainage'],[3]*len(z),'o',color='black',label="Duct_Miss",alpha=1,markersize=3)
plt.plot(y['Chainage'],[3]*len(y),'|',color='black',markersize=15,alpha=0.3)
z=df.loc[df['duct_overlap']==True,['Chainage']]
#y=df.loc[df['drt_duct_dam_marker']==True,['Chainage']]
plt.plot(z['Chainage'],[3]*len(z),'o',color='red',label="Duct overlap",markersize=4)
#plt.plot(y['Chainage'],[3]*len(y),'|',color='brown',markersize=20,alpha=0.3)
z=df.loc[df['dit']==True,['Chainage']]
y=df.loc[df['dit_marker']==True,['Chainage']]
plt.plot(z['Chainage'],[4]*len(z),'o',color='yellow',label="DIT",alpha=0.7,markersize=5)
plt.plot(y['Chainage'],[4]*len(y),'|',color='yellow',markersize=20,alpha=0.3)
z=df.loc[df['blow']==True,['Chainage']]
y=df.loc[df['blow_marker']==True,['Chainage']]
plt.plot(z['Chainage'],[5]*len(z),'o',color='orange',label="BLOWING",alpha=0.7,markersize=5)
plt.plot(y['Chainage'],[5]*len(y),'|',color='orange',markersize=20,alpha=0.3)
#labels = [item.get_text() for item in ax.get_yticklabels()]
#labels[1] = 'HDD/OT/DRT'
#labels[5] = 'DIT'
#labels[7] = 'BLOWING'
#ax.set_yticklabels(labels)
plt.legend(loc="upper left")
plt.title(spanid)
#df.plot(kind='scatter',x=z,y=[2]*len(z),color='red')
plt.show()