Sunburst Chart

Software Architecture Layers

Dark-themed sunburst chart showing software architecture from presentation layer through business logic to data layer.

Output
Software Architecture Layers
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 - Architecture layers
layer_sizes = [30, 40, 30]
layer_labels = ['Presentation', 'Business Logic', 'Data Layer']
layer_colors = ['#5314E6', '#27D3F5', '#6CF527']

# Outer ring - Components
comp_sizes = [10, 10, 10, 15, 15, 10, 12, 10, 8]
comp_colors = ['#5314E6', '#7B4DFF', '#9C7AFF',
               '#27D3F5', '#5CE8FF', '#8CF2FF',
               '#6CF527', '#8FFF5C', '#B2FF8C']

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

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

# Add layer labels
for i, (wedge, label) in enumerate(zip(wedges_inner, layer_labels)):
    ang = (wedge.theta2 - wedge.theta1) / 2 + wedge.theta1
    x = 0.52 * np.cos(np.radians(ang))
    y = 0.52 * np.sin(np.radians(ang))
    # Rotate text to follow the arc
    rotation = ang - 90 if ang < 180 else ang + 90
    ax.text(x, y, label, ha='center', va='center', fontsize=9, 
            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, 'Platform\nv3.0', ha='center', va='center',
        fontsize=14, color='white', fontweight='bold')

# Legend
comp_labels = ['Web UI', 'Mobile', 'REST API', 'Services', 'Workflows', 
               'Rules Engine', 'PostgreSQL', 'Redis', 'S3']
ax.legend(wedges_outer, comp_labels, loc='center left', bbox_to_anchor=(1.05, 0.5),
          fontsize=9, frameon=True, facecolor='#1e293b', edgecolor='#334155',
          labelcolor='white', title='Components', title_fontsize=10)

ax.set_title('Software Architecture', 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