Skip to content

Commit a44571a

Browse files
committed
Merge pull request #6079 from paulkirow/master
Fix: Issue #4346
2 parents a6baf89 + d103d48 commit a44571a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/matplotlib/axis.py

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

347347

348348
class XTick(Tick):

lib/matplotlib/tests/test_axes.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4335,6 +4335,17 @@ def test_pandas_indexing_hist():
43354335
fig, axes = plt.subplots()
43364336
axes.hist(ser_2)
43374337

4338+
@cleanup
4339+
def test_axis_set_tick_params_labelsize_labelcolor():
4340+
# Tests fix for issue 4346
4341+
axis_1 = plt.subplot()
4342+
axis_1.yaxis.set_tick_params(labelsize=30, labelcolor='red', direction='out')
4343+
4344+
# Expected values after setting the ticks
4345+
assert axis_1.yaxis.majorTicks[0]._size == 4.0
4346+
assert axis_1.yaxis.majorTicks[0]._color == 'k'
4347+
assert axis_1.yaxis.majorTicks[0]._labelsize == 30.0
4348+
assert axis_1.yaxis.majorTicks[0]._labelcolor == 'red'
43384349

43394350
if __name__ == '__main__':
43404351
import nose

0 commit comments

Comments
 (0)