You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: hist()'s doc for edgecolors/facecolors does not match behavior (which is itself not very consistent) #28873
**kwargs
`~matplotlib.patches.Patch` properties. The following properties
additionally accept a sequence of values corresponding to the
datasets in *x*:
*edgecolors*, *facecolors*, *lines*, *linestyles*, *hatches*.
but this does not match actual behavior
Code for reproduction
frompylabimport*hist(randn(100), facecolor="red") # workshist(randn(100), fc="red") # silently does nothinghist(randn(100), facecolors="red") # crashes (Rectangle.set() got an unexpected keyword argument 'facecolors')# and likewise for edgecolor(s)
Actual outcome
See above.
Expected outcome
At least the documentation and the behavior should match. Bonus points if all three kwarg forms (facecolor/fc/facecolors) are supported.
I believe this is the minimal API we must provide for consistency within the function. Before this PR, color and label accepted list inputs. Therefore, we should support the singular names. Plurals and abbreviations may come later. I suspect we should write helper functions to consolidate/normalize the different parameter names.
#28875 is a minimal fix for the documentation. That should solve the release-critical documentation aspect of this issue, but will not close it completely.
Activity
timhoffm commentedon Sep 24, 2024
The functionality was recently added in #28073.
The relevant code is:
https://github.com/matplotlib/matplotlib/blame/65878f3469da914e1399622ff5996c05ce0a4e73/lib/matplotlib/axes/_axes.py#L7212-L7234
To follow implementation, the documentation should read:
instead of
I believe this is the minimal API we must provide for consistency within the function. Before this PR,
colorandlabelaccepted list inputs. Therefore, we should support the singular names. Plurals and abbreviations may come later. I suspect we should write helper functions to consolidate/normalize the different parameter names.anntzer commentedon Sep 24, 2024
At least the documentation issue should be release critical.
DOC: Fix documentation of hist() kwarg lists
timhoffm commentedon Sep 24, 2024
#28875 is a minimal fix for the documentation. That should solve the release-critical documentation aspect of this issue, but will not close it completely.
timhoffm commentedon Sep 25, 2024
The documentation is fixed. To keep the remaining topic more focussed, I've created #28884, which covers the consistency aspect.
DOC: Fix documentation of hist() kwarg lists