Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f6aa54

Browse files
committed
TST: test that get_position gives new axes position if diff aspect
1 parent 895e4d0 commit 0f6aa54

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
import matplotlib.markers as mmarkers
2525
import matplotlib.patches as mpatches
2626
import matplotlib.colors as mcolors
27-
from numpy.testing import assert_allclose, assert_array_equal
27+
from numpy.testing import (
28+
assert_allclose, assert_array_equal, assert_array_almost_equal)
2829
from matplotlib.cbook import (
2930
IgnoredKeywordWarning, MatplotlibDeprecationWarning)
3031
from matplotlib.cbook._backports import broadcast_to
@@ -4828,6 +4829,12 @@ def test_square_plot():
48284829
xlim, ylim = ax.get_xlim(), ax.get_ylim()
48294830
assert np.diff(xlim) == np.diff(ylim)
48304831
assert ax.get_aspect() == 'equal'
4832+
assert_array_almost_equal(
4833+
ax.get_position(original=True).extents,
4834+
np.array((0.125, 0.1, 0.9, 0.9)))
4835+
assert_array_almost_equal(
4836+
ax.get_position(original=False).extents,
4837+
np.array((0.2125, 0.1, 0.8125, 0.9)))
48314838

48324839

48334840
def test_no_None():

0 commit comments

Comments
 (0)