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

Rotate 3D axis labels #3077

Closed
alexcjohnson opened this issue Oct 4, 2018 · 7 comments
Closed

Rotate 3D axis labels #3077

alexcjohnson opened this issue Oct 4, 2018 · 7 comments
Assignees
Labels
bug something broken

Comments

@alexcjohnson
Copy link
Collaborator

Long axis titles on 3D scenes overlap the tick labels and data, because they're simply centered on a point outside the axis and not rotated:
screen shot 2018-10-04 at 3 54 01 pm
Our test images don't include a lot of long 3d titles, but you can see this effect a little bit in gl3d_world-cals

Feels like the easiest solution - which is also consistent with our 2D axis titles - would be to rotate these labels parallel to the axis. But potentially 1-letter titles ("X" etc) should remain unrotated?

The degree of overlap also depends on the viewpoint, so the logic for where to put this relative to the axis line and tick labels probably needs a bit of adjustment:
3d title overlap

@alexcjohnson alexcjohnson added the bug something broken label Oct 4, 2018
@etpinard
Copy link
Contributor

etpinard commented Oct 4, 2018

We could probably merge #511 with this new ticket.

@alexcjohnson
Copy link
Collaborator Author

good call. I'll close #511. Referencing http://community.plot.ly/t/axes-labels-overlapping-on-3d-surface-plot/859

@etpinard
Copy link
Contributor

etpinard commented Oct 5, 2018

Feels like the easiest solution - which is also consistent with our 2D axis titles - would be to rotate these labels parallel to the axis. But potentially 1-letter titles ("X" etc) should remain unrotated?
The degree of overlap also depends on the viewpoint, so the logic for where to put this relative to the axis line and tick labels probably needs a bit of adjustment:

We could probably get away with simply adding scene.(x|y|z).titleangle (which could useful for cartesian y-axes as well) with a hard default of 0, without having to implement "auto" angle logic.

@alexcjohnson
Copy link
Collaborator Author

a titleangle attribute would let people (manually) fix the overlap for one particular camera angle, but as soon as the user starts rotating the scene, the overlap returns. The two options I see are (1) the title rotates to align with the axis, or (2) the title stays horizontal but changes to right-aligned on the left side and left-aligned on the right side. (1) is my strong preference as it's more compact (ie less likely to overflow the scene), and also helps guide your eye as to the representation of that variable.

@etpinard
Copy link
Contributor

Closing after #3084 and #3131

@MeganBeckett
Copy link

Hi there! Is this now possible? ie. to make long axis titles lie parallel to the axes in 3d plots? It seems something has been developed, but I can't see how to implement in plotly (I'm also using plot_ly in R)?

@archmoj
Copy link
Contributor

archmoj commented Jun 30, 2019

@MeganBeckett
Yes. The latest versions of plotly R/js/py do support auto rotation by default.
Also in case you may be interested in line breaks or using text formatting in 3D scenes, here is an example: https://rreusser.github.io/plotly-mock-viewer/#gl3d_formatted-text-on-multiple-lines

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

No branches or pull requests

4 participants