reillychase / Matplotlib-sorted-pie-chart

Matplotlib-sorted-pie-chart

Repository from Github https://github.comreillychase/Matplotlib-sorted-pie-chartRepository from Github https://github.comreillychase/Matplotlib-sorted-pie-chart

How to sort a Matplotlib Pie Chart

This is a simple example on how to order a Matplotlib pie chart (so that the slices are not large, then small, then large)

It makes it look better to have the data ordered descending/ascending by value. But it was a bit of a challenge because the labels and the values are two separate lists. To order them I first created a dictionary out of the dataset and then used that to generate the two ordered lists.

About

Matplotlib-sorted-pie-chart

License:GNU General Public License v3.0


Languages

Language:Python 100.0%