Skip to content

Commit 966e631

Browse files
committed
Fix bug with pie chart slices less than 2.5 degrees.
svn path=/branches/v0_91_maint/; revision=4882
1 parent 8c58533 commit 966e631

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/patches.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,9 @@ def __init__(self, center, r, theta1, theta2,
526526
theta1 = float(theta1)
527527
theta2 = float(theta2)
528528
dtheta = float(dtheta)
529-
num_points = abs(theta2 - theta1) / dtheta
529+
num_points = (abs(theta2 - theta1) / dtheta)
530+
if num_points < 2.0:
531+
num_points = 2.0
530532
rads = (npy.pi/180.) * npy.linspace(theta1, theta2, num_points, endpoint=True)
531533
xs = r*npy.cos(rads)+xc
532534
ys = r*npy.sin(rads)+yc

0 commit comments

Comments
 (0)