-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcamelplot.py
82 lines (59 loc) · 2.03 KB
/
camelplot.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
77
78
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import sys
from IPython.display import set_matplotlib_formats
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
import matplotlib
import math
import numpy as np
import scipy as sp
import seaborn as sns
import scipy.signal as sps
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = [9.5, 5]
import pandas
specific = "dns"
args = sys.argv[1:]
if len(args) >= 1:
specific = args[0]
# In[6]:
data=pandas.read_csv("data/" + specific + "_camel.csv", delim_whitespace=True)
data["TIME"]=pandas.to_datetime(data["TIME"],infer_datetime_format=True, unit='s', utc=True)
data.set_index("TIME")
# In[28]:
for k in ["INTERNET_STANDARD", "PROPOSED_STANDARD", "EXPERIMENTAL", "HISTORIC", "BEST_CURRENT_PRACTICE", "OBSOLETED", "UNKNOWN"]:
if k not in data:
data[k] = 0
plt.figure()
plt.stackplot(data["TIME"],
data["INTERNET_STANDARD"],
data["PROPOSED_STANDARD"],
data["EXPERIMENTAL"],
data["HISTORIC"],
data["BEST_CURRENT_PRACTICE"],
data["OBSOLETED"],
data["UNKNOWN"],
labels=["Internet Standard", "Proposed Standard", "Experimental", "Historic", "Best Current Practice", "Obsoleted", "Unknown"])
plt.legend(loc=2)
plt.grid()
plt.xlabel("Year")
plt.ylabel("Pages")
plt.title("Number of RFC pages covering " + specific.upper() + " over time")
plt.savefig("data/" + specific + "_camel-plot.png", dpi=300)
# In[29]:
plt.figure()
plt.stackplot(data["TIME"],
data["INTERNET_STANDARD"],
data["PROPOSED_STANDARD"],
data["BEST_CURRENT_PRACTICE"],
data["UNKNOWN"],
labels=["Internet Standard", "Proposed Standard", "Best Current Practice", "Unknown"])
plt.legend(loc=2)
plt.grid()
plt.xlabel("Year")
plt.ylabel("Pages")
plt.title("Number of RFC pages covering " + specific.upper() + " over time")
plt.savefig("data/" + specific + "_camel-plot-clean.png", dpi=300)
# In[ ]: