Open Data Visualization is Beautiful with Altair
How much do you really care about your data visualizations? Would you like to improve your data visualization skills but never find the time? In this hands-on session, we'll use the Open Food Facts dataset to explore the Altair library. Of course we will build beautiful visualizations, but the goal will be to understand how the Grammar of Graphics works, develop best practices, and use interactions to improve the data exploration experience. You'll come out with a better understanding of how to use Altair, and enhance your critical skills towards data visualizations you see in the wild.
Most of us know what makes a good chart. Most of us still produce charts that miss the mark. The deadline is tomorrow, the dataset has 180 columns, and a quick line plot will do. Then the next chart is also quick. And the one after that. The data stays as opaque as when we started.
This session takes the slower path. We'll spend 25 minutes on Open Food Facts, a real, messy, multi-gigabyte open dataset, and use Altair within a Jupyter Notebook to explore it one chart at a time. The point isn't a polished dashboard at the end. The point is stopping, at each chart, on the choices that matter.
Three threads run through the session:
- The shape of the Altair library: marks, encodings, the four encoding types (quantitative, nominal, ordinal, temporal), transforms inside the specification.
- Data visualization best practices revisited with concrete examples: visual channel choice, scale honesty, decluttering, when an interaction earns its place.
- Keeping the chart responsive on a multi-gigabyte table by letting Polars or DuckDB do the aggregation upstream.
Target audience: data scientists, researchers, generally people working with data.
Key take-aways:
- think critically about the charts you build and see (channel efficiency, decluttering, geometry correctness...)
- get introduced to the Altair data visualization library (main principles, the grammar of graphics & interactivity)
Prior knowledge: Python, pandas or Polars. No Altair experience required.
Proposed outline:
- ~3min: Why data visualization matters in data analysis.
- ~5min: Intro to Altair and some Grammar of Graphics elements, starting with a simple scatter plot and bar charts
- ~10min: Growing the charts from static to interactive, connecting charts together
- ~5min: Taking a step back: what insights do we find in the data, and how can we improve our charts to communicate them more efficiently?
- ~3min: take-aways: it's worth learning to do better charts, Altair principles & data visualization best practices reminder.
Anne-Marie Tousch is a freelance data and machine learning consultant based in Paris. She holds a PhD in computer vision and has spent over a decade building production machine learning systems at Criteo, Datadog and a couple startups. She teaches data visualization to Master's students.