Skip to content

Tweak axis_direction demo. #25747

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

Merged
merged 1 commit into from
Apr 26, 2023
Merged

Tweak axis_direction demo. #25747

merged 1 commit into from
Apr 26, 2023

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Apr 21, 2023

  • Show the curvilinear grid, without which the orientation of the ticks on the surrounding rectangular frame doesn't make much sense.
  • Constrained layout works reasonably well enough, no need to set axes spacings by hand, but this exposed a bug where GridlinesCollection set paths to None (instead of an empty list), which breaks get_datalim (which calls len(paths)).
  • Inline most intermediate constructs in setup_axes (avoiding lines like extreme_finder=extreme_finder).
  • Many small style fixes.

Old: https://matplotlib.org/stable/gallery/axisartist/demo_axis_direction.html
New:
new

PR Summary

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

@timhoffm
Copy link
Member

timhoffm commented Apr 26, 2023

This is quite busy. Suggestions:

  • Use a lighter gray for the grid. It only needs to be barely visible for orientation. The visual focus should still be on the ticks.
  • switch from showing the direction via annotate() inside the axes to ax.set_title()

- Show the curvilinear grid, without which the orientation of the ticks
  on the surrounding rectangular frame doesn't make much sense.
- Constrained layout works reasonably well enough, no need to set axes
  spacings by hand, but this exposed a bug where GridlinesCollection set
  paths to None (instead of an empty list), which breaks get_datalim
  (which calls len(paths)).
- Inline most intermediate constructs in setup_axes (avoiding lines like
  `extreme_finder=extreme_finder`).
- Many small style fixes.
@anntzer
Copy link
Contributor Author

anntzer commented Apr 26, 2023

Good ideas, fixed:
test

@timhoffm timhoffm added this to the v3.8.0 milestone Apr 26, 2023
@timhoffm timhoffm merged commit d08f739 into matplotlib:main Apr 26, 2023
@anntzer anntzer deleted the dad branch April 26, 2023 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants