Skip to content

Instantly share code, notes, and snippets.

@matael
Last active December 12, 2015 09:19
Show Gist options
  • Select an option

  • Save matael/4750985 to your computer and use it in GitHub Desktop.

Select an option

Save matael/4750985 to your computer and use it in GitHub Desktop.
Langs per nb locutors
#!/usr/bin/env python
# -*- coding:utf8 -*-
from matplotlib import pyplot as plt
data_locutors = {
'Standard Chinese': 1151,
'English': 1000,
'Spanish': 500,
'Hindi': 490,
'Russian': 277,
'Arabic': 255,
'Portuguese': 240,
'Bengali': 215,
'French': 200,
'Malay/Indonesian': 175,
'German': 166,
'Japanese': 132,
'Farsi (Persian)': 110,
'Urdu': 104,
'Punjabi': 103
}
numbers = []
langs = sorted(data_locutors, key=data_locutors.get)
for k in langs:
numbers.append(data_locutors[k])
plt.pie(numbers, labels=langs, colors=('r','g','b'))
plt.title("Number of locutors per languages\n(source : WP)")
plt.savefig("{}.png".format(__file__.split('.')[0]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment