绘制散点图框:地图框调整边距

时间:2020-07-28 17:46:18

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

我正在使用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",
         }
}

enter image description here

1 个答案:

答案 0 :(得分:0)

您尝试过autosize=True吗?基于应该使尺寸自动适应容器的文档

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

这里有一个sample

enter image description here