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

Appearance settings

Plot: convert 'c' to 'color' immediately; closes #4162, #4157 [backport to color_overhaul] #4198

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

Merged
merged 1 commit into from
Mar 8, 2015

Conversation

efiring
Copy link
Member

@efiring efiring commented Mar 7, 2015

No description provided.

@tacaswell
Copy link
Member

What is the underlying cause of this bug?

@tacaswell tacaswell changed the title Plot: convert 'c' to 'color' immediately; closes #4162, #4157 Plot: convert 'c' to 'color' immediately; closes #4162, #4157 [backport to color_overhaul] Mar 8, 2015
@tacaswell tacaswell added this to the Color overhaul milestone Mar 8, 2015
@cimarronm
Copy link
Contributor

👍 LGTM

@efiring
Copy link
Member Author

efiring commented Mar 8, 2015

@tacaswell, the problem is that _makeline is looking only for 'color', not 'c', when deciding whether to assign a color from the color_cycle. So if 'c' is there, it doesn't see it, and it goes ahead and adds a 'color' kwarg. Then Line2D sees both. I haven't looked to see what goes on there, but based on the user reports, whether 'c' or 'color' takes precedence varies with the Python version. It's probably a matter of the lack of order preservation in dictionaries. Maybe the hash function is version-dependent.
It would be possible to put the alias substitution in _makeline, but it seems more robust to put it in plot. All sorts of variations on the theme are possible; we could warn or raise if a 'c' clobbers a 'color', for example. But is handling that case worth the extra LOC at this point?

@tacaswell
Copy link
Member

This all goes back to http://bugs.python.org/issue13703 which added seed randomization to the hash function used in dictionaries to prevent DoS attacks on web-frameworks. Turning this randomization on was available, but off by default in 2.7 -> 3.2 and on by default in >3.3.

The fact that we are seeing these bug reports bodes well for python 3 uptake in the scientific world :).

tacaswell added a commit that referenced this pull request Mar 8, 2015
FIX : convert 'c' to 'color' immediately in plot

closes #4162, closes #4157
@tacaswell tacaswell merged commit ac335d9 into matplotlib:master Mar 8, 2015
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Mar 18, 2015
FIX : convert 'c' to 'color' immediately in plot

closes matplotlib#4162, closes matplotlib#4157
tacaswell added a commit that referenced this pull request Mar 23, 2015
FIX : convert 'c' to 'color' immediately in plot

closes #4162, closes #4157, closes #4262
@tacaswell
Copy link
Member

back-ported as 3f03e2e

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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.