0
votes

I am using plotly's scattermapbox library. I'd like to adjust margins when I plot the map graph. Too much space is being used up around the margins.

How do I adjust the margins? I can seem to find the property or 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

1 Answers

0
votes

Have you tried autosize=True?? based on the documentation that should make the size automatic to it's container

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

Here you have a sample

enter image description here