Description
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
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:
not_full_opacity.json
This is what it saves as without the points:
Environment:
plotly==5.21.0 (I also tried on latest version too)
kaleido==0.2.1
Python 3.12
macOS