Learn how to create figures and subplots within Jupyter notebooks using matplotlib and NumPy in this video tutorial by Charles Kelly. These are explained in the context of computer science and data science to technologists and students in preparation for
- [Instructor] The Figures and Subplots file…from your Exercises file folder is pre-populated…with import statements for numpy and pyplot.…Enter this cell and press shift + enter.…A figure is a container that holds all the elements of plots…and a subplot appears within a rectangular grid…within a figure.…A short example will illustrate this.…Let's create my_first_figure.…
And the way we create a figure…is we use plt and then call its figure function…and we'll give it a name.…Press shift + enter.…Within our figure, let's create two subplots.…Let's call the first subplot, subplot_1.…And what well do is we'll take my_first_figure…and then we'll call it's add_subplot function.…
The subplot function takes three parameters…or three arguments.…The first parameter is the number of rows in the grid…that holds the subplots.…The second is the number of columns…and the third is a reference to a particular subplot…within all the subplots within a figure.…Let's duplicate this,…and create a second subplot.…And this time we'll call it, subplot_6…
- Using Jupyter Notebook
- Creating NumPy arrays from Python structures
- Slicing arrays
- Using Boolean masking and broadcasting techniques
- Plotting in Jupyter notebooks
- Joining and splitting arrays
- Rearranging array elements
- Creating universal functions
- Finding patterns
- Building magic squares and magic cubes with NumPy and Python
Skill Level Intermediate
2. Create NumPy Arrays
3. Index, Slice, and Iterate
4. Plots: Matplotlib and Pyplot
5. Manipulate Arrays
6. Short Examples
7. Extended Examples
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.