-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplotGraph_Dec.py
34 lines (31 loc) · 905 Bytes
/
plotGraph_Dec.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
#!/usr/bin/Python
##
# @file plotGraph.py
# @brief This file is used to plot the graph of the DCELs generated by the program.
# @author Suvigya Sharma (2020A7PS0140H)
# @author Anshul Kanodia (2020A7PS0174H)
# @bug No known bugs.
##
import matplotlib.pyplot as plt
# Remember the starting point should be repeated at the end of every DCEL just to accomodate to this script file.
with open("plotData_Decomposed.txt", 'r') as f:
input = f.readlines()
i = 0
numberofGraph = 1
while(i<len(input)):
t1 = input[i].split(' ')
t2 = input[i+1].split(' ')
x = []
y = []
for j in t1:
x.append(float(j))
for j in t2:
y.append(float(j))
plt.plot(x, y, label = "plot " + str(numberofGraph))
numberofGraph += 1
i += 2
plt.xlabel('x axis')
plt.ylabel('y axis')
# plt.legend()
plt.title('Graph')
plt.show()