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 - 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.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Custom visualizations in Python42s
-
(Locked)
Import, explore, and plot a basic chart4m 48s
-
(Locked)
Creating Matplotlib subplots2m 59s
-
(Locked)
Plotting a secondary y-axis2m 40s
-
(Locked)
Adding x and y labels to a plot2m 40s
-
(Locked)
Rotating xticks labels on plot2m 1s
-
(Locked)
Adding a legend to a plot1m 5s
-
(Locked)
Adding a title to your plot1m 26s
-
(Locked)
Adding annotations to plots3m
-
(Locked)
Switching between Matplotlib styles1m 3s
-
(Locked)
Using a scatter plot in Seaborn1m 8s
-
(Locked)
Customizing a scatter plot in Seaborn2m 21s
-
(Locked)
Creating a Facebook Ads heatmap in Seaborn2m 56s
-
(Locked)
-
-
-
-