Alright matplotlib afficionados, we know how to plot a donut chart, but what is better than a donut chart? A double-donut chart. Specifically: We have a set of elements that fall into disjoint categories and sub-categories of the first categorization. The donut chart should have slices for the categories in the outer ring and slices for the sub-categories in the inner ring, obviously aligned with the outer slices.
Is there any library that provides this or do we need to work this out here?
I adapted the example you provided; you can tackle your problem by plotting two donuts on the same figure, with a smaller outer radius for one of them.
To obtain a double donut chart, you can plot as many pie charts in the same plot as you want. So the outer pie would have a
width
set to its wedges and the inner pie would have a radius that is less or equal1-width
.Note: I made this code also available in the matplotlib gallery as nested pie example.