Skip to content

Commit

Permalink
Merge pull request matplotlib#2 from CSC-D01-Winter-2015/Issue-#4043
Browse files Browse the repository at this point in the history
  • Loading branch information
omfgitsjack committed Feb 28, 2015
2 parents e24dec1 + 6f3c4b5 commit a12d864
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,7 @@ def set_ticks_position(self, position):
elif position == 'default':
self.set_tick_params(which='both', right=True, labelright=False,
left=True, labelleft=True)
self.set_offset_position('left')
else:
raise ValueError("invalid position: %s" % position)

Expand Down
18 changes: 18 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3557,6 +3557,24 @@ def test_move_offsetlabel():
ax.plot(data)
ax.yaxis.tick_right()
assert_equal((1, 0.5), ax.yaxis.offsetText.get_position())

@cleanup
def test_move_offsetlabel_default():
data = np.random.random(10) * 1e-22
fig, ax = plt.subplots()
ax.plot(data)
ax.yaxis.tick_right()
ax.yaxis.set_ticks_position('default')
assert_equal((0, 0.5), ax.yaxis.offsetText.get_position())

@cleanup
def test_move_offsetlabel_left():
data = np.random.random(10) * 1e-22
fig, ax = plt.subplots()
ax.plot(data)
ax.yaxis.tick_right()
ax.yaxis.tick_left()
assert_equal((0, 0.5), ax.yaxis.offsetText.get_position())

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

0 comments on commit a12d864

Please sign in to comment.