Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitf96eba8

Browse files
committed
TST: secondary_axes resize
1 parent5cd9676 commitf96eba8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎lib/matplotlib/tests/test_axes.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6106,3 +6106,16 @@ def test_secondary_fail():
61066106
axsec=ax.secondary_xaxis('right')
61076107
withpytest.raises(ValueError):
61086108
axsec=ax.secondary_yaxis('bottom')
6109+
6110+
6111+
deftest_secondary_resize():
6112+
fig,ax=plt.subplots(figsize=(10,5))
6113+
ax.plot(np.arange(2,11),np.arange(2,11))
6114+
definvert(x):
6115+
withnp.errstate(divide='ignore'):
6116+
return1/x
6117+
6118+
axsec=ax.secondary_xaxis('top',functions=(invert,invert))
6119+
fig.canvas.draw()
6120+
fig.set_size_inches((7,4))
6121+
assert_allclose(ax.get_position().extents, [0.125,0.1,0.9,0.9])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp