Hi everyone,
I have a choropleth map in Python Dash app.
I would like to make the background of the map transparent, so that it matches the style of the external stylesheets, but I cannot figure out why itโs not happening.
Here is the full code:
from dash import Dash, html, dcc
import plotly.graph_objects as go
import dash_bootstrap_components as dbc
fig = go.Figure(go.Scattergeo())
fig.update_layout(
showlegend=False
)
fig.update_geos(
projection_type="natural earth",
showcountries=True,
showland=True,
landcolor="LightGreen",
showocean=True,
oceancolor="LightBlue",
showlakes=True,
lakecolor="LightBlue",
showrivers=True,
rivercolor="LightBlue",
)
app = Dash(__name__, external_stylesheets=[dbc.themes.CYBORG])
app.layout = html.Div([
dcc.Graph(figure=fig)
])
app.run_server(debug=True, use_reloader=False)
I have tried two different options below, but none seems to be working.
fig.update_layout(geo=dict(bgcolor= "rgba(0,0,0,0)"))
fig.update_layout(geo_bgcolor="rgba(0,0,0,0)")
Thanks in advance for any recommendations.