-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
docs: adding explanation for color in set_facecolor
#27164
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
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.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
lib/matplotlib/axes/_base.py
Outdated
@@ -1499,7 +1499,7 @@ def set_facecolor(self, color): | |||
|
|||
Parameters | |||
---------- | |||
color : color | |||
color : color defined by string name, char abbreviation or hex, see :doc:`gallery/color/named_colors` |
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.
So we have many of these, where color : color
.
I think there is an argument for adding links:
color : color; see :ref:`colors_def`
would be a better link (resolves to https://matplotlib.org/stable/users/explain/colors/colors.html).
I know this was discussed before, but I forget the resolution. @timhoffm is the API documentation lead.
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.
See #24859 (comment)
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.
Right so I think the suggestion above is fine.
Bonus points if this PR searches and replaces the other instances
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 can do it tomorrow...
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.
btw, there are also many cases like
color : color
Color for axis pane.
shall this be also extended?
color : color; see :ref:`colors_def`
Color for axis pane.
or
color : color
Color for axis pane. See :ref:`colors_def`.
I think that the failed codecov is irrelevant in this case :) |
The role is intended to be used for type references in docstrings like ``` Parameters ---------- color : :mpltype:`color` ``` It is easily extendable to other types. The naming `mpltype` was a quick choice. I'm open to better names. This PR contains one example usage in `widgets.Button` so that one can see the effect in the built docs. Systematic application throughout the codebase should be deferred to a separate PR. Closes matplotlib#24859. Formalizes matplotlib#27164.
The role is intended to be used for type references in docstrings like ``` Parameters ---------- color : :mpltype:`color` ``` It is easily extendable to other types. The naming `mpltype` was a quick choice. I'm open to better names. This PR contains one example usage in `widgets.Button` so that one can see the effect in the built docs. Systematic application throughout the codebase should be deferred to a separate PR. Closes matplotlib#24859. Formalizes matplotlib#27164.
Please wait for #27200. |
I don't think this needs to wait for #27200 - it's a simple search and replace if we decide to add a new custom role, whereas this greatly improves things with or without that feature. |
PR summary
Adding explanation what the color means in
set_facecolor
PR checklist