Xkcd-Style Plots in Matplotlib (2012)
Update: the matplotlib pull request has been merged! See This post for a description of the XKCD functionality now built-in to matplotlib!
If you, like me, frequently commute via public transit, you may be familiar with the following situation:
Visit jakevdp.github.io → RSS feedOn Hacker News Aug 2013 – Apr 2019
Software Engineering 6Databases & Data 6Math & Algorithms 4Society, Policy & Culture 1Science & Space 1Programming Languages 1
Update: the matplotlib pull request has been merged! See This post for a description of the XKCD functionality now built-in to matplotlib!
When I teach courses on Python for scientific computing, I make this point very early in the course, and tell the students why: it boils down to Python being a dynamically typed, interpreted language, where values are stored not in dense buffers but in scattered objects. And then I talk about how to get around this by…
One of the most consistently popular posts on this blog has been my XKCDify post, where I followed in the footsteps of others to write a little hack for xkcd-style plotting in matplotlib. In it, I mentioned the Sketch Path Filter pull request that would eventually supersede my ugly little hack.
Edit 12/19/2017: added a new subsection on analyzing Chutes & Ladders as an Absorbing Markov Chain.
The Fast Fourier Transform (FFT) is one of the most important algorithms in signal processing and data analysis. I've used it for years, but having no formal computer science background, It occurred to me this week that I've never thought to ask how the FFT computes the discrete Fourier transform so quickly. I dusted…
Of all the programming styles I have learned, dynamic programming is perhaps the most beautiful. It can take problems that, at first glance, look ugly and intractable, and solve the problem with clean, concise code. Where a simplistic algorithm might accomplish something by brute force, dynamic programming steps back…