[Doc] Clarify edgecolors default for Collection#29252
Open
oscargus wants to merge 1 commit intomatplotlib:mainfrom
Open
[Doc] Clarify edgecolors default for Collection#29252oscargus wants to merge 1 commit intomatplotlib:mainfrom
oscargus wants to merge 1 commit intomatplotlib:mainfrom
Conversation
timhoffm
reviewed
Dec 8, 2024
| Parameters | ||
| ---------- | ||
| edgecolors : :mpltype:`color` or list of colors, default: :rc:`patch.edgecolor` | ||
| edgecolors : :mpltype:`color` or list of colors, optional |
Member
There was a problem hiding this comment.
Suggested change
| edgecolors : :mpltype:`color` or list of colors, optional | |
| edgecolors : :mpltype:`color` or list of colors or "face", optional |
As also written here https://matplotlib.org/stable/api/collections_api.html#matplotlib.collections.Collection.set_edgecolor
Comment on lines
+104
to
+106
| facecolor. If not provided, the value is :rc:`patch.edgecolor` if | ||
| :rc:`patch.force_edgecolor` is True or *facecolors* is 'none', | ||
| otherwise 'none'. |
Member
There was a problem hiding this comment.
Is the following more understandable? While your description is technically correct, it's hard to understand why these special rule exists. I've
- moved the common/default first 'none' to the beginning
- stated the exception of the default
- without spending extra words hopefully allude to 'none' being not a good value if facecolors is also 'none' because both would be invisible
Suggested change
| facecolor. If not provided, the value is :rc:`patch.edgecolor` if | |
| :rc:`patch.force_edgecolor` is True or *facecolors* is 'none', | |
| otherwise 'none'. | |
| facecolor. | |
| If not provided, the value is 'none', i.e. the edge is invisible, unless | |
| *facecolors* is 'none' or :rc:`patch.force_edgecolor` is True, which both | |
| result in a fallback to rc:`patch.edgecolor`. |
This was referenced Dec 8, 2024
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.
PR summary
This was identified while debugging #29219
There is another case as well: for EventCollection and LineCollection. Seems like it would make more sense to mention it in those classes' documentation.
Not sure how it actually effects them though as, e.g., LineCollection says:
For reference, this is the code:
matplotlib/lib/matplotlib/collections.py
Lines 813 to 820 in 671177c
PR checklist