提问人:Le Cao Tung Lam 提问时间:11/1/2023 更新时间:11/1/2023 访问量:20
我的分区统计图没有任何颜色。我该如何解决?
My choropleth plot does not have any color. How can I fix it?
问:
我正在使用分区统计图在 html fomat 中制作绘图图。当我拿到地图时,我无法将鼠标悬停并查看颜色(代表数据)。
我不知道数据会发生什么,为什么它没有在地图上表示?
这是我的代码:
fig = px.choropleth(
gdf_year,
geojson=gdf_year['geometry'],
locations=gdf_year['STATE_NAME'],
color=gdf_year['colony_lost'],
color_continuous_scale='YlGnBu',
hover_name=gdf_year['STATE_NAME'],
title=f"Bee Colony Loss by State - Year {year}",
scope='usa',
range_color=(0, 200000)
)
数据框:gdf_year
对于我的全部工作,它将在这里
我做了什么来验证错误:我已经验证了数据框、名称、数据类型,但我无法使其工作。
我期望什么:我想在地图上看到颜色,代表状态数据 (colony_lost)
答: 暂无答案
评论
color='colony_lost'.