Conversation
| The following examples show how two ways to build a nested pie chart | ||
| in Matplotlib. | ||
|
|
||
| The most straightforward way to build a pie chart is to use the |
There was a problem hiding this comment.
I would make this part a comment (instead of a docstring) for symmetry with below.
| } | ||
| outer['height'] = np.zeros_like(outer['left']) + 3 | ||
|
|
||
| ax.bar(**inner, **common_opts) |
There was a problem hiding this comment.
Too modern syntax (I know it's sad we don't get to use it).
| ############################################################################### | ||
| # 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. |
There was a problem hiding this comment.
I think the two examples should show the same data (if not necessarily the same style). For the one below, that probably means calling something like np.histogram(data, cumulative=True) * 2 * np.pi and fiddling with partial sums.
|
@anntzer first two comments addressed, for the last comment I added more explanation to the rST explaining what kinds of inputs each approach takes. That seemed like a more straightforward solution than trying to do some kind of mapping between the original bins and 2*pi...the point of the example is just to show the visuals anyway. LMK if that works |
|
Sure. |
|
(travis failure is the infamous ImageComparisonFailure) |
|
Restarted the failed test. |
|
looks like all are passing now |
This adds the nested pyplot examples that were demoed in the gitter by @phobson and @anntzer. Both were cool, and since it was in response to a user asking how to create this, I assume that there are many other users that would like to know how to do this but didn't think to ask on the gitter, thus the example!