Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
oscargus wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromoscargus:cec

Conversation

oscargus
Copy link
Member

@oscargusoscargus commentedDec 7, 2024
edited
Loading

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 propertycolors is
added in place ofedgecolors.

For reference, this is the code:

ifcisNone:
if (mpl.rcParams['patch.force_edgecolor']
orself._edge_default
orcbook._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`orlistofcolors,optional
edgecolors : :mpltype:`color`orlistofcolorsor"face",optional

As also written herehttps://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.Ifnotprovided,thevalueis :rc:`patch.edgecolor`if
:rc:`patch.force_edgecolor`isTrueor*facecolors*is'none',
otherwise'none'.
facecolor.
Ifnotprovided,thevalueis'none',i.e.theedgeisinvisible,unless
*facecolors*is'none'or :rc:`patch.force_edgecolor`isTrue,whichboth
resultinafallbacktorc:`patch.edgecolor`.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@oscargus@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp