能否在图例中绘图显示Maki图标?

2024-10-02 06:21:09 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试将图例添加到使用plotly创建的图形中,该图形包含一些Maki图标。不幸的是,当我这样做时,plotly在图例中显示了错误的标记。考虑一个从{a1}的例子,我已经修改为包含^ {CD3>}:

token = 'my_mapbox_token'
fig = go.Figure(go.Scattermapbox(
mode = "markers+text+lines",
lon = [-75, -80, -50], lat = [45, 20, -20],
marker = {'size': 20, 'symbol': ["bus", "harbor", "airport"]},
text = ["Bus", "Harbor", "airport"],textposition = "bottom right"))

fig.update_layout(
    mapbox = {
        'accesstoken': token,
        'style': "outdoors", 'zoom': 0.7},
    showlegend = True)

fig.show()

Plot that is produced shows a generic marker, not the actual icons.

有没有办法在图例中分别列出巴士、港口和机场图标?即使我将每一条添加为单独的轨迹,我也无法生成显示图标的图例


Tags: text标记token图形goa1错误fig

热门问题