-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Doc] Clarify edgecolors default for Collection #29252
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
base: main
Are you sure you want to change the base?
Conversation
@@ -98,10 +98,12 @@ def __init__(self, *, | ||
""" | ||
Parameters | ||
---------- | ||
edgecolors : :mpltype:`color` or list of colors, default: :rc:`patch.edgecolor` | ||
edgecolors : :mpltype:`color` or list of colors, optional |
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.
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
facecolor. If not provided, the value is :rc:`patch.edgecolor` if | ||
:rc:`patch.force_edgecolor` is True or *facecolors* is 'none', | ||
otherwise 'none'. |
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.
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
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`. |
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