From d732d1f365110196491fe412d9dc40540b8f9910 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 11 Nov 2024 17:54:24 +0100 Subject: [PATCH] DOC: Switch nested pie example from cmaps to color_sequences This makes it clearer that we are just indexing into a list of colors. Calling cmaps with an integer argument is somewhat obscure and we want to move away from this. See also #28198. --- galleries/examples/pie_and_polar_charts/nested_pie.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/galleries/examples/pie_and_polar_charts/nested_pie.py b/galleries/examples/pie_and_polar_charts/nested_pie.py index 412299bb4446..699360a1e3fa 100644 --- a/galleries/examples/pie_and_polar_charts/nested_pie.py +++ b/galleries/examples/pie_and_polar_charts/nested_pie.py @@ -31,9 +31,9 @@ size = 0.3 vals = np.array([[60., 32.], [37., 40.], [29., 10.]]) -cmap = plt.colormaps["tab20c"] -outer_colors = cmap(np.arange(3)*4) -inner_colors = cmap([1, 2, 5, 6, 9, 10]) +tab20c = plt.color_sequences["tab20c"] +outer_colors = [tab20c[i] for i in [0, 4, 8]] +inner_colors = [tab20c[i] for i in [1, 2, 5, 6, 9, 10]] ax.pie(vals.sum(axis=1), radius=1, colors=outer_colors, wedgeprops=dict(width=size, edgecolor='w'))
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: