We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am using plotly 4.12.0. The px.imshow function has this example in the docs:
px.imshow
import plotly.express as px import numpy as np img_rgb = np.array([[[255, 0, 0], [0, 255, 0], [0, 0, 255]], [[0, 255, 0], [0, 0, 255], [255, 0, 0]] ], dtype=np.uint8) fig = px.imshow(img_rgb) fig.show()
I have tried to add transparency to the plot with the following code:
import plotly.express as px import numpy as np img_rgb = np.array([[[255, 0, 0, .5], [0, 255, 0, .5], [0, 0, 255, .5]], [[0, 255, 0, .5], [0, 0, 255, .5], [255, 0, 0, .5]] ]) fig = px.imshow(img_rgb) fig.show()
As suggested by the docs, passing a (M, N, 4), array would include transparency, but this resulted in an empty figure:
Using go.Image directly worked:
go.Image
fig = go.Figure() fig.add_traces(go.Image(z=img_rgb, colormodel='rgba'))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am using plotly 4.12.0.
The
px.imshow
function has this example in the docs:I have tried to add transparency to the plot with the following code:
As suggested by the docs, passing a (M, N, 4), array would include transparency, but this resulted in an empty figure:

Using
go.Image
directly worked:The text was updated successfully, but these errors were encountered: