Skip to content

Commit

Permalink
Merge pull request matplotlib#6079 from paulkirow/master
Browse files Browse the repository at this point in the history
Fix: Issue matplotlib#4346
  • Loading branch information
tacaswell committed May 22, 2016
1 parent e25efec commit 6f52ee0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def _apply_params(self, **kw):
# -> points. grab the integer from the `Text` object
# instead of saving the string representation
v = getattr(self.label1, 'get_' + k)()
setattr(self, '_' + k, v)
setattr(self, '_label' + k, v)


class XTick(Tick):
Expand Down
11 changes: 11 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4213,6 +4213,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
assert axis_1.yaxis.majorTicks[0]._color == 'k'
assert axis_1.yaxis.majorTicks[0]._labelsize == 30.0
assert axis_1.yaxis.majorTicks[0]._labelcolor == 'red'

if __name__ == '__main__':
import nose
Expand Down

0 comments on commit 6f52ee0

Please sign in to comment.