Created
February 16, 2019 12:22
-
-
Save ccerv1/fbeae94762dbba456597ddc3de33e2d7 to your computer and use it in GitHub Desktop.
Adds CAGR to the labels and a title that explains the key message
This file contains hidden or 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
| labels = [] | |
| y_vals = [] | |
| cum_sum = 0 | |
| for col_num, country_name in enumerate(production_table.columns): | |
| label = country_name + " " + cagr(production_table[country_name]) | |
| labels.append(label) | |
| prod_val = production_table.iloc[-1,col_num] | |
| y_vals.append((cum_sum * 2 + prod_val)/2) | |
| cum_sum += prod_val | |
| for i, label in enumerate(labels): | |
| ax.text(x=2019.2, y=y_vals[i], s=label) | |
| ax.set_title("Brazil and Vietnam have increased their market share from 33% in 1995 to over 50% today") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment