Created
April 1, 2018 20:01
-
-
Save tyarkoni/aad6282bb9fa00aca17aa00fd3a05389 to your computer and use it in GitHub Desktop.
code for silly pie chart (by request)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import seaborn as sns | |
%matplotlib inline | |
rows = [ | |
('Doing research', 50), | |
('Having meetings', 6), | |
('Begging funding agencies for money so I can keep my job', 3), | |
('Doing paperwork', 2), | |
('Reviewing papers', 2), | |
('Declining review requests because "I\'m too busy"', 1.8), | |
('Listening to my TT colleagues whine about time pressure', 1.5), | |
('Complaining to my TT colleagues that I get no respect', 1.5), | |
('Wishing I had grad students to do my work for me', 1.5), | |
('Trying to remember what day of the week it is', 0.5) | |
] | |
labels, sizes = zip(*rows) | |
colors = sns.color_palette('husl', len(labels)) | |
# Plot | |
plt.pie(sizes, labels=labels, colors=colors, autopct='%1.1f%%', textprops={'fontsize': 18}, counterclock=False); | |
plt.axis('equal'); | |
plt.gcf().set_size_inches((10, 10)) | |
plt.title("How I spend my time as a research-track professor", fontsize=26) | |
plt.tight_layout() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment