Skip to content

Commit 1c11929

Browse files
committed
Merge remote-tracking branch 'pipping/master'
Conflicts: examples/api/scatter_piecharts.py White space induced conflicts
2 parents c600130 + 554e412 commit 1c11929

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

examples/api/scatter_piecharts.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,28 @@
2020
# some points on a circle cos,sin
2121
x = [0] + np.cos(np.linspace(0, 2*math.pi*r1, 10)).tolist()
2222
y = [0] + np.sin(np.linspace(0, 2*math.pi*r1, 10)).tolist()
23+
24+
2325
xy1 = list(zip(x, y))
26+
s1 = max(max(x), max(y))
2427

2528
# ...
2629
x = [0] + np.cos(np.linspace(2*math.pi*r1, 2*math.pi*r2, 10)).tolist()
2730
y = [0] + np.sin(np.linspace(2*math.pi*r1, 2*math.pi*r2, 10)).tolist()
2831
xy2 = list(zip(x, y))
32+
s2 = max(max(x), max(y))
2933

3034
x = [0] + np.cos(np.linspace(2*math.pi*r2, 2*math.pi, 10)).tolist()
3135
y = [0] + np.sin(np.linspace(2*math.pi*r2, 2*math.pi, 10)).tolist()
3236
xy3 = list(zip(x, y))
33-
37+
s3 = max(max(x), max(y))
3438

3539
fig, ax = plt.subplots()
36-
d = np.arange(3)
37-
ax.scatter(d, d, marker=(xy1, 0), s=sizes, facecolor='blue')
38-
ax.scatter(d, d, marker=(xy2, 0), s=sizes, facecolor='green')
39-
ax.scatter(d, d, marker=(xy3, 0), s=sizes, facecolor='red')
40+
ax.scatter(np.arange(3), np.arange(3), marker=(xy1,0),
41+
s=[s1*s1*_ for _ in sizes], facecolor='blue')
42+
ax.scatter(np.arange(3), np.arange(3), marker=(xy2,0),
43+
s=[s2*s2*_ for _ in sizes], facecolor='green')
44+
ax.scatter(np.arange(3), np.arange(3), marker=(xy3,0),
45+
s=[s3*s3*_ for _ in sizes], facecolor='red')
46+
4047
plt.show()

0 commit comments

Comments
 (0)