Skip to content

Commit 420e4cb

Browse files
committed
FIX
1 parent 90791a7 commit 420e4cb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/matplotlib/path.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,7 @@ def arc(cls, theta1, theta2, n=None, is_wedge=False, wrap=True):
993993
if wrap:
994994
# Wrap theta2 to 0-360 degrees from theta1.
995995
eta2 = np.mod(theta2 - theta1, 360.0) + theta1
996+
print('Eta1, Eta20', eta1, eta2)
996997
# Ensure 360-deg range is not flattened to 0 due to floating-point
997998
# errors, but don't try to expand existing 0 range.
998999
if theta2 != theta1 and eta2 <= eta1:
@@ -1004,10 +1005,11 @@ def arc(cls, theta1, theta2, n=None, is_wedge=False, wrap=True):
10041005

10051006
# number of curve segments to make
10061007
if n is None:
1007-
if np.abs(eta2 - eta1) <= 2 * np.pi + 1e-12:
1008+
if np.abs(eta2 - eta1) <= 2.2 * np.pi:
10081009
# this doesn't need to grow exponentially, but we have left
10091010
# this way for back compatibility
10101011
n = int(2 ** np.ceil(2 * np.abs(eta2 - eta1) / np.pi))
1012+
print('Here')
10111013
else:
10121014
# this will not grow exponentially if we allow wrapping arcs:
10131015
n = int(2 * np.ceil(2 * np.abs(eta2 - eta1) / np.pi))

lib/matplotlib/tests/test_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def test_arc_close360():
486486
#ax[0].set_title("arc(-90-1e-14, 270), should be a circle")
487487
ax[1].add_patch(patches.PathPatch(Path.arc(theta1=-90, theta2=270)))
488488
#ax[1].set_title("arc(-90, 270), is a circle")
489-
ax[2].add_patch(patches.PathPatch(Path.arc(theta1=-90, theta2=-90 - 1e-14)))
489+
ax[2].add_patch(patches.PathPatch(Path.arc(theta1=-90 - 1e-14, theta2=-90)))
490490
#ax[2].set_title("arc(-90, -90-1e-14), should not be a circle")
491491
for a in ax:
492492
a.set_xlim(-1, 1)

0 commit comments

Comments
 (0)