-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
BUG: adjust tick label location when tick length changes #7119
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
I still need to add a test. |
Travis is failing because the original test_tightlayout.test_outward_ticks is incorrect owing to the bug that we are fixing. The bug was masked by the |
Previously, the test was broken by the inclusion of remove_text=True in the decorator. With that changed to False, and the images updated, this test serves double-duty as a test for the bug in updating tick parameters that is fixed in the present PR.
I have to ask… why was the |
for line in (self.tick1line, self.tick2line): | ||
line.set_markersize(self._size) | ||
line.set_markeredgewidth(self._width) | ||
# _get_text1_transform uses _pad from apply_tickdir |
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.
I think you should add a comment mentioning that apply_tickdir
uses self._size
to compute the self._pad
value, as this was the core of the problem here.
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.
I added a commit to flesh out the comments.
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.
That code is tricky :)
I indeed think it needs a bit of refactoring and renaming.
Thanks!
On 2016/09/15 4:16 PM, Nelle Varoquaux wrote:
The problem was that long ago, when the Tick system was designed, it was For example, this enables tick_params(top=True, labeltop=True) Actually it goes beyond that because tick_params can work with xticks, |
I haven't look at the code closely: would it be possible to remove this function and change the kwargs downstream in the code? |
I should note that this is way out of the scope of this PR… just wondering for the future. |
@NelleV Some amount of translation is still needed to handle the distinction between attributes of all ticks and attributes of x versus y ticks. Apart from that, we have the old backwards-compatibility constraint on the API to worry about. |
The first step would be to alias them the other way. It might be worth considering going the |
Thanks! |
Closes #7114.