Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Ignore pos in StrCategoryFormatter.__call__ to display correct label in the preview window#16006
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
Thanks for the PR! This looks good to me, would be good to add another test as I've suggested.
assert ax.yaxis.major.formatter(i+1, i+1) == "" | ||
assert ax.yaxis.major.formatter(0, None) == "" | ||
assert ax.yaxis.major.formatter(i) == d | ||
assert ax.yaxis.major.formatter(i+1) == "" |
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.
Could you add a test thatax.yaxis.major.formatter(i, None)
givesd
as the label? (which it wouldn't do before this fix)
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.
Thanks, I have updated the test.
anntzer commentedJan 2, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks :) |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free tosuggest an improvement. |
…ll__ to display correct label in the preview windowIgnore pos in StrCategoryFormatter.__call__ to display correct… (matplotlib#16006)Ignore pos in StrCategoryFormatter.__call__ to display correct label in the preview windowConflicts:lib/matplotlib/tests/test_category.py - collision with py2 removal work (_to_str)
…-v3.2.xBackport PR#16006: Ignore pos in StrCategoryFormatter.__call__ to di…
Uh oh!
There was an error while loading.Please reload this page.
Fixes#14881
The positionpos in
__call__
can be ignored as the tick label is independent of position. So,__call__(value, None)
would return a category label even ifpos isNone
, which is the expected behavior.The test case has been modified to pass only a single argument (sopos defaults to
None
).