From the course: Data Visualization with Matplotlib and Seaborn
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Solution: Subplots - Python Tutorial
From the course: Data Visualization with Matplotlib and Seaborn
Solution: Subplots
- [Instructor] All right, everybody, our solution code is up on the right. This is just one of three solution codes I'll take a look at in the walkthrough. Let's go ahead and dive into the notebook. All right, so we're going to import our libraries, and read in our hotel customers dataset. And while that's importing, let's take a look at our subplots function here. We're specifying a two row, three column subplot layout, specifying constrained layout equals true to make sure that our axes don't overlap, and then we're specifying share X equals all, and share Y equals all, to make sure that our axes get shared. We then add a figure level title before moving into our individual subplots. And so I'll walk through this first histogram, and the rest, it's just going to be a matter of changing our coordinate. So for our first row, first column, we're going to plot a histogram. We're going to filter down our hotel's data frame to the Portugal rows, and filter down to room nights less than…
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)
Intro to advanced customization58s
-
(Locked)
Subplots9m 47s
-
(Locked)
Challenge: Subplots2m 12s
-
(Locked)
Solution: Subplots4m 45s
-
(Locked)
GridSpec6m 17s
-
(Locked)
Challenge: GridSpec2m 43s
-
(Locked)
Solution: GridSpec4m 10s
-
(Locked)
Color options3m 3s
-
(Locked)
Color palettes4m 50s
-
(Locked)
Challenge: Colors1m 53s
-
(Locked)
Solution: Colors1m 34s
-
(Locked)
Style sheets4m 19s
-
(Locked)
Challenge: Style sheets1m 9s
-
(Locked)
Solution: Style Sheets1m 11s
-
(Locked)
rcParams6m 57s
-
(Locked)
Saving figures and images2m 46s
-
(Locked)
Key takeaways48s
-
(Locked)
-
-
-