Skip to content

Instantly share code, notes, and snippets.

@kurasaiteja
Last active March 21, 2021 15:07
Show Gist options
  • Save kurasaiteja/9b4380e856043c16ca07e60f270cd00b to your computer and use it in GitHub Desktop.
Save kurasaiteja/9b4380e856043c16ca07e60f270cd00b to your computer and use it in GitHub Desktop.
countries = short.groupby('country')['total_vaccinations'].max().sort_values(ascending=False)[:10].index.tolist()
title = get_multi_line_title("Vaccination Progress", "Rate of vaccinations for the top-10 vaccinated countries")
line_plots = []
for c in countries:
vacc_data = short[short.country == c]
line_plots.append(
go.Scatter(
name = c,
x = vacc_data.date,
mode='lines+markers',
y=vacc_data['total_vaccinations'],
)
)
fig = go.Figure(line_plots)
fig.update_layout(
title =title,
yaxis_title="Count",
hovermode='x',
legend_orientation = 'h',
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment