X Tutup
Skip to content

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

Merged
WeatherGod merged 1 commit intomatplotlib:masterfrom
efiring:scatter-color
Apr 8, 2016
Merged

MNT: trap inappropriate use of color kwarg in scatter; closes #6266#6267
WeatherGod merged 1 commit intomatplotlib:masterfrom
efiring:scatter-color

Conversation

@efiring
Copy link
Copy Markdown
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.


facecolors = None
ec = kwargs.pop('edgecolor', None)
ec = kwargs.pop('edgecolors', None)
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

4 participants

X Tutup