Skip to content

Instantly share code, notes, and snippets.

@pjastr
Last active May 23, 2019 15:01
Show Gist options
  • Save pjastr/f1dd3dfcccf64510bba779014c101e2f to your computer and use it in GitHub Desktop.
Save pjastr/f1dd3dfcccf64510bba779014c101e2f to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import pandas as pd
data = pd.read_csv("kolej.csv", sep=";", index_col=1)
data2 = data.iloc[1:, 1]
data3 = data2.sort_values(ascending=False)
labels = data3.index
sizes = data3
explode = (0.1, 0.1, 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
fig1, ax1 = plt.subplots()
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True, startangle=90)
ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment