Skip to content

Instantly share code, notes, and snippets.

@ccerv1
Created February 16, 2019 12:16
Show Gist options
  • Select an option

  • Save ccerv1/09e863b4f3ea94cb4ef9301cb967b937 to your computer and use it in GitHub Desktop.

Select an option

Save ccerv1/09e863b4f3ea94cb4ef9301cb967b937 to your computer and use it in GitHub Desktop.
Chart of coffee production by origin
production_table /= 1000 # change to millions instead of thousands of bags
fig, ax = plt.subplots()
production_table.plot(
kind='area',
stacked=True,
figsize=(12,8),
alpha=0.4,
colormap='Blues',
legend=False,
ax=ax
)
ax.set_ylabel("Coffee Production (bags, millions)")
# tighten up the x-axis
max_year = production_table.index[-1]
ax.set_xlim(max_year-YEARS_IN_SERIES+1, max_year)
ax.set_xlabel("Crop Year")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment