Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[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

Open
wants to merge 1 commit into
base: main
Choose a base branch
Loading
from

Conversation

oscargus
Copy link
Member

@oscargus oscargus commented Dec 7, 2024

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:

The properties of each member of a *LineCollection* default to their values

in :rc:lines.* instead of :rc:patch.*, and the property colors is
added in place of edgecolors.

For reference, this is the code:

if c is None:
if (mpl.rcParams['patch.force_edgecolor']
or self._edge_default
or cbook._str_equal(self._original_facecolor, 'none')):
c = self._get_default_edgecolor()
else:
c = 'none'
set_hatch_color = False

PR checklist

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

Choose a reason for hiding this comment

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

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'.
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.