DOC: view_init docstring for 3d axes primary view angles#23600
DOC: view_init docstring for 3d axes primary view angles#23600timhoffm merged 1 commit intomatplotlib:mainfrom
Conversation
There was a problem hiding this comment.
The naming follows a consistent, but maybe not intuitive pattern:
- The first letter defines the horizontal axis, values increase from left to right
- The second letter defines the horizontal axis, values increase from top to bottom
The first one is clear, but top-bottom direction in the vertical may be surprising. All standard 2D and 3D plots in matplitlib use vertically increasing values. The direction is a combined result of the roll=0 constraint and the rotations necessary to get the horizontal and vertical axes positioned.
As long as this is only documentation and not API, it's not overly important because we can change it later.
However, I suggest to consider alternative names AB where A is horizontal axis, increasing left to right, and B is the vertical axis, increasing bottom to top. One can optionally add a - to reverse each axis separately (t.b.d. whether that minus should be before or after the letter, e.g. X-Y- or -X-Y). Depending on the axises and the orientation, this may involve roll or not, but the coordinate system itself would still remain right-handed (well, unless you reverse the axis limits, e.g. set_xlim(1, -1), which you can always do).
|
@timhoffm I believe what you're suggesting is currently what happens when you plug in those values? First letter defining a left-right increasing horizontal axis, and second letter defining an increasing bottom-top vertical axis, with the negative sign flipping that adjacent axis. Are you seeing something different? I like the thought of moving the position of the negative sign(s) to define additional views, though I think it would be too much clutter to list all 24 combinations out. |
|
@scottshambaugh You are right: the vertical axis is as expected. Thanks for the PR! My more general comment on the minus signs is mostly relevant in case we want to introduce the naming as API. I agree it's not reasonable to list all possible views in the docstring. |


PR Summary
Adds documentation showing azimuth and elevation angles needed to look at the primary planes in 3d plots. Fulfills some of the needs of #23544, resulting views are in that issue
PR Checklist
Tests and Styling
pytestpasses).flake8-docstringsand runflake8 --docstring-convention=all).Documentation
doc/users/next_whats_new/(follow instructions in README.rst there).doc/api/next_api_changes/(follow instructions in README.rst there).