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

Fix DeprecationWarning in stackplot.py #5605

Merged
merged 1 commit into from Dec 3, 2015

Conversation

sjpfenninger
Copy link
Contributor

In matplotlib 1.5.0, plt.stackplot() raises a DeprecationWarning ("The set_color_cycle attribute was deprecated in version 1.5. Use set_prop_cycle instead"):

The simple replacement in the attached pull request seems to fix this.

@tacaswell tacaswell added this to the Critical bugfix release (1.5.1) milestone Dec 2, 2015
@mdboom
Copy link
Member

mdboom commented Dec 2, 2015

👍

@tacaswell
Copy link
Member

👍 seems reasonable enough to me.

@tacaswell
Copy link
Member

It seems that stackplot is in need of a re-write, but that is way outside of the scope of this PR.

@WeatherGod
Copy link
Member

Holy crap! I didn't notice that this function modified the axes's cycle! This change should probably also reset the property cycle to its default prior to returning if it modified it originally.

What I also don't like is that this uses the cycler in a bad way. Specifying the colors shouldn't do anything to the property cycle at all. Maybe the refactor of cycle handling will help here?

@mdboom
Copy link
Member

mdboom commented Dec 2, 2015

@WeatherGod: I hear you on all this. I think for 1.5.x we can just do exactly this PR (to simply silence the warning). Anything else is probably best done on 2.0.x or later.

@WeatherGod
Copy link
Member

Agreed. Sorry if I wasn't clear. v1.5 should duplicate the current behavior.

@sjpfenninger
Copy link
Contributor Author

Yeah, my aim was just to silence the warning, I didn't look at the bigger picture at all..

tacaswell added a commit that referenced this pull request Dec 3, 2015
Fix DeprecationWarning in stackplot.py
@tacaswell tacaswell merged commit 40b7837 into matplotlib:master Dec 3, 2015
tacaswell added a commit that referenced this pull request Dec 3, 2015
Fix DeprecationWarning in stackplot.py
@tacaswell
Copy link
Member

backported to v1.5.x as ba9ee86

@tacaswell
Copy link
Member

@sjpfenninger Thank you and congratulations on (what I think is) your first mpl contribution!

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