Last active
June 24, 2022 23:21
-
-
Save jingningzhang1/f4c4aeeec5e026531b8611b0402c428f to your computer and use it in GitHub Desktop.
This file contains 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
def generate_scatter(df, xaxis, comp): | |
axis_labels = { | |
"age": "Age (years)", | |
"height": "Height (inches)", | |
"weight": "Weight (lbs)", | |
} | |
fig = px.scatter( | |
df, | |
x=xaxis, | |
y="risk", | |
color=comp, | |
color_discrete_sequence=custom_color[comp], | |
size="Total", | |
labels={xaxis: axis_labels[xaxis]}, | |
title=f"Comparative Risk by Demographic", | |
) | |
return fig_style(fig) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment