From the course: Python for Data Visualization (2019)

Unlock this course with a free trial

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

Subplots

Subplots

- [Instructor] In this video, we'll learn how to create subplots using Matplotlib. It is often useful to compare different subsets of your data side by side. To demonstrate this, we're going to visualize images. The first thing we have to do is we have to import our libraries. We're going to have our figures appear inline in the notebook, so we're specifying inline, we're going to import pandas, numpy, and matplotlib. The next thing we have to do is we have to load our dataset, and our dataset is the digits dataset from scikit-learn that I have arranged into a csv file for convenience. The dataset consists of pixel intensity values for 1797 images that are eight by eight pixels. This means that the dataset has 64 total values per image, and each image is labeled with a number from zero to nine. We're going to load our dataset into panda's dataframe by using the read_cv method. With any data set, it always good to check the first couple rows to make sure…

Contents