|
20 | 20 | # some points on a circle cos,sin
|
21 | 21 | x = [0] + np.cos(np.linspace(0, 2*math.pi*r1, 10)).tolist()
|
22 | 22 | y = [0] + np.sin(np.linspace(0, 2*math.pi*r1, 10)).tolist()
|
| 23 | + |
| 24 | + |
23 | 25 | xy1 = list(zip(x, y))
|
| 26 | +s1 = max(max(x), max(y)) |
24 | 27 |
|
25 | 28 | # ...
|
26 | 29 | x = [0] + np.cos(np.linspace(2*math.pi*r1, 2*math.pi*r2, 10)).tolist()
|
27 | 30 | y = [0] + np.sin(np.linspace(2*math.pi*r1, 2*math.pi*r2, 10)).tolist()
|
28 | 31 | xy2 = list(zip(x, y))
|
| 32 | +s2 = max(max(x), max(y)) |
29 | 33 |
|
30 | 34 | x = [0] + np.cos(np.linspace(2*math.pi*r2, 2*math.pi, 10)).tolist()
|
31 | 35 | y = [0] + np.sin(np.linspace(2*math.pi*r2, 2*math.pi, 10)).tolist()
|
32 | 36 | xy3 = list(zip(x, y))
|
33 |
| - |
| 37 | +s3 = max(max(x), max(y)) |
34 | 38 |
|
35 | 39 | 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 | + |
40 | 47 | plt.show()
|
0 commit comments