From f6b13779140f852f97c8b58dc81b64af8c2a248d Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Fri, 16 Aug 2024 00:25:09 -0500 Subject: [PATCH] Correct colormap --- docs/conf.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 4b41211a..595362b6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -234,8 +234,15 @@ def setup(app): plt.legend(title='Languages', loc='right', bbox_to_anchor=(1,0.5), bbox_transform=plt.gcf().transFigure) plt.savefig('languages.svg', transparent=True, bbox_inches='tight') - sizes = [size / count for size, count in zip(sizes, counts)] - sizes, labels, colors = [z for z in zip(*sorted(zip(sizes, labels, colors), reverse=True)) if 'Makefile' not in z] + sizes = [float(size) / count for size, count in zip(sizes, counts)] + triples = sorted(zip(sizes, labels, colors), reverse=True) + sizes = [lang[0] for lang in triples] + labels = [lang[1] for lang in triples] + colors = [lang[2] for lang in triples] + pos = labels.index('Makefile') + labels.pop(pos) + sizes.pop(pos) + colors.pop(pos) _, ax = plt.subplots() ax.pie(sizes, labels=labels, colors=colors, autopct='%1.1f%%', labeldistance=None, pctdistance=0.85) plt.legend(title='Languages', loc='right', bbox_to_anchor=(1,0.5), bbox_transform=plt.gcf().transFigure)