Skip to content
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

MNT: trap inappropriate use of color kwarg in scatter; closes #6266 #6267

Merged
merged 1 commit into from Apr 8, 2016

Conversation

efiring
Copy link
Member

@efiring efiring commented Apr 3, 2016

This slightly modifies and extends the special-casing of color-related
kwargs that would otherwise be passed in to a Collection instance.
Attempts to use 'color' in place of the 'c' kwarg for color-mapping
in scatter are now trapped with a ValueError in most cases. There
are still cases that are impossible to trap: a sequence of 3 or 4
floats between 0 and 1 could be either a single color spec or a
sequence of values to be color-mapped.

@@ -3824,19 +3824,23 @@ def scatter(self, x, y, s=None, c=None, marker='o', cmap=None, norm=None,
# Process **kwargs to handle aliases, conflicts with explicit kwargs:

facecolors = None
ec = kwargs.pop('edgecolor', None)
ec = kwargs.pop('edgecolors', None)
Copy link
Member

Choose a reason for hiding this comment

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

edgecolors is already explicitly named as a keyword argument up above. It would never be in kwargs.

@WeatherGod
Copy link
Member

besides the one nitpick, this looks fine to me.

@tacaswell tacaswell added this to the 1.5.2 (Critical bug fix release) milestone Apr 7, 2016
@tacaswell
Copy link
Member

I agree with @WeatherGod

…lib#6266

This slightly modifies and extends the special-casing of color-related
kwargs that would otherwise be passed in to a Collection instance.
Attempts to use 'color' in place of the 'c' kwarg for color-mapping
in scatter are now trapped with a ValueError in most cases.  There
are still cases that are impossible to trap: a sequence of 3 or 4
floats between 0 and 1 could be either a single color spec or a
sequence of values to be color-mapped.
@WeatherGod WeatherGod merged commit 0b6aa7b into matplotlib:master Apr 8, 2016
WeatherGod added a commit that referenced this pull request Apr 8, 2016
MNT: trap inappropriate use of color kwarg in scatter; closes #6266
@WeatherGod
Copy link
Member

backported to v1.5.x as 1f1b8b8

tacaswell pushed a commit to tacaswell/matplotlib that referenced this pull request May 22, 2016
MNT: trap inappropriate use of color kwarg in scatter; closes matplotlib#6266
@efiring efiring deleted the scatter-color branch June 23, 2016 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants