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

Skip to content

Commit 57995b3

Browse files
committed
Add test for ingoring CLOSEPOLY verticies in patches
1 parent fcd1699 commit 57995b3

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

lib/matplotlib/tests/test_axes.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
assert_allclose, assert_array_equal, assert_array_almost_equal)
3535
from matplotlib import rc_context
3636
from matplotlib.cbook import MatplotlibDeprecationWarning
37+
import sys
38+
import math
3739

3840
# Note: Some test cases are run twice: once normally and once with labeled data
3941
# These two must be defined in the same test function or need to have
@@ -6924,3 +6926,15 @@ def test_bar_label_labels():
69246926
labels = ax.bar_label(rects, labels=['A', 'B'])
69256927
assert labels[0].get_text() == 'A'
69266928
assert labels[1].get_text() == 'B'
6929+
6930+
6931+
def test_patch_bounds(): # PR 19078
6932+
fig, ax = plt.subplots()
6933+
tol = 16*sys.float_info.epsilon
6934+
ax.add_patch(mpatches.Wedge((0, -1), 1.05, 60, 120, 0.1))
6935+
bounds = ax.dataLim.bounds
6936+
bot = 1.9*math.sin(15*math.pi/180)**2
6937+
assert abs(bounds[0]+0.525) < tol and \
6938+
abs(bounds[1]+(bot+0.05)) < tol and \
6939+
abs(bounds[2]-1.05) < tol and \
6940+
abs(bounds[3]-(bot+0.1)) < tol

0 commit comments

Comments
 (0)