8000 Raise when both singular and plural scatter attributes are specified · Issue #19120 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Raise when both singular and plural scatter attributes are specified #19120
Closed
@mwaskom

Description

@mwaskom

Problem

plt.scatter accepts both singular and plural forms of the linewidth(s) and edgecolor(s) attributes. The plural forms are documented in the function signature, but the singular forms actually take precedence if both are specified.

This adds some complexity for downstream libraries and confusion for their users (cf. mwaskom/seaborn#2384).

Proposed Solution

Small change: Matplotlib could raise when both the singular and plural forms are specified.

Larger change: I will confess that I don't know why the plural forms of the kwargs exist. If there's not a strong reason for the duplication, perhaps they could be deprecated, or at least "formally discouraged"?

Additional context and prior art

Scatter does a lot of argument checking on the c/color parameters (too much at times, 😉), so there's some local precedence for a lot of handholding. On the other hand, matplotlib generally doesn't raise when both long- and short-forms of kwargs are given e.g. edgecolorandec`).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0