forked from fabiopetrillo/OpenHubExtractor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPairChartCreator.py
More file actions
34 lines (24 loc) · 782 Bytes
/
PairChartCreator.py
File metadata and controls
34 lines (24 loc) · 782 Bytes
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
import numpy as np
import sys
import matplotlib.pyplot as plt
from numpy.random import rand
from numpy import arange
plt.rcdefaults()
# Line command CSV file argument
pairDataFile = sys.argv[1]
data = np.genfromtxt(pairDataFile, delimiter=',',
dtype=None,max_rows=10, names=True)
print data['Pair']
print data['Occurrences']
y_pos = np.arange(len(data['Occurrences']))
fig = plt.figure()
ax = plt.subplot(111)
ax.barh(y_pos,data['Occurrences'], color='gray', label = "Ocurrences")
ax.set_yticks(y_pos)
ax.invert_yaxis() # labels read top-to-bottom
ax.set_yticklabels(data['Pair'])
ax.set_xlabel('Occurrences')
ax.set_title('Top 10 Programming Languages Pairs in 150 projects')
ax.plot()
plt.show()