Skip to content

Commit 69a634a

Browse files
committed
MEP12ify pie and polar chart examples
1 parent 59478d2 commit 69a634a

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

examples/pie_and_polar_charts/pie_demo_features.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
"""
2+
===============
3+
Basic pie chart
4+
===============
5+
26
Demo of a basic pie chart plus a few additional features.
37
48
In addition to the basic pie chart, this demo shows a few optional features:

examples/pie_and_polar_charts/polar_bar_demo.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
"""
2+
=======================
3+
Pie chart on polar axis
4+
=======================
5+
26
Demo of bar plot on a polar axis.
37
"""
48
import numpy as np
@@ -7,6 +11,7 @@
711
# Fixing random state for reproducibility
812
np.random.seed(19680801)
913

14+
# Compute pie slices
1015
N = 20
1116
theta = np.linspace(0.0, 2 * np.pi, N, endpoint=False)
1217
radii = 10 * np.random.rand(N)

examples/pie_and_polar_charts/polar_scatter_demo.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
"""
2+
==========================
3+
Scatter plot on polar axis
4+
==========================
5+
26
Demo of scatter plot on a polar axis.
37
48
Size increases radially in this example and color increases with angle
@@ -10,15 +14,14 @@
1014
# Fixing random state for reproducibility
1115
np.random.seed(19680801)
1216

13-
17+
# Compute areas and colors
1418
N = 150
1519
r = 2 * np.random.rand(N)
1620
theta = 2 * np.pi * np.random.rand(N)
1721
area = 200 * r**2
1822
colors = theta
1923

2024
ax = plt.subplot(111, projection='polar')
21-
c = ax.scatter(theta, r, c=colors, s=area, cmap=plt.cm.hsv)
22-
c.set_alpha(0.75)
25+
c = ax.scatter(theta, r, c=colors, s=area, cmap='hsv', alpha=0.75)
2326

2427
plt.show()

0 commit comments

Comments
 (0)