Skip to content

[Feature Request] Add concise xlabel=, ylabel=, option in plot() method #9093

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

Closed
xgdgsc opened this issue Dec 16, 2014 · 9 comments · Fixed by #34223
Closed

[Feature Request] Add concise xlabel=, ylabel=, option in plot() method #9093

xgdgsc opened this issue Dec 16, 2014 · 9 comments · Fixed by #34223

Comments

@xgdgsc
Copy link
Contributor

xgdgsc commented Dec 16, 2014

The current plot() method for Dataframe cannot set the x/y label in it. Result is more lines of code for just doing this.

As someone commented in that post:

Is there a particular reason why x and y labels can't be added as arguments to pd.plot()? Given the additional concision of pd.plot() over plt.plot() it seems it would make sense to make it even more succinct instead of having to call ax.set_ylabel()

@shoyer
Copy link
Member

shoyer commented Dec 17, 2014

I just added my perspective on the right way to do this to the stackoverflow post. I don't see a strong need for clutter the APi with this, although to be fair, the plotting API is already pretty cluttered.

@jreback
Copy link
Contributor

jreback commented Dec 17, 2014

@xgdgsc we would accept a pull-request to implement this. Its pretty straightforward. As @shoyer says we are trying to not extend the plotting API anymore, but this does seems useful.

@xgdgsc
Copy link
Contributor Author

xgdgsc commented Dec 17, 2014

@jreback OK. I would like to try to implement this.

@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 6, 2015
@ispmarin
Copy link

ispmarin commented May 8, 2015

👍

@roryhr
Copy link

roryhr commented Nov 28, 2016

Scientists are taught always include a title and labelled axes on plots. Ideally, the Pandas default plot command would intelligently title and label plots. This is an important issue because adding labels to plots is still too difficult.

@TomAugspurger
Copy link
Contributor

Pandas grabs index name automatically for the x axis, and adds legends automatically. The issue isn't the defaults, it's the lack of an option for overriding those defaults. I think we're open to adding these arguments if someone has the time to submit a pull request.

@roryhr
Copy link

roryhr commented Nov 29, 2016

Sounds good. I'll take a look and see what I can do.

@paulbalegend
Copy link

Any activity on this? I would like to add a vote for this feature.

I think it would make most sense if the default behavior was to intelligently set ylabels--regardless of if it's a standard plot, a subplots=True plot, a secondary_y=whatever plot--instead of the way it automatically inserts a legend in all of these cases.

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Nov 1, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants