Skip to content

Instantly share code, notes, and snippets.

@tyarkoni
Created April 1, 2018 20:01
Show Gist options
  • Save tyarkoni/aad6282bb9fa00aca17aa00fd3a05389 to your computer and use it in GitHub Desktop.
Save tyarkoni/aad6282bb9fa00aca17aa00fd3a05389 to your computer and use it in GitHub Desktop.
code for silly pie chart (by request)
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