Scattermapbox maki symbols plot on map, but not legend
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.8k
- 平均合并
- 16 小时 26 分钟
- 30 天内合并 PR
- 21
描述
Hi Plotly,
First, thank you for all the fantastic work you do.
I am a big fan of / heavy user of the plotly.go objects that render maps (Scattermapbox / Choroplethmapbox).
I have noticed, however, that when setting the symbol type to a maki symbol, it will render it on the map - but not the legend. This feels like a bug, as there is also a colour associated with the legend item that is not matched anywhere on the plot / by the symbol (except in hovertext).
Reproducible example below:
import os
import plotly.graph_objects as go
mapboxt = os.getenv('MAPBOX_TOKEN') # a mapbox token
lats = [52.370216, 53.2191696, 50.851368, 51.8125626]
lons = [4.895168, 6.5666699, 5.690973, 5.8372264 ]
fig = go.Figure()
scatt = go.Scattermapbox(
lat=lats,
lon=lons,
mode='markers',
hovertext=['Amsterdam', 'Groningen', 'Maastricht', 'Nijmegen'],
hoverinfo='text',
below='',
marker=dict(symbol ='hospital'),
name ='my_fake_hospitals',
showlegend=True)
fig.add_trace(scatt)
fig.update_layout(go.Layout(title_text ='Is it a hospital? No, it is a blue dot!',
title_x=0.5,
width=750,
height=700,
mapbox = dict(center= dict(lat=52.370216, lon=4.895168),
accesstoken= mapboxt,
zoom=5,
style="light"
)))
fig
Finally, as a side note, some maki symbols plot whilst others do not. I have determined through trial and error that this is down to whether or not the MapBox style includes these specific symbol types. Using custom Mapbox styles, therefore, may silently break the maki functionality as well.
Thanks you for your attention.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先运行提供的、使用 Scattermapbox、Maki 符号 "hospital" 和 showlegend=True 的 Python 可复现示例,然后将地图符号与其图例项进行比较。跟踪 Scattermapbox 对 marker-symbol 和图例的处理,包括关于 Mapbox 样式的注释;当受支持的 Maki 符号在图例和地图中一致显示,并且该行为由回归测试覆盖时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100