Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opacity for image layer has no effect #2077

Closed
meteoDaniel opened this issue Jan 15, 2020 · 1 comment
Closed

opacity for image layer has no effect #2077

meteoDaniel opened this issue Jan 15, 2020 · 1 comment

Comments

@meteoDaniel
Copy link

If I am overlaying an image to an scattermapbox, defining the opacity has no effect. Am I doing something wrong?

import plotly.graph_objects as go

fig = go.Figure(go.Scattermapbox(), layout=dict(width=600, height=450))
mapbox = dict(zoom= 4.5,
              style='open-street-map',
              center=dict(
                        lat=42,
                        lon=-74.5),
              layers=[
                  dict(
                  below ='',
                      opacity=0.6,
                  source = "https://docs.mapbox.com/mapbox-gl-js/assets/radar.gif",
                  sourcetype= "image",
                  coordinates =  [
                          [-80.425, 46.437], [-71.516, 46.437], [-71.516, 37.936], [-80.425, 37.93]
                                 ])
                     ])
fig.update_layout(mapbox=mapbox)
fig.show()

plotly version:
4.4.1

@emmanuelle
Copy link
Contributor

@meteoDaniel indeed, the docstring https://plot.ly/python/reference/#layout-mapbox-layers-items-layer-opacity mentions that opacity has an effect on circle, line, fill, symbol layers but not image. If you think this is missing in the API, you can open an issue in the Javascript library https://github.com/plotly/plotly.js/issues/new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants