Treemap
Cryptocurrency Portfolio Holdings
Dark-themed treemap showing cryptocurrency portfolio distribution across different tokens and blockchain ecosystems.
Output
Python
import matplotlib.pyplot as plt
import squarify
import numpy as np
# Crypto holdings (in USD)
labels = ['Bitcoin', 'Ethereum', 'Solana', 'Cardano', 'Polygon',
'Avalanche', 'Chainlink', 'Uniswap', 'Stablecoins', 'Other Alts']
sizes = [45000, 28000, 8500, 4200, 5800, 3500, 2800, 1900, 12000, 3300]
total = sum(sizes)
# CLAUDE.md colors - crypto themed
colors = ['#F5B027', '#5314E6', '#27F5B0', '#276CF5', '#F5276C',
'#C82909', '#27D3F5', '#F527B0', '#6CF527', '#F54927']
fig, ax = plt.subplots(figsize=(12, 8), facecolor='#0a0a0f')
ax.set_facecolor('#0a0a0f')
pct = [s/total*100 for s in sizes]
squarify.plot(sizes=sizes,
label=[f'{l}\n${s/1000:.1f}K ({p:.1f}%)' for l, s, p in zip(labels, sizes, pct)],
color=colors, alpha=0.85, ax=ax,
text_kwargs={'fontsize': 9, 'color': 'white', 'fontweight': 'bold'})
ax.axis('off')
ax.set_title(f'Crypto Portfolio - ${total/1000:.0f}K Total',
fontsize=18, color='#f8fafc', fontweight='bold', pad=20)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Part-to-Whole
☕