ARTICLE AD BOX
€1,600 per second. That’s really overmuch liking Germany has to salary for its debts. In total, nan German authorities has debts ranging into nan trillions — much than a 1000 cardinal Euros. And nan authorities is readying to make moreover more, up to 1 trillion further indebtedness is rumored to travel complete nan adjacent 10 years.
The numbers progressive successful governmental finances are truthful immense that 1 astir apt cannot realistically measure conscionable really overmuch moreover 1 cardinal Euro aliases Dollar are.
In this article, I show that accepted lists and Charts neglect to convey a consciousness of conscionable really overmuch money is astatine liking erstwhile it comes to governmental spending. I past show really a small spot of programming tin interactively visualize this money and really it relates to different numbers. I will usage Germany arsenic an example, arsenic it presently receives a batch of media sum and its indebtedness statistic are freely available.
Plain enumeration
To start, we’ll usage plain enumeration of nan cardinal facts arsenic nan first method to (not) put accusation into relation. It excludes family debts. As we’ll later see, this elemental method utterly fails compared to nan visualization devices provided done elemental scripts.
- €1,600: liking complaint per second
- €25,503: indebtedness per German national if authorities indebtedness is split
And here’s already a ample jump for us. We are straight jumping into nan billions:
- €49,5 billion: liking complaint per year
- €100 billion: Sondervermögen (euphemism for debt) for German Army
- €500 billion: planned further indebtedness for infrastructure
Now, we are making different jump:
- €2,11 trillion: full German governmental indebtedness (as of March 2025)
After reference these numbers, we mightiness cognize a spot much astir Germany’s debt. But we hardly person an knowing of really they subordinate to each other. Yes, we cognize that €1 cardinal is simply a 1000 times €1 million. But that’s conscionable communal sense.
We would astir apt fare amended if we could spot nan numbers visualized broadside by side. That’s what we will do next.
Linearly scaled charts
Using python and nan Matplotlib plotting library, it is straightforward to create a elemental chart. (Complete codification is linked successful this article’s Resource conception astatine nan end).
I picked 4 numbers to visualize together: €1,600 (because astir group cognize just really overmuch already that is), €25,503 (because it nicely shows nan hidden indebtedness that immoderate German has), €1 cardinal (because that’s a very ample sum, thing that ample companies don’t moreover make per year), and, yet €49,5 cardinal (because that’s really overmuch Germany presently needs to walk conscionable successful liking per twelvemonth which is much than most countries’ GDP).
import matplotlib.pyplot arsenic plt # Data amounts = [1600, 25503, 1e9, 49.5e9, ] labels = ['Per-sec. interest', 'Per-person debt','€1 billion', 'Yearly interest'] plt.figure(figsize=(10, 6)) plt.bar(labels, amounts, color=['orange', 'orange', '#03A9F4', '#ff0000'])After moving this code, we get nan pursuing plot:

What we spot successful an instant: we don’t spot nan mini money. The immense amounts wholly dwarf nan €1,600. I’d wager to opportunity that anybody reference this has much relationship to conscionable €1,000 than to, say, €1 million. We cognize what €1,000 could spend us. A mates of €1,000 is simply a bully monthly income for astir people.
But nan floor plan does not moreover admit it.
Is nan correction that I utilized linearly scaled axes? Let’s spot next.
Logarithmically scaled charts
In visualizing nan information logarithmically, we’ll instrumentality to python and matplotlib. We simply request to adhd a azygous statement of codification and straight get an updated chart:

Is it better? To immoderate extent, yes! We tin now statesman to spot nan quality betwixt mundane amounts (like nan €1,600 liking per second) and nan planned spending (i.e., debt).
Thanks to nan logarithmic scaling, they look connected nan aforesaid chart. In this visualization, nan floor plan does not turn linearly, but logarithmically. This intends that nan spacing betwixt 2 markers connected nan y-axis does not correspond a fixed, adjacent increment (like earlier successful nan linearly scaled plot). Instead, each measurement represents a multiplication by a changeless factor. In our plot, nan spacing is wished by multiplying pinch 100 (or, adding 2 trailing zeros).
For our purpose: is specified logarithmic scaling amended than linear scaling? Yes, definitely.
But, is it sufficient? Can we not do amended successful trying to convey what Germany’s up to erstwhile it plans for €500 cardinal of further debt? And, really does this indebtedness subordinate to other, already existing debts?
Yes, of people we can. Using a small spot of HTML, JavaScript, and immoderate CSS styling, we tin quickly create a elemental interactive webpage. For a beginner it’s easy doable complete a weekend.
A fixed webpage is each it needs!
Data scientists and programmers wrangle pinch information day-in, day-out. Tools for illustration Excel and python scripts thief them pinch transforming nan information to summation insights.
Sometimes, however, a elemental webpage tin convey nan narration betwixt numbers better. Especially erstwhile we are talking astir nan immense sums progressive successful governmental debts.
We commencement our visualization successful HTML, by stacking a fewer div-elements connected apical of each other:
... <div class="debt-wrapper"> <h2 class="debt-title">€25,503 (Debt per German national <em>if full governmental indebtedness is divided </em>)</h2> <div class="debt one-thousand" data-height="25503"></div> </div> <div class="debt-wrapper"> <h2 class="debt-title">€1 billion</h2> <div class="debt billion" data-height="1000000000"></div> </div> <div class="debt-wrapper" id="interest-year"> <div class="debt-header"> <h2 class="debt-title">€49,5 cardinal (German liking per year)</h2> </div> <div class="debt ruler" data-height="49500000000"></div> </div> ...For each section, we bespeak nan magnitude successful € successful an HTML attribute.
Next, we will usage JavaScript to toggle shape nan amounts into an easy-to-grasp-visualization.
For this, we specify that each pixel represents €1,000. By utilizing rectangular forms, we tin frankincense correspond immoderate magnitude of money:
document.addEventListener("DOMContentLoaded", function() { const wealthBars = document.querySelectorAll(".debt"); wealthBars.forEach(bar => { if (!bar.dataset.scaled) { const magnitude = parseInt(bar.dataset.height) / 1000; const width = Math.min(Math.sqrt(amount), 200); // Cap nan width pixels const tallness = magnitude / width; bar.style.width = width + "px"; bar.style.height = tallness + "px"; bar.dataset.scaled = "true";Lastly, we adhd immoderate CSS styling to make nan rendered webpage look well:
.debt-wrapper { display: flex; flex-direction: column; align-items: center; margin: 20px 0; } .debt-title { font-size: 20px; margin-bottom: 10px; } /* Debt Bars */ .debt { position: relative; transition: tallness 0.3s ease-out, width 0.3s ease-out; background-color: #ffcc00; max-width: 200px; /* Maximum width for bars */ }Putting each of this together (find nan afloat root codification successful nan Resources conception below), we get nan pursuing (I added further cardinal numbers that I considered applicable successful putting nan German indebtedness into proportion):

Now, that is an easy to understand visualization! You tin research it yourself here: https://phrasenmaeher.github.io.
This elemental webpage much accurately represents nan immense magnitude of caller indebtedness that Germany wants to make. Using basal Programming skills, we show really nan indebtedness relates to mundane sums (like €1,600) and existing debt-related costs (like nan €49,5 cardinal liking per year). Just commencement scrolling down, and you get a consciousness of really overmuch money it is. In nan supra GIF, we person not moreover scrolled 1% of nan full measurement down (look astatine nan scroll barroom to nan right, it hardly moves).
Recall that 1 pixel equals €1,000. Even if you are earning €10,000 per month, that’s simply 10 pixels, which is hardly noticeable successful nan indebtedness bars. If you scroll conscionable 1 pixel down, you person uncovered €200,000 of caller indebtedness (with nan default barroom width of 200). Even if you make €1 cardinal (per year), that’s conscionable a specified scrolling of 5 pixels. However overmuch money you make, nan visualization demonstrates: it’s virtually a driblet successful nan indebtedness ocean.
If you are German, I don’t consciousness envy, particularly not for nan upcoming generations: personification has to salary this back. In summation to existing debts.
Resources
- Interactive webpage: https://phrasenmaeher.github.io/
- All codification (Python, HTML, JavaScript, CSS): https://github.com/phrasenmaeher/german-debt
- Sources for nan numbers: https://github.com/phrasenmaeher/german-debt?tab=readme-ov-file#select-sources