import plotly.express as px
df = px.data.iris()
fig = px.scatter(
df,
x="sepal_width",
y="sepal_length",
color="species",
size='petal_length',
hover_data=['petal_width']
)
# fig.update_layout({
# 'plot_bgcolor' : 'rgba(255, 255, 0, 0.5)',
# 'paper_bgcolor': 'rgba(0, 0, 255, 0.5)',
# })
fig.show()Transparent bgcolor for figure
Use the rgba() attrib to set the alpha, or transparency, of the plot/paper components of a figure.
without transparency
with transparency
1 Ref
- https://community.plotly.com/t/having-a-transparent-background-in-plotly-express/30205