-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC Use plot.<kind> instead of plot(kind=<kind>) GH11043 #11303
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
|
||
To plot multiple column groups in a single axes, repeat ``plot`` method specifying target ``ax``. | ||
It is recommended to specify ``color`` and ``label`` keywords to distinguish each groups. | ||
|
||
.. ipython:: python | ||
|
||
ax = df.plot(kind='scatter', x='a', y='b', | ||
ax = df.plot.scatter(x='a', y='b', | ||
color='DarkBlue', label='Group 1'); |
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.
fix the indentation to align with (
on the line above
Thanks for putting this together! Looks pretty good to me, modulo a few nit-picks. |
can we leave a small example that uses the old syntax (and maybe a note about the usefulness of having the accessor). |
any comments @jorisvandenbossche @shoyer @sinhrks |
.. versionadded:: 0.15.0 | ||
|
||
Histogram can be drawn specifying ``kind='hist'``. | ||
Histogram can be drawn by using the ``plot(kind='hist')`` method. |
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.
plot.hist
?
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.
plot(kind='hist')
has been added in version 0.15.0 but not plot.hist
. I kept the previous method to point what was new with that version. With new the general description at the top of the document, I felt that plot(kind='hist')
was clearer than kind='hist'
.
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.
i would remove the 0.15.0 comment as you have the 0.17.0 tag here with the new way
@Moisan can you squash |
|
||
.. versionadded:: 0.17.0 | ||
|
||
:meth:`DataFrame.plot.box` and :meth:`Series.plot.box` can now be used to draw boxplot. | ||
|
||
.. versionadded:: 0.15.0 |
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.
same here, you can remove the original tag
ok I see that we are adding but its nice to see when the method is added, so reversing some of my comments from above :) let's leave the original version added tags (but show them with I know a bit of a a misnomer here, but it is overall much cleaner i think. |
I am personally a bit hesitant to change this in the full plotting docs, because it is a reality that a lot of people are not using the latest pandas. Seeing these docs will lead to errors for them and potential confusion. |
How about change the actual examples and put a |
So we would let the original examples in a In short, what do I need to do exactly to make it in the release? |
@jorisvandenbossche @shoyer what are thoughts here? |
@shoyer thoughts here |
I think we should update the docs to use the new syntax. It's not hard to find old versions of docs on Google, and this really is a cleaner way to do things. |
sounds good to me. @Moisan let's do that (you can still leave the versionadded tags for when that actual graphing feature came into pandas I guess). but don't add tags for the overall syntax change. I think their is already a note about that at the top anyhow. |
@Moisan can you update |
I thought my last commit fixed these points. Is there something I missed? |
@shoyer can you review |
plt.figure(); | ||
|
||
@savefig bar_plot_ex.png | ||
df.ix[5].plot(kind='bar'); plt.axhline(0, color='k') |
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.
you changed there rest, might as well change this one too (to use .plot.bar()
)
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.
Probably good to keep this one, since right after we say you can alternatively use the new .plot.<kind>
method.
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.
ok sure
@jorisvandenbossche are you OK with this? We have the old version of the docs linked on the main page, and the error should be pretty discoverable since we have the versionadded tag right before discussing the |
thanks @Moisan docs will be built in a few hours, pls review: http://pandas-docs.github.io/pandas-docs-travis/ and if necessary issue a follow up |
I reviewed the updated docs and everything seems fine. 👍 |
I also looked at the docs, and I think there is one minor thing that can be improved: the refs to the plotting methods. Possible solution is to leave out the @Moisan Would you be interested in a follow-up PR? |
On a closer look, the example I gave is actually the only occurence of that problem :-) I changed this one occurence in another PR: #12326 |
Thanks for the feedback! |
closes #11043
I modified the visualization documentation to use plot. instead of plot(kind=) in the examples as explained by issue 11043.