-
-
Save rohitsuratekar/9131d632c176f7aef65176d971f33118 to your computer and use it in GitHub Desktop.
Code used for Nature Fees plot
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 | |
from SecretColors import Palette | |
import matplotlib | |
matplotlib.rc("font", family="IBM Plex Sans") | |
p = Palette() | |
data = [ | |
11390, | |
10219, | |
8916, | |
5664, | |
2011 | |
] | |
labels = ["Nature's 'Free'\narticle Fees", | |
"UGC Professor \n(level 14) Salary", | |
"N-PDF Postdoc\nSalary", | |
"CSIR PhD (SRF)\nStipend", | |
"GATE M.Tech\nStipend" | |
] | |
plt.barh(range(len(data)), data, color=p.green(shade=35), zorder=1) | |
plt.yticks(range(len(data)), labels) | |
plt.gca().invert_yaxis() | |
plt.gca().set_facecolor(p.gray(shade=15)) | |
plt.title("Approx. Yearly Salaries of Indian Researchers*") | |
plt.xlabel("in USD") | |
plt.grid(axis="x", ls=":", color=p.gray(shade=50), zorder=0) | |
plt.annotate("*As of November 2020" | |
, xy=(0.98, 0.02), xycoords="axes fraction", ha="right", | |
va="bottom", fontsize=11 | |
) | |
plt.gca().set_zorder(10) | |
plt.tight_layout() | |
plt.savefig("plot.png", dpi=150) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment