DOC: state which matplotlib function receives the plot kwargs - #67057
Open
Panzerkampfwagen-del wants to merge 1 commit into
Open
DOC: state which matplotlib function receives the plot kwargs#67057Panzerkampfwagen-del wants to merge 1 commit into
Panzerkampfwagen-del wants to merge 1 commit into
Conversation
For the default matplotlib backend, document in each DataFrame.plot method docstring which matplotlib function the keyword arguments are passed to (Axes.plot, Axes.bar, Axes.barh, Axes.boxplot, Axes.hist, Axes.pie, Axes.scatter, Axes.hexbin), as discussed in pandas-dev#61020.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes DOC: df.plot() is missing color parameter on documentation #61020
Tests added and passed (not applicable: docs-only change)
All code checks passed (ruff clean on the touched file; docstring build validated by CI)
Added type annotations (not applicable: no new arguments)
whatsnew entry (not applicable: docs-only change)
I have reviewed and followed all the contribution guidelines
Check exactly one of the following, per the automated contributions policy:
I did not use AI to develop this pull request.
I used AI to develop this pull request. I have reviewed and understood every change, and I have described above how I used it and exactly which tool, model version, and effort setting.
How AI was used: Claude was used for identifying the issue, drafting this PR body, and preparing the docstring edits. I reviewed every change and verified each mapping against the matplotlib call sites in
pandas/plotting/_matplotlib/before staging it.What does this PR do?
As discussed in #61020 (rhshadrach's comment of Apr 10), for the default matplotlib backend this adds to each
DataFrame.plotmethod docstring the matplotlib function the keyword arguments are passed to, and extends theDataFrame.plot**kwargsentry accordingly:plot.line,plot.area→matplotlib.axes.Axes.plotplot.kde→ density estimated withscipy.stats.gaussian_kde, curve drawn withmatplotlib.axes.Axes.plotplot.bar/plot.barh→matplotlib.axes.Axes.bar/matplotlib.axes.Axes.barhplot.box→matplotlib.axes.Axes.boxplotplot.hist→matplotlib.axes.Axes.histplot.pie→matplotlib.axes.Axes.pieplot.scatter→matplotlib.axes.Axes.scatterplot.hexbin→matplotlib.axes.Axes.hexbinEvery mapping was verified against the call sites in
pandas/plotting/_matplotlib/(ax.plot,ax.bar,ax.barh,ax.boxplot,ax.hist,ax.pie,ax.scatter,ax.hexbin).As jbrockmendel noted in the issue, arguments specific to third-party backends are deliberately not documented here.