Skip to content

Commit 449e279

Browse files
committed
Add edges in the pie chart exercise
Edges can be specified with a dictionary of arguments passed to the wedgeprops keyword.
1 parent f0f6e08 commit 449e279

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/pie_ex.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
Z = np.ones(n)
1010
Z[-1] *= 2
1111

12-
plt.axes([0.025,0.025,0.95,0.95])
12+
plt.axes([0.025, 0.025, 0.95, 0.95])
1313

14-
plt.pie(Z, explode=Z*.05, colors = ['%f' % (i/float(n)) for i in range(n)])
14+
plt.pie(Z, explode=Z*.05, colors=['%f' % (i/float(n)) for i in range(n)],
15+
wedgeprops={"linewidth": 1, "edgecolor": "black"})
1516
plt.gca().set_aspect('equal')
1617
plt.xticks([]), plt.yticks([])
1718

0 commit comments

Comments
 (0)