我正试图创建一个choropleth地图,以便从数据帧中可视化每个大陆的总页面浏览量,但plotly library函数的locationmode参数没有该地图。有没有办法解决此问题?当我将“国家名称”用于locationmode时,它不起作用
st.subheader("Continent's Total Pageviews Choropleth Map")
fig2 = go.Figure(data= go.Choropleth(
locations= df1['continent'],
z = df1['total_pageviews'].astype(float),
locationmode = 'country names',
colorscale = 'Reds',
colorbar_title = "Total Pageviews",
))
fig2.update_layout( width = 1100 , height = 500 )
st.write(fig2)
相关问题 更多 >
编程相关推荐