【问题标题】:Plotly scattermapbox : mapbox frame adjust marginsPlotly scattermapbox : mapbox 框架调整边距
【发布时间】:2020-11-18 05:41:47
【问题描述】:

我正在使用 plotly 的 scattermapbox 库。我想在绘制地图时调整边距。边距周围的空间已用完。

如何调整边距?我似乎可以找到属性或 css。

html.Div([

        # Plot properties map
        dcc.Graph(id='map-graph1',
                  style={'display': 'inline-block', 'width': '900px', 'float': 'left', 'height':'750px', 'margin-left':'0%'}
                
        ),

   ], className='map-style',
      style={"width": "38%"}),




layout = {
         "autosize": False,
         "hovermode": "closest",
         #"title": "Property Map",
         "mapbox": {
             "accesstoken": MAPBOX_KEY,
             "bearing": 0,
             "center": {
                 "lat": layout_lat,
                 "lon": layout_lon
             },
             "pitch": 0,
             "zoom": zoom,
             "style": "outdoors",
         }
}

【问题讨论】:

    标签: plotly mapbox mapbox-gl-js plotly-dash


    【解决方案1】:

    你试过autosize=True??基于应该使其大小自动为其容器的文档

    https://plotly.com/python/reference/#layout-autosize

    你有一个sample

    【讨论】:

    • 是的,我尝试设置 autosize=True。它没有用。
    • 除非您可以发布更多代码,包括 html 页面和容器,否则很难诊断问题出在哪里
    猜你喜欢
    • 1970-01-01
    • 2019-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-25
    • 1970-01-01
    • 2021-04-25
    • 2012-06-18
    相关资源
    最近更新 更多