Sunburst Chart

Cloud Storage Bucket Hierarchy

Dark-themed sunburst chart showing cloud storage organization from account level to buckets to object prefixes.

Output
Cloud Storage Bucket Hierarchy
Python
import matplotlib.pyplot as plt
import numpy as np

fig, ax = plt.subplots(figsize=(12, 10), facecolor='#0a0a0f')
ax.set_facecolor('#0a0a0f')

# Inner ring - Buckets
bucket_sizes = [30, 25, 25, 20]
bucket_labels = ['prod-data', 'analytics', 'backups', 'staging']
bucket_colors = ['#F5276C', '#27D3F5', '#6CF527', '#F5B027']

# Outer ring - Prefixes
prefix_sizes = [12, 10, 8, 10, 8, 7, 12, 8, 5, 10, 6, 4]
prefix_colors = ['#F5276C', '#FF5A94', '#C21F56',
                 '#27D3F5', '#5CE8FF', '#1A9FBA',
                 '#6CF527', '#8FFF5C', '#4DB31F',
                 '#F5B027', '#FFCC5C', '#C28A1F']

wedges_outer, _ = ax.pie(prefix_sizes, radius=1, colors=prefix_colors,
       wedgeprops=dict(width=0.3, edgecolor='#0a0a0f', linewidth=2))

wedges_inner, _ = ax.pie(bucket_sizes, radius=0.7, colors=bucket_colors,
       wedgeprops=dict(width=0.3, edgecolor='#0a0a0f', linewidth=2))

# Add bucket labels
for i, (wedge, label) in enumerate(zip(wedges_inner, bucket_labels)):
    ang = (wedge.theta2 - wedge.theta1) / 2 + wedge.theta1
    x = 0.55 * np.cos(np.radians(ang))
    y = 0.55 * np.sin(np.radians(ang))
    ax.text(x, y, label, ha='center', va='center', fontsize=10, 
            color='white', fontweight='bold')

centre_circle = plt.Circle((0, 0), 0.4, fc='#0a0a0f', ec='#334155', linewidth=2)
ax.add_artist(centre_circle)
ax.text(0, 0, 'S3 Account\n2.4 PB', ha='center', va='center',
        fontsize=12, color='white', fontweight='bold')

# Legend
prefix_labels = ['users/', 'logs/', 'media/', 'raw/', 'processed/', 'reports/',
                 'daily/', 'weekly/', 'archive/', 'dev/', 'test/', 'temp/']
ax.legend(wedges_outer, prefix_labels, loc='center left', bbox_to_anchor=(1.05, 0.5),
          fontsize=9, frameon=True, facecolor='#1e293b', edgecolor='#334155',
          labelcolor='white', title='Prefixes', title_fontsize=10)

ax.set_title('Cloud Storage Hierarchy', fontsize=18, color='#f8fafc',
             fontweight='bold', pad=20)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Part-to-Whole

Did this help you?

Support PyLucid to keep it free & growing

Support