Created
February 10, 2020 01:20
-
-
Save rchardptrsn/42f618518d6916ec8053a7d212612046 to your computer and use it in GitHub Desktop.
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
| import seaborn as sns | |
| import matplotlib.pyplot as plt | |
| # Convert to type float | |
| index_df = df.loc[:,('healthindex','incindex','edindex','year')].astype('float') | |
| # Create the figure | |
| plt.figure(figsize=(10,6)) | |
| # Set a Seaborn chart style | |
| sns.set_style('darkgrid') | |
| # Plot three Seaborn line charts | |
| line1 = sns.lineplot(x='year',y='healthindex',data=index_df, label='Health Index') | |
| line2 = sns.lineplot(x='year',y='incindex',data=index_df,label='Income Index') | |
| line3 = sns.lineplot(x='year',y='edindex',data=index_df,label='Education Index') | |
| plt.ylabel('Index Score') | |
| plt.legend(loc="upper left") | |
| plt.title('Afghanistan Human Development Indexes') | |
| plt.savefig('Afghanistan Indexes') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment