From the course: Python for Marketing (2019)

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Switching between Matplotlib styles

Switching between Matplotlib styles - Python Tutorial

From the course: Python for Marketing (2019)

Switching between Matplotlib styles

- [Instructor] Matplotlib has some premade style sheets, and this is for the people who don't really want to think about color, design, and stuff like that, so, like, they're pre-baked, and there's a whole bunch of them at the link here, and you can just play around with them as you like. In order to set it, we have our plot here. In order to set it we do plot.style.use, and then we're going to use a seaborn pastel color theme. I'm just going to run this without applying the style so we can see what it looks like. There you go, it's all default colors, and if we run it with, we get a slightly different color theme. So we, you notice the arrows changed a little bit, so that is the default. We are still passing the colors in the plot, so they will remain the same, they will override the style sheet. So that's just how, if you want to just fall back to a style sheet and use somebody else's color palette, that's how you do it.

Contents