【发布时间】:2018-10-15 07:13:48
【问题描述】:
我正在尝试按 Pandas 数据框中的列确定的类别对地图上的点进行分组。下面的代码使用 plotly 和 Dash 框架来构建地图布局和绘图坐标。
for i, row in Comp_data.groupby('Group'):
data.append({
"type": "scattermapbox",
"lat": [hlat],
"lon": [hlong],
"name": "Location",
"mode": "markers",
"marker": {
"symbol": "circle",
"color": "grey", <-- needs to be dynamic based on the group
"size": 6,
"opacity": 0.7
}
}
)
有什么想法/建议吗?
【问题讨论】:
标签: pandas matplotlib plotly mapbox plotly-dash