Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a12d864

Browse filesBrowse files
committed
Merge pull request matplotlib#2 from CSC-D01-Winter-2015/Issue-#4043
Issue matplotlib#4043
2 parents e24dec1 + 6f3c4b5 commit a12d864
Copy full SHA for a12d864

File tree

Expand file treeCollapse file tree

2 files changed

+19
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+19
-0
lines changed

‎lib/matplotlib/axis.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axis.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,6 +2140,7 @@ def set_ticks_position(self, position):
21402140
elif position == 'default':
21412141
self.set_tick_params(which='both', right=True, labelright=False,
21422142
left=True, labelleft=True)
2143+
self.set_offset_position('left')
21432144
else:
21442145
raise ValueError("invalid position: %s" % position)
21452146

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3557,6 +3557,24 @@ def test_move_offsetlabel():
35573557
ax.plot(data)
35583558
ax.yaxis.tick_right()
35593559
assert_equal((1, 0.5), ax.yaxis.offsetText.get_position())
3560+
3561+
@cleanup
3562+
def test_move_offsetlabel_default():
3563+
data = np.random.random(10) * 1e-22
3564+
fig, ax = plt.subplots()
3565+
ax.plot(data)
3566+
ax.yaxis.tick_right()
3567+
ax.yaxis.set_ticks_position('default')
3568+
assert_equal((0, 0.5), ax.yaxis.offsetText.get_position())
3569+
3570+
@cleanup
3571+
def test_move_offsetlabel_left():
3572+
data = np.random.random(10) * 1e-22
3573+
fig, ax = plt.subplots()
3574+
ax.plot(data)
3575+
ax.yaxis.tick_right()
3576+
ax.yaxis.tick_left()
3577+
assert_equal((0, 0.5), ax.yaxis.offsetText.get_position())
35603578

35613579
if __name__ == '__main__':
35623580
import nose

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.