O'Reilly logo
live online training icon Live Online training

First Steps: Visualization with Altair

enter image description here

Topic: Data
Max Humber

Python has lagged behind R and ggplot2 in the visualization space. While there are several options for plotting data in Python—including Matplotlib, seaborn, Bokeh, and plotnine, to name a few—the fact that there are so many libraries is telling. But things are changing. With the release and maturation of the Altair library, an open source project created by a core contributor of scikit-learn and SciPy, Python is quickly usurping R as the go-to language for building simple, beautiful, and interactive visualizations.

Join expert Max Humber to learn how to use Altair to build, add, and modify charts with Python in just a couple lines of code. Though Matplotlib might never be made entirely irrelevant (for simple exploratory visualizations, at least), this course may just convince you to use Altair in your future plotting projects.

What you'll learn-and how you can apply it

By the end of this live online course, you’ll understand:

  • How to build beautiful and customizable visualizations in Python with Altair
  • How to turn any static chart into an interactive experience
  • How to publish explanatory charts to GitHub Pages with a little bit of JavaScript

And you’ll be able to: - Use Altair to quickly facet-plot data for better understanding - Build layered charts that use interactivity in novel and creative ways - Quickly swap between different chart types with relative ease

This training course is for you because...

  • You often find yourself wrestling with the Matplotlib library.
  • You want to move where the Python visualization community is moving.


  • A working knowledge of Python
  • Familiarity with Matplotlib and Bokeh (useful but not required)

About your instructor

  • Max Humber is a distinguished faculty member at General Assembly and the author of Personal Finance with Python. Previously, he was the first data scientist at Borrowell and the second data engineer at Wealthsimple.


The timeframes are only estimates and may vary according to how the class is progressing

Introduction (5 minutes)

  • Group discussion: Do you actually like matplotlib?; Have you ever used ggplot2?
  • Presentation: A brief history of plotting in Python

Basics (20 minutes) - Presentation: Data prep with pandas; how to choose the appropriate mark and encoding; bars, circles, and lines - Hands-on exercise: Create your first Altair chart - Q&A

Customization (15 minutes) - Presentation: Adjusting the color palette; tweaking the axes; special chart formatting - Hands-on exercise: Modify an Altair chart - Q&A

Break (5 minutes)

Interactivity (25 minutes) - Presentation: How to add pan and zoom functionality; adding selections and brushes; data transformations through user interactions - Hands-on exercise: Add interactivity to an Altair chart - Q&A

Advanced Altair (25 minutes) - Presentation: Layering different geometries and marks; concatenating charts horizontally and vertically; faceting charts across rows and columns - Hands-on exercise: Layer and concatenate charts with Altair

Publishing (15 minutes) - Presentation: Publishing interactive Altair charts to GitHub pages

Wrap-up and Q&A (10 minutes)