matplotlib icon indicating copy to clipboard operation
matplotlib copied to clipboard

DOC: view_init docstring for 3d axes primary view angles

Open scottshambaugh opened this issue 3 years ago • 1 comments

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 https://github.com/matplotlib/matplotlib/issues/23544, resulting views are in that issue

PR Checklist

Tests and Styling

  • [N/A] Has pytest style unit tests (and pytest passes).
  • [x] Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • [x] Documentation is sphinx and numpydoc compliant (the docs should build without error).

scottshambaugh avatar Aug 10 '22 17:08 scottshambaugh

Docs build and look good: image

scottshambaugh avatar Aug 10 '22 18:08 scottshambaugh

@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. image

scottshambaugh avatar Aug 11 '22 15:08 scottshambaugh

@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.

timhoffm avatar Aug 11 '22 22:08 timhoffm