The most straightforward way to build a pie chart is to use the
pie method.
In this case, pie takes values corresponding to counts in a group.
We'll first generate some fake data, corresponding to three groups.
In the inner circle, we'll treat each number as belonging to its
own group. In the outer circle, we'll plot them as members of their
original 3 groups.
The effect of the donut shape is achieved by setting a width to
the pie's wedges through the wedgeprops argument.
However, you can accomplish the same output by using a bar plot on
Axes with a polar coordinate system. This may give more flexibility on
the exact design of the plot.
In this case, we need to map x-values of the bar chart onto radians of
a circle. The cumulative sum of the values are used as the edges
of the bars.