-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: support pie plot in series and dataframe plot #6976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@TomAugspurger I think it makes sense to make an additional sectin in plotting.rst to have basic/additional plots/advanced plots? (additional section is getting kind of long)? |
@sinhrks pls rebase (actually you might need to do most of your PR's as I merged one of them) |
@sinhrks For clarity: I am right the |
(Cannot use ``label`` and ``color``, because of matplotlib's specification). | ||
If you want to hide wedge labels, specify ``labels=None``. | ||
If ``fontsize`` is specified, the value will be applied to wedge labels. | ||
Also, other keywords supported by ``matplotlib.pyplot.pie`` can be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you refer here by using :func:
matplotlib.pyplot.pie``, then it will generate a link to its docs and you can directly inspect what other parameters you can use. Just need to add matplotlib in the list of intersphinx here (https://github.com/pydata/pandas/blob/master/doc/source/conf.py#L281)
Yep, |
@jreback I'll reorganize plotting.rst before .14 |
gr8 thanks |
Thanks @sinhrks. I retriggered the Travis build. It's not great that we need to use A nice feature would be to specify the layout if using subplots. But that can wait for another PR. This should merge cleanly once the Travis is done. |
One more thing (not specific to this PR). Should we warn if a user passes an argument that we ignore in |
@TomAugspurger Yes, it is better. Is it OK to show warnings only when explicitly change any options which collapses plot? I mean, there are some options not used / not supported in Pie, such as |
I'm not sure what you mean by collapsing the plot. Do you mean like: |
ENH: support pie plot in series and dataframe plot
New issue for the warnings: #7045 |
Related to #413, added pie plot for
Series.plot
andDataFrame.plot
kind.If data includes
NaN
, it will be automatically filled by 0. If data contains negative value,ValueError
will be raised.Plotting with DataFrame
Pie plot with
DataFrame
requires either to specify target column byy
argument orsubplots=True
. Wheny
is specified, pie plot of selected column will be drawn. Ifsubplots=True
is specified, pie plots for each columns are drawn as subplots. Legend will be drawn in each pie plots by default, specifylegend=False
to hide it.Plotting with Options
You can use
labels
andcolors
keywords to specify labels and colors of each wedges (Cannot uselabel
andcolor
, because of matplotlib's specification). If you want to hide wedge labels, specifylabels=None
. Iffontsize
is specified, the value will be applied to wedge labels. Also, other keywords supported bymatplotlib.pyplot.pie
can be used.