Skip to content

Handle Tick gridline properties like other Tick properties #10193

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 3 commits into from
Jan 9, 2018

Conversation

efiring
Copy link
Member

@efiring efiring commented Jan 8, 2018

PR Summary

This is a refactoring for internal and API consistency, so
that Axis.set_tick_params can set all Tick properties. It also
removes some redundant code involving attributes like isDefault_majloc.

This was originally included in #8752 and its successor, #10033. Although a slightly different version of it was integral to #8752, it is independent of what remains in #10033, so it is split out here for easier evaluation.

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

This is a refactoring for internal and API consistency, so
that Axis.set_tick_params can set all Tick properties.  It also
removes some redundant code involving attributes like isDefault_majloc.
efiring added a commit to efiring/matplotlib that referenced this pull request Jan 8, 2018
@efiring efiring changed the title WIP: Handle Tick gridline properties like other Tick properties Handle Tick gridline properties like other Tick properties Jan 8, 2018
@tacaswell tacaswell added this to the v2.2 milestone Jan 8, 2018
@@ -793,9 +806,14 @@ def reset_ticks(self):
self._lastNumMajorTicks = 1
self._lastNumMinorTicks = 1

try:
self.set_clip_path(self.axes.patch)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been such a pain having to remember to do this for polar plots, so I'm happy to see it centralized.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, sorry to dredge this up:

This change is a bit strange because from a literal point of view most of the axis is drawn outside this clip_path. I was trying to short-circuit getting tightbboxes if the clip path was the axes, but with this change axis-es are marked as clipped to the axes. Which they aren't - only their gridlines are.

Not sure what the solution is, but wanted to point out that this is pretty confusing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't exactly new though; it simply makes reset_ticks consistent with what happens in __init__ (admittedly, of the Axes, not the Tick).

@QuLogic QuLogic merged commit e3690cb into matplotlib:master Jan 9, 2018
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants