<!--
title: Plotting with Pandas and Matplotlib
type: lesson
duration: "01:00"
creator: Emma Freeman [originating from xx's xx lesson] for Python 5-day course.
-->

# ![](https://ga-dash.s3.amazonaws.com/production/assets/logo-9f88ae6c9c3871690e33280fcf557f33.png) Lesson Plan: Plotting with Pandas and Matplotlib


## Overview
This lesson introduces students to using data visualization with Pandas and Matplotlib. Students already know the types of graphs (line, bar, histogram, scatter), so that knowledge is reinforced as we walk students through each type of graph, how to implement with Pandas and Matplotlib, and what each plot type is used for.

## Important Notes or Prerequisites

## Learning Objectives
*After this lesson, students will be able to:*

- Implement different types of graphs on a given dataset.

## Duration
60 minutes.

---

## Suggested Agenda
<!--- Provide a breakdown of what will happen in this lesson. --->

| Time | Activity | Purpose |
| --- | --- | --- |
| 0:00 - 0:03 | [Welcome](#activity-welcome-3-min) | Introduce the lesson’s objectives and agenda.|
| 0:03 - 0:10 | [Choosing Your Plot Type](#activity-choosing-your-plot-type-7-min) | Get students thinking about choosing plot types. |
| 0:10 - 0:18 | [Set Up Matplotlib](#activity-set-up-matplotlib-8-min) | Import packages and load in datasets. |
| 0:18 - 0:58 | [Plotting](#activity-we-do---plotting-40-min)  | Walk through creating different types of plots. |
| 0:58 - 1:00 | [Summary](#activity-summary-2-min)  | Wrap up the learning and share additional resources and next steps. |


## Materials and Preparation
- Give the students the link to the notebook or help them download it.
- No out of the ordinary prep needed

## Differentiation and Extensions
- For more advanced students, encourage them to experiment in the code-alongs and look up more features in the documentation.

---
---

## Lesson Procedure

-----

### Activity: Welcome (3 min)
> Introduce the lesson’s objectives and agenda.

---

### Activity: Choosing Your Plot Type (7 min)
> Get students thinking about choosing plot types.

> **Teaching Tips**:
> - Ask students to explain the types of plots with examples.
> - Allow time for students to ask any anticipatory questions here.

---

### Activity: Set Up Matplotlib (8 min)
> Import packages and load in datasets

> **Teaching Tips**:
> - Make sure everyone is on the same page and ready to start plotting! This could take a while if some students have trouble.

---

### Activity: We Do - Plotting (40 min)
> Walk through creating different types of plots.

> **Teaching tips**:
> - Most of this lesson is a code-along, so they should all be typing. Make sure the students are all keeping up and on the same page. Check frequently on where everyone is. Encourage them to ask questions about what the code does.
> - Some of the Pandas code is stuff they haven't learned yet, so if they are confused, mention that this is something more advanced they will learn later, but is necessary for demonstrating the plotting techniques - like value_counts(). Preferably, if there's time, explain now to them how it works.

> - There are a couple "You Try" and Challenges. Have them try to write the code first, and help each other if they want. Then go over the solution. **Try not to show the solution until they've tried!**

> - In the knowledge checks,  ask them questions and get them talking.

> - Reiterate, slowly, what you're doing throughout as you go - go  through each line of code every time! This is the first time they've done this. Repetition is key.

### Activity: Summary (2 min)
> Wrap up the learning and share additional resources and next steps.
