You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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`).
The text was updated successfully, but these errors were encountered:
Hello I would like to starting contributing, I came across this issue and I would like to know if this would be a possible fix on the scatter function
iflinewidthsisnotNoneandkwargs.get('linewidth') isnotNone:
raiseTypeError('linewidths and linewidth cannot be used simultaneously.')
ifedgecolorsisnotNoneandkwargs.get('edgecolor') isnotNone:
raiseTypeError('edgecolors and edgecolor cannot be used simultaneously.')
Uh oh!
There was an error while loading. Please reload this page.
Problem
plt.scatter
accepts both singular and plural forms of thelinewidth(s)
andedgecolor(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 givene.g.
edgecolorand
ec`).The text was updated successfully, but these errors were encountered: