I have the following dictionary:
top = {'aaaa': {'โน': 7, '๐น': 12, '๐ก': 6},
'bbbb': {'๐': 2, '๐': 2, '๐': 2},
'cccc': {'โน': 5, '๐': 3, '๐': 3},
'dddd': {'๐': 8, '๐': 7, '๐ค': 3},
'eeee': {'โบ': 3, '๐': 5, '๐': 4},
'ffff': {'โน': 5, '๐': 5, '๐ข': 5}}
Each 'aaaa' or 'bbbb' is the user's name, and his values is the emoji he is using the most. I want to plot a decent looking graph to visualize. After a few tries, this is my best work:
with the code:
import matplotlib.pyplot as plt
def top_emoji(top):
fig, ax = plt.subplots(figsize=(8, 5))
y = 9
level = 0
start = 9
for name, dictionary in top.items():
ax.text(start, y - level, name, fontsize=20)
x = 3
for emoj in dictionary.keys():
ax.text(start - x, y - level, emoj, fontname='Segoe UI Emoji', fontsize=20)
x += 1
level += 1
ax.axis([0, 10, 0, 10])
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
ax.axis('off')
plt.show()
Which is terrible in my opinion. Any recommendations for improvements will be much appreciated.