Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b4c3091

Browse files
committed
Merge pull request #6079 from paulkirow/master
Fix: Issue #4346
1 parent 4e1087b commit b4c3091

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

lib/matplotlib/axis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def _apply_params(self, **kw):
328328
# -> points. grab the integer from the `Text` object
329329
# instead of saving the string representation
330330
v = getattr(self.label1, 'get_' + k)()
331-
setattr(self, '_' + k, v)
331+
setattr(self, '_label' + k, v)
332332

333333

334334
class XTick(Tick):

lib/matplotlib/tests/test_axes.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4213,6 +4213,17 @@ def test_pandas_indexing_hist():
42134213
fig, axes = plt.subplots()
42144214
axes.hist(ser_2)
42154215

4216+
@cleanup
4217+
def test_axis_set_tick_params_labelsize_labelcolor():
4218+
# Tests fix for issue 4346
4219+
axis_1 = plt.subplot()
4220+
axis_1.yaxis.set_tick_params(labelsize=30, labelcolor='red', direction='out')
4221+
4222+
# Expected values after setting the ticks
4223+
assert axis_1.yaxis.majorTicks[0]._size == 4.0
4224+
assert axis_1.yaxis.majorTicks[0]._color == 'k'
4225+
assert axis_1.yaxis.majorTicks[0]._labelsize == 30.0
4226+
assert axis_1.yaxis.majorTicks[0]._labelcolor == 'red'
42164227

42174228
if __name__ == '__main__':
42184229
import nose

0 commit comments

Comments
 (0)