Skip to content

Surface with opacity=1.0 and Scatter3d breaks export in Kaleido #5178

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

Open
jeffreybliang opened this issue May 10, 2025 · 0 comments
Open

Surface with opacity=1.0 and Scatter3d breaks export in Kaleido #5178

jeffreybliang opened this issue May 10, 2025 · 0 comments

Comments

@jeffreybliang
Copy link

jeffreybliang commented May 10, 2025

When exporting a Plotly figure to PDF/png/jpg/svg (these are the ones I've tried) using Kaleido, combining a Surface trace with opacity=1.0 and a Scatter3d trace in the same scene causes the mesh surface to disappear or render incorrectly. However, rendering in HTML is perfectly fine (as it looks in my Python notebook).

Lowering the Surface trace opacity slightly (e.g., to 0.99) or removing the Scatter3d trace entirely resolves the issue, however I prefer the look when it has full opacity and the points are included.

I have uploaded the json files for the plot when it is full opacity and when it is 0.99 opacity. When saving with full opacity the image looks like
Image
full_opacity.json

To test, just run the code:

fig = pio.read_json("full_opacity.json")
fig.write_image("full_opacity.png")
fig.show()

I have also attached a json with 0.99 opacity, which looks like:
Image
not_full_opacity.json

This is what it saves as without the points:

Image
no_scatter.json

Environment:
plotly==5.21.0 (I also tried on latest version too)
kaleido==0.2.1
Python 3.12
macOS

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

1 participant