In [7]:
import json
import matplotlib.pyplot as plt
In [30]:
#Hashtag Selection
hashtag = 'Trump'
In [31]:
with open('freq25.json', 'r') as f:
data25 = json.load(f)
In [32]:
chart_data = data25[hashtag]
In [33]:
x = []
for xi in chart_data:
x.append(xi[0])
#x
y = []
for yi in chart_data:
y.append(yi[1])
#y
In [34]:
width = 0.35 # the width of the bars
xx = range(len(x))
fig, ax = plt.subplots()
rects1 = ax.bar(xx,y, width, color='r')
ax.set_ylabel('Anzahl')
ax.set_title(hashtag + ' Haeufigkeit')
ax.set_xticklabels(x)
plt.show()