-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Conversation
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.
@@ -793,9 +806,14 @@ def reset_ticks(self): | |||
self._lastNumMajorTicks = 1 | |||
self._lastNumMinorTicks = 1 | |||
|
|||
try: | |||
self.set_clip_path(self.axes.patch) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
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