Skip to content

Instantly share code, notes, and snippets.

@rchardptrsn
Created February 10, 2020 01:20
Show Gist options
  • Save rchardptrsn/42f618518d6916ec8053a7d212612046 to your computer and use it in GitHub Desktop.
Save rchardptrsn/42f618518d6916ec8053a7d212612046 to your computer and use it in GitHub Desktop.
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