Skip to content

difference between live 3-D graph with downloaded PNG #4378

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

Closed
archmoj opened this issue Nov 21, 2019 · 6 comments · Fixed by #4566
Closed

difference between live 3-D graph with downloaded PNG #4378

archmoj opened this issue Nov 21, 2019 · 6 comments · Fixed by #4566
Labels
bug something broken

Comments

@archmoj
Copy link
Contributor

archmoj commented Nov 21, 2019

Is this a bug?

Bunny

https://rreusser.github.io/plotly-mock-viewer/#gl3d_bunny

@alexcjohnson alexcjohnson added the bug something broken label Nov 21, 2019
@alexcjohnson
Copy link
Collaborator

Yes, most definitely a bug. Perhaps something amiss about how we convert the canvas to an image in order to slot it in with the svg pieces? I think that's part of the image generation process in this case anyway...

@archmoj
Copy link
Contributor Author

archmoj commented Nov 21, 2019

Also mentioning this one can be helpful.
https://rreusser.github.io/plotly-mock-viewer/#gl3d_rgb_dont_accept_alpha_scatter3d
It appears the live variation is not the correct one since the line with transparency has become completely invisible in the middle!

gl3d_rgb_dont_accept_alpha_scatter3d

@archmoj
Copy link
Contributor Author

archmoj commented Nov 21, 2019

And here is a demo illustrating that the results would be identical if scene.bgcolor is set to white (i.e. layout.paper_bgcolor) using the plot on the right.

@archmoj
Copy link
Contributor Author

archmoj commented Nov 21, 2019

cc #4360

@alexcjohnson
Copy link
Collaborator

And here is a demo illustrating that the results would be identical if scene.bgcolor is set to white (using the plot on the right).

You need to clone fig before mutating it, otherwise you get the same actually figure plotted in both cases... but yes, if I do that I see the same thing you do - all screen & downloaded plots look the same except the download with transparent scene.bgcolor. But the fix needs to be getting the download to work correctly with transparent background, rather than changing the background to the one that works.

Also mentioning this one can be helpful.
https://rreusser.github.io/plotly-mock-viewer/#gl3d_rgb_dont_accept_alpha_scatter3d
It appears the live variation is not the correct one since the line with transparency has become completely invisible in the middle!

True, but the downloaded one is also not correct - it looks closer to correct, but (a) the one with white bgcolor downloads the same as on the screen, and (b) if you inspect the transparent-bg-download carefully, it appears to be the combination of the two bugs, which in this particular case seems to partially cancel. See for example the gridlines behind the semitransparent trace line - they're lighter than the trace line, but in a correct rendering they would be darker. So I'd consider this a separate bug.

Also perhaps a third bug: giving this plot a white bgcolor makes the semitransparent markers look somewhat more opaque - which I'm not sure I see in the download but you can clearly see it if you create this plot and then toggle the bgcolor in place with Plotly.relayout(gd, {'scene.bgcolor':'white'}) vs Plotly.relayout(gd, {'scene.bgcolor':'transparent'})

Quite a minefield 😅

@archmoj
Copy link
Contributor Author

archmoj commented Nov 21, 2019

And here is a demo illustrating that the results would be identical if scene.bgcolor is set to white (using the plot on the right).

You need to clone fig before mutating it, otherwise you get the same actually figure plotted in both cases... but yes, if I do that I see the same thing you do - all screen & downloaded plots look the same except the download with transparent scene.bgcolor. But the fix needs to be getting the download to work correctly with transparent background, rather than changing the background to the one that works.

Thanks. Above demo is now fixed.

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

Successfully merging a pull request may close this issue.

2 participants