Data Visualization with Python

Welcome to Data Visualization

You have mastered data manipulation with Pandas. Now you will learn Data Visualization—creating clear, informative charts and graphs to communicate insights from your data.

Data visualization transforms numbers into visual stories. A well-designed chart can reveal patterns, trends, and relationships that are invisible in raw data. This module teaches you to create professional visualizations using Matplotlib and Pandas plotting.

By the end of this module, you will be able to:

  • Understand graph anatomy and coordinate systems
  • Create line plots for time series data
  • Build scatter plots to explore correlations
  • Design bar charts and histograms for distributions
  • Use Pandas plotting for quick visualizations
  • Create multi-panel subplot grids
  • Apply visualization best practices
  • Complete a real-world traffic analysis project

This module contains 16 lessons organized into 5 modules covering all essential visualization techniques.


Prerequisites

Before starting this module, you should:

  • Python basics: Variables, functions, control flow
  • NumPy fundamentals: Arrays and basic operations
  • Pandas fundamentals: DataFrames, selection, and manipulation

If you need to review these topics, see the NumPy module and Pandas module first.


Module Structure

This module contains 16 lessons divided into 5 modules:

Module 1: Line Plots and Time Series (Lessons 1-4)

Learn graph fundamentals, create line plots, and visualize time series data.

Module 2: Scatter Plots and Correlation (Lessons 5-8)

Explore relationships between variables using scatter plots and correlation analysis.

Module 3: Bar Plots and Histograms (Lessons 9-12)

Create categorical visualizations and analyze data distributions.

Module 4: Pandas Plotting and Grids (Lessons 13-15)

Master Pandas plotting methods and create multi-panel subplot grids.

Module 5: Final Project (Lesson 16)

Apply all skills to analyze São Paulo traffic patterns in a comprehensive project.


Datasets Used

This module uses three real-world datasets:

1. Capital Bikeshare Dataset

  • 731 days of bike rental data from Washington DC (2011-2012)
  • Weather conditions, seasonality, and user patterns
  • Used in Lessons 2-4, 6-8, 11-15

2. São Paulo Traffic Dataset

  • 135 hours of traffic slowness measurements
  • Multiple incident types tracked
  • Used in final project (Lesson 16)

3. COVID-19 Dataset

  • Monthly new cases and deaths (January-July 2020)
  • Simple arrays for learning visualization basics
  • Used in Lessons 1-2

Complete data dictionaries and download links are provided in each lesson.


Learning Path

Each lesson builds on previous concepts. Follow the lessons in order for best results:

  1. Start with graph fundamentals (Lesson 1)
  2. Progress through line plots and time series (Lessons 2-4)
  3. Learn scatter plots and correlation (Lessons 5-8)
  4. Master categorical plots (Lessons 9-12)
  5. Explore Pandas plotting and grids (Lessons 13-15)
  6. Complete the final project (Lesson 16)

All Lessons

Lesson 1 - Understanding Graphs and Coordinates

Learn graph anatomy, coordinate systems, and how to read visualizations

Lesson 2 - Introduction to Matplotlib

Create your first plots with pyplot and understand the visualization workflow

Lesson 3 - Customizing Plots

Add titles, labels, legends, colors, and styles to make professional charts

Lesson 4 - Multiple Lines and Series

Plot multiple datasets on one graph for comparison and analysis

Lesson 5 - Scatter Plots Basics

Create scatter plots to visualize relationships between two variables

Lesson 6 - Customizing Scatter Plots

Control marker size, color, transparency, and add colorbars

Lesson 7 - Correlation and Trendlines

Calculate correlation coefficients and add regression lines to plots

Lesson 8 - Scatter Matrix

Create pairwise scatter plots to explore multiple variable relationships

Lesson 9 - Bar Plots

Create vertical and horizontal bar charts for categorical data

Lesson 10 - Grouped and Stacked Bars

Compare multiple categories with grouped and stacked bar charts

Lesson 11 - Histograms

Visualize data distributions with histograms and understand binning

Lesson 12 - Distribution Comparison

Compare multiple distributions using overlapping and side-by-side histograms

Lesson 13 - Pandas Plotting

Create quick visualizations directly from DataFrames using Pandas methods

Lesson 14 - Subplot Grids

Create multi-panel figures with plt.subplots() for comprehensive analysis

Lesson 15 - Figure Sizing and Layout

Control figure dimensions, aspect ratios, and spacing for publication-quality charts

Lesson 16 - Final Project: Traffic Analysis

Apply all skills to analyze São Paulo traffic patterns in a comprehensive project


Get Started

Ready to create stunning visualizations? Start with Lesson 1 to understand graph fundamentals, then progress through the lessons at your own pace.

Transform your data into visual insights with Python visualization!