-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlotter.py
43 lines (32 loc) · 932 Bytes
/
Plotter.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
#____________________________________________
# #
# Zipf's law has been verified #
# #
#___________________________________________#
#modify paths and names according to your file paths and names.
from csv import reader
from matplotlib import pyplot
path = 'C:\South\S'
N = path+'onetoEighteenModified.csv'
with open(N, 'r') as f:
data = list(reader(f))
x = 1
temp = [24843/int(i[2]) for i in data]
for i in data:
print(i[2])
# x = 1
# for i in data:
# i2 = int(i[1])/x
# temp2 = i2
# x += 1
#print(temp)
#change range according to your will :)
pyplot.plot(range(len(temp[0:20])), temp[0:20])
pyplot.show()
# import time
# time.sleep(5)
pyplot.yscale('log')
pyplot.xscale('log')
pyplot.plot(range(len(temp[0:24000])), temp[0:24000])
#pyplot.plot(range(len(temp2[0:15000])), temp2[0:15000])
pyplot.show()