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

aspectmode=data is incorrect when cones and scatter points are both involved #7143

Open
alexcjohnson opened this issue Sep 8, 2024 · 0 comments
Labels
bug something broken sev-2 serious problem

Comments

@alexcjohnson
Copy link
Collaborator

See https://codepen.io/alexcjohnson/pen/ExBryzb?editors=0010

When all traces in this plot are shown, the square is not square:
Screenshot 2024-09-08 at 17 58 11

But if you click the legend to hide the cone trace, you do get a square:
Screenshot 2024-09-08 at 17 58 36

This is a pretty important bug for anyone making a plot representing real 3D space, as shapes will be distorted and the only workaround I could find is to abandon axis autorange: set explicit ranges for all three axes, set aspectmode: 'manual', and calculate aspectratio.{x, y, z} explicitly.

I haven't been able to reproduce this issue with only scatter3d traces, nor have I tried with other trace types or with just cones, but my guess is we're calculating the axis aspect ratios before adding extra padding to the ranges to accommodate the cones. Ironically it appears we don't pad the axes (not at all? not very much? I can't quite tell) for scatter3d points, but that's a separate issue.

As a side note: it would be nice if aspectratio or aspectmode docs stated that aspectratio is ignored when you set aspectmode: 'data'. I've seen users try to use this combination of attributes to create vertical exaggeration of topography, but this fails (and again, the only solution I can find is to calculate everything manually).

@alexcjohnson alexcjohnson added bug something broken sev-2 serious problem labels Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken sev-2 serious problem
Projects
None yet
Development

No branches or pull requests

1 participant