Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fixed Issue 4346 #6079
Conversation
mdboom
added the
needs_review
label
Feb 29, 2016
|
Can you also add a test? I would suggest a non-image test where you exercise this and assert that the tick size / color does not change due to it. Ideally the tests should only use public methods. Also |
tacaswell
added this to the
1.5.2 (Critical bug fix release)
milestone
Mar 1, 2016
|
I will work on this |
|
Hopefully this is sufficient. |
tacaswell
commented on the diff
Mar 2, 2016
| @@ -4335,6 +4335,17 @@ def test_pandas_indexing_hist(): | ||
| fig, axes = plt.subplots() | ||
| axes.hist(ser_2) | ||
| +@cleanup | ||
| +def test_axis_set_tick_params_labelsize_labelcolor(): | ||
| + # Tests fix for issue 4346 | ||
| + axis_1 = plt.subplot() | ||
| + axis_1.yaxis.set_tick_params(labelsize=30, labelcolor='red', direction='out') | ||
| + | ||
| + # Expected values after setting the ticks | ||
| + assert axis_1.yaxis.majorTicks[0]._size == 4.0 |
tacaswell
Owner
|
tacaswell
added a commit
that referenced
this pull request
Mar 4, 2016
|
|
tacaswell |
a44571a
|
tacaswell
merged commit a44571a
into matplotlib:master
Mar 4, 2016
tacaswell
removed the
needs_review
label
Mar 4, 2016
tacaswell
added a commit
that referenced
this pull request
Mar 4, 2016
|
|
tacaswell |
b4c3091
|
|
backported to 1.5.x as b4c3091 |
|
Thanks! And congratulations in what I think is your first mpl contribution In the future, it is best to make PRs off of a feature branch, not your master branch. |
|
Will do, and thanks! |
tacaswell
added a commit
to tacaswell/matplotlib
that referenced
this pull request
May 22, 2016
|
|
tacaswell |
6f52ee0
|
paulkirow commentedFeb 29, 2016
This is a fix for issue #4346
The problem was that when handling parameters labelsize and labelcolor, _apply_params was calling setattr on _size and _color instead of _labelsize and _labelcolor. This is all fine and dandy until something is used that calls _apply_params because _apply_params calls apply_tickdir which will change the padding.
When _size changes, its value gets added to the tick padding thus causing the issue seen in #4346. This also explains why the issue only became apparent when setting major (or both) ticks, it is because minor ticks don't have _size added to their padding values.