|
25 | 25 | # sinusoidal lines with colors from default color cycle |
26 | 26 | L = 2*np.pi |
27 | 27 | x = np.linspace(0, L) |
28 | | -ncolors = len(plt.rcParams['axes.color_cycle']) |
| 28 | +ncolors = len(plt.rcParams['axes.prop_cycle']) |
29 | 29 | shift = np.linspace(0, L, ncolors, endpoint=False) |
30 | 30 | for s in shift: |
31 | 31 | ax2.plot(x, np.sin(x + s), '-') |
|
36 | 36 | y1, y2 = np.random.randint(1, 25, size=(2, 5)) |
37 | 37 | width = 0.25 |
38 | 38 | ax3.bar(x, y1, width) |
39 | | -ax3.bar(x + width, y2, width, color=plt.rcParams['axes.color_cycle'][2]) |
| 39 | +ax3.bar(x + width, y2, width, |
| 40 | + color=list(plt.rcParams['axes.prop_cycle'])[2]['color']) |
40 | 41 | ax3.set_xticks(x + width) |
41 | 42 | ax3.set_xticklabels(['a', 'b', 'c', 'd', 'e']) |
42 | 43 |
|
43 | 44 | # circles with colors from default color cycle |
44 | | -for i, color in enumerate(plt.rcParams['axes.color_cycle']): |
| 45 | +for i, color in enumerate(plt.rcParams['axes.prop_cycle']): |
45 | 46 | xy = np.random.normal(size=2) |
46 | | - ax4.add_patch(plt.Circle(xy, radius=0.3, color=color)) |
| 47 | + ax4.add_patch(plt.Circle(xy, radius=0.3, color=color['color'])) |
47 | 48 | ax4.axis('equal') |
48 | 49 | ax4.margins(0) |
49 | 50 |
|
|
0 commit comments