X Tutup
Skip to content

Fix DeprecationWarning in stackplot.py#5605

Merged
tacaswell merged 1 commit intomatplotlib:masterfrom
sjpfenninger:stackplot-cycler
Dec 3, 2015
Merged

Fix DeprecationWarning in stackplot.py#5605
tacaswell merged 1 commit intomatplotlib:masterfrom
sjpfenninger:stackplot-cycler

Conversation

@sjpfenninger
Copy link
Copy Markdown
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
Copy Markdown
Member

mdboom commented Dec 2, 2015

👍

@tacaswell
Copy link
Copy Markdown
Member

👍 seems reasonable enough to me.

@tacaswell
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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

@sjpfenninger
Copy link
Copy Markdown
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
Copy Markdown
Member

backported to v1.5.x as ba9ee86

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

4 participants

X Tutup