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

Skip to content

Commit 951247b

Browse files
committed
Bugfix: [ 1732274 ] No antialiasing with pie on wxpython
Reducing the sampling of the curve on the wedge looks much better. svn path=/trunk/matplotlib/; revision=4199
1 parent 25743a6 commit 951247b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/matplotlib/patches.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ class Wedge(Polygon):
511511
def __str__(self):
512512
return "Wedge(%g,%g)"%self.xy[0]
513513
def __init__(self, center, r, theta1, theta2,
514-
dtheta=0.1, **kwargs):
514+
dtheta=5.0, **kwargs):
515515
"""
516516
Draw a wedge centered at x,y tuple center with radius r that
517517
sweeps theta1 to theta2 (angles)
@@ -523,7 +523,11 @@ def __init__(self, center, r, theta1, theta2,
523523
524524
"""
525525
xc, yc = center
526-
rads = (math.pi/180.)*npy.arange(theta1, theta2+0.1*dtheta, dtheta)
526+
theta1 = float(theta1)
527+
theta2 = float(theta2)
528+
dtheta = float(dtheta)
529+
num_points = abs(theta2 - theta1) / dtheta
530+
rads = (npy.pi/180.) * npy.linspace(theta1, theta2, num_points, endpoint=True)
527531
xs = r*npy.cos(rads)+xc
528532
ys = r*npy.sin(rads)+yc
529533
verts = [center]

0 commit comments

Comments
 (0)