Skip to content

Instantly share code, notes, and snippets.

@rian-dolphin
Created May 27, 2022 13:16
Show Gist options
  • Save rian-dolphin/8ae0eed5e807d500fc9553acc088a6c7 to your computer and use it in GitHub Desktop.
Save rian-dolphin/8ae0eed5e807d500fc9553acc088a6c7 to your computer and use it in GitHub Desktop.
# -- Create the figure in Plotly
fig = px.scatter(
filtered_df,
x="gdpPercap",
y="lifeExp",
size="pop",
color="continent",
hover_name="country",
log_x=log_x_choice,
size_max=60,
)
fig.update_layout(title="GDP per Capita vs. Life Expectancy")
# -- Input the Plotly chart to the Streamlit interface
st.plotly_chart(fig, use_container_width=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment