Pi City

Data visualizers Martin Krzywinski and Jake Lever map city centers for an annual Pi Day art exploration

Martin Krzywinski and Jake Lever

This article was published in Scientific American’s former blog network and reflects the views of the author, not necessarily those of Scientific American


Starting with a data set of all the world’s roads (courtesy of Open Street Map), Martin Krzywinski and Jake Lever zoomed into 44 city centers and the lines that define them for data art in celebration of Pi Day, 2018.

Each road was broken into “polylines”; segments between intersections or an intersection and the road’s end. These polylines form the basis for the calculations and tiling to follow, resulting in two assemblage styles: city strips and world patches.

As Krzywinski describes:


On supporting science journalism

If you're enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.



“City strips were created by sampling patches of 0.015 × 0.015 degrees (after transformation). This corresponds roughly to 1.7 kilometers. For each position in the strip, patches were sampled in order of the digits of π only if the number of polylines in the patch was 40d≤N<40(d+1)−1, where d is the digit of π. Patches for d=9 only need to have 360≤N polylines. For example, the first patch is assigned to d=3 and it must have 120≤N<159 polylines. The second patch is sampled so that its density is 40≤N<79 because it is associated with the next digit, d=1. Further selection on acceptable patches is performed so the streets line up with the previous patch. Minor local adjustments and stitching are performed so the join appears seamless.”

Roads of 10 Digits of Pi (3.141592653); From top to bottom: Moscow, Mumbai, Nairobi, New Delhi, Nice, Prague, Rome, Stockholm, Vancouver, Warsaw. Credit: Martin Krzywinski and Jake Lever

The world patch series steps up in complexity, mapping out 36 digits of pi in two dimensions, sampling from more than one city. (For more details, see Krzywinski’s explanatory post).

Roads of 36 Digits of Pi (3.14159265358979323846264338327950288); Featuring Amsterdam, Doha, Marrakech, Mumbai, Nairobi, Rome, San Francisco, Seoul, Shanghai and Vancouver. Credit: Martin Krzywinski and Jake Lever


Although intellectually I’m drawn to the idea and the complexity of the global world patch mash-up, I find the city strips to be more satisfying. With district horizontal panels, my eye has a clear path, and I can see the pi pattern play out in road density. The apparent pattern is then reinforced by the next city row and the next, each with a distinctive city road structure—from the grid of Vancouver to the gestural lines of Nice.


For more pi-inspired art, see “Pi in the Sky,”“The Boundless Beauty of Pi,” and “The Gravity of Pi.”

Jen Christiansen is an information designer, visual science communicator and author of the book Building Science Graphics: An Illustrated Guide to Communicating Science through Diagrams and Visualizations. She began her publishing career in New York City at Scientific American, moved to Washington, D.C., to join the art department of National Geographic, spent four years as a freelance science communicator and then returned to Scientific American for a second stint, during which she became the magazine’s first graphics-specific art director. In that role, she established a consistent data visualization and diagram philosophy across all articles. She writes and presents on topics ranging from reconciling her love for art and science to her quest to learn more about the pulsar chart on Joy Division’s Unknown Pleasures album cover. Her work can be viewed at www.jenchristiansen.com

More by Jen Christiansen

Subscribe to Support Independent Journalism

Great science journalism requires human expertise, time, effort and creativity. And it costs money. That’s why I and the journalists here at Scientific American hope you’ll join our community.

When you subscribe, you are supporting staff and freelance journalists who are passionate about telling science stories that are true, important and compelling. Our editors and reporters are often experts in their fields, which means they understand the nuances of big discoveries and can untangle the breakthroughs from the hype. With a subscription, you are also supporting rigorous fact-checking to ensure the words we publish are precise and accurate. And you’re supporting original illustrations, graphics and photos that bring you closer to an advanced laboratory, an ice sheet in Antarctica or a space mission in orbit. You’re helping us craft other types of high-quality journalism as well: Our newsletters are carefully written, edited and curated by staffers you have or will come to know and love. Our Science Quickly podcast is based on original reporting, collaboration with editors and scientists and exacting production.

Subscriptions keep this engine running so we can continue to deliver thoughtful, rigorous and independent science journalism to you. In an era of viral misinformation, this work is crucial. If you value what we do, I hope you’ll consider joining us as a subscriber

Thank you,

Jeanna Bryner, Editor in Chief, Scientific American

Subscribe