Closed
Description
Description
Hello,
When passing the opacity
attribute different than None
to px.density_mapbox
, it raises a ValueError.
Expected output
Taking the example in the doc and wanting to set the opacity to 0.5:
Minimal reproducible code
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/earthquakes-23k.csv')
import plotly.express as px
fig = px.density_mapbox(df, lat='Latitude', lon='Longitude', z='Magnitude', radius=10,
center=dict(lat=0, lon=180), zoom=0,
mapbox_style="stamen-terrain", opacity=0.5)
fig.show()
Current workaround
It's possible to change the opacity by not adding the attribute in the constructor but adding it after using fig.update_traces(opacity=0.5)
. But I'll open a PR with a fix so you don't have to use that.
Metadata
Metadata
Assignees
Labels
No labels