Skip to content
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

docs: adding explanation for color in set_facecolor #27164

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

Borda
Copy link
Contributor

@Borda Borda commented Oct 21, 2023

PR summary

Adding explanation what the color means in set_facecolor

PR checklist

Copy link

@github-actions github-actions bot left a 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.

@@ -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`
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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

Copy link
Contributor Author

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...

Copy link
Contributor Author

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`.

@Borda
Copy link
Contributor Author

Borda commented Oct 25, 2023

I think that the failed codecov is irrelevant in this case :)

timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Oct 25, 2023
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.
timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Oct 25, 2023
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.
@timhoffm
Copy link
Member

Please wait for #27200.

@jklymak
Copy link
Member

jklymak commented Oct 26, 2023

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.

@jklymak jklymak added the Documentation: API files in lib/ and doc/api label Oct 26, 2023
@tacaswell tacaswell added this to the v3.9.0 milestone Oct 26, 2023
@timhoffm timhoffm merged commit 309981d into matplotlib:main Oct 26, 2023
41 of 42 checks passed
@Borda Borda deleted the docs/set_facecolor branch October 27, 2023 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: API files in lib/ and doc/api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants