Rapidly emulating professional visualizations from New York Times in Python using Altair


The time and the effort required to make professional looking visualizations using JavaScript is massive and the learning curve can be quite steep for D3 and JavaScript itself, not to mention verbose code even for something simple. Being able to do interactive, explorative and aesthetic visualizations in a declarative fashion using Python by following the grammar of graphics paradigm - visualization concepts should map directly to visualization implementation - with just a few lines of code is such an enabler that it will lead more and more people to rethink visualization and get immediate results from the data and value for their time.


In this hands-on talk we visualize a publicly available, spatial dataset using Altair. Starting gradually from an example to see the declarative pattern in action to a geospatial chloropleth map to a layered chart with circle markers and finally to showing spikes that impart it a 3D touch. However, getting custom shapes to show on charts is not well documented. Moreover, by default the markers increase in area (based on the quantity of data it represents) which is not what we want. So by using techniques that are not well documented the audience will learn how to make an interactive geospatial graph which is also being actively used by The New York Times and The Economist’s graphics teams for their covid visualizations and which has been received very well by the data visualization community.

Shantam Raj
Engineer, Speaker, Poet