When I try to render a plotly.express choropleth plot using streamlit locally, I keep getting these 2 random splotches in Florida and Utah. I am not receiving any errors.
Relevant Streamlit Code Excerpts:
def make_choropleth(input_df, input_id, input_column):
choropleth = px.choropleth(input_df, locations=input_id, color=input_column, locationmode="USA-states",
color_continuous_scale="reds",
scope="usa",
labels={'count':'Count'}
)
choropleth.update_layout(
template='plotly_dark',
plot_bgcolor='rgba(0, 0, 0, 0)',
paper_bgcolor='rgba(0, 0, 0, 0)',
margin=dict(l=0, r=0, t=0, b=0),
height=350
)
return choropleth
##########################
with col[0]:
st.markdown('#### Count of Inbound Movers by Select Characteristics')
choropleth = make_choropleth(df_in_selected, 'current_state_code', 'count')
st.plotly_chart(choropleth, use_container_width=True)
When I create these plots outside of streamlit, there are no random splotches, so I assume there is some kind of bug within streamlit…? Is this the right place to report this?
Relevant Python Code Excerpts:
filtered_df = inbound[(inbound["sex"] == "Female") & (inbound["age_group"] == "0-17") & (inbound["education"] == "Elementary/Middle school") & (inbound["marital_status"] == "Never Married")]
choropleth = px.choropleth(filtered_df, locations="current_state_code", color="count", locationmode="USA-states",color_continuous_scale="reds",
scope="usa",
)
PS: I am very new to python and streamlit, so please forgive me if I am not presenting this issue well enough or to the right audience…
Thanks for any insight!