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

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…

Contents