diff --git a/tag plot b/tag plot new file mode 100644 index 0000000..6aa2b36 --- /dev/null +++ b/tag plot @@ -0,0 +1,17 @@ +def plot_tags(tagCount): + + x,y = zip(*tagCount) + colormap = plt.cm.gist_ncar #nipy_spectral, Set1,Paired + colors = [colormap(i) for i in np.linspace(0, 0.8,50)] + area = [i/4000 for i in list(y)] # 0 to 15 point radiuses + plt.figure(figsize=(10,6)) + plt.ylabel("Number of question associations") + for i in range(len(y)): + plt.plot(i,y[i],marker='o',linestyle='',ms=area[i],label=x[i]) + plt.legend(numpoints=1) + plt.show() +import collections +import matplotlib.pyplot as plt +tagCount = collections.Counter(list(total['Tag'])).most_common(10) +print(tagCount) +plot_tags(tagCount)