Visualizing the filesystem tree using a polar bar
We want to show in this recipe how to solve a "real-world" task—how to use matplotlib to visualize our directory occupancy.
In this recipe, you will learn how to visualize a filesystem tree with relative sizes.
Getting ready
We all have big hard drives that sometimes contain stuff that we usually forget about. It would be nice to see what is inside such a directory, and what the biggest file inside it is.
Although there are many more sophisticated and elaborate software products for this job, we want to demonstrate how this is achievable using Python and matplotlib.
How to do it...
Let's perform the following steps:
- Implement a few helper functions to deal with folder discovery and internal data structures. ...
Get Python Data Visualization Cookbook - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.