Sunburst Chart
Hospital Organization Structure
Light-themed sunburst chart showing hospital organizational hierarchy from administration to departments to units.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
fig, ax = plt.subplots(figsize=(12, 10), facecolor='#ffffff')
ax.set_facecolor('#ffffff')
# Inner ring - Divisions
div_sizes = [35, 30, 20, 15]
div_labels = ['Clinical', 'Nursing', 'Admin', 'Support']
div_colors = ['#276CF5', '#6CF527', '#F5B027', '#5314E6']
# Outer ring - Departments
dept_sizes = [12, 12, 11, 10, 10, 10, 10, 10, 8, 7]
dept_colors = ['#276CF5', '#4A8CFF', '#6BA3FF',
'#6CF527', '#8FFF5C', '#B2FF8C',
'#F5B027', '#FFCC5C',
'#5314E6', '#7B4DFF']
wedges_outer, _ = ax.pie(dept_sizes, radius=1, colors=dept_colors,
wedgeprops=dict(width=0.3, edgecolor='white', linewidth=2))
wedges_inner, _ = ax.pie(div_sizes, radius=0.7, colors=div_colors,
wedgeprops=dict(width=0.3, edgecolor='white', linewidth=2))
# Add division labels
for i, (wedge, label) in enumerate(zip(wedges_inner, div_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=11,
color='white', fontweight='bold')
centre_circle = plt.Circle((0, 0), 0.4, fc='white', ec='#e5e7eb', linewidth=2)
ax.add_artist(centre_circle)
ax.text(0, 0, 'Hospital\n1,200 Staff', ha='center', va='center',
fontsize=12, color='#1f2937', fontweight='bold')
# Legend
dept_labels = ['Surgery', 'Medicine', 'Emergency', 'ICU Nursing', 'Ward Care',
'Outpatient', 'HR', 'Finance', 'Facilities', 'IT']
ax.legend(wedges_outer, dept_labels, loc='center left', bbox_to_anchor=(1.05, 0.5),
fontsize=9, frameon=True, facecolor='white', edgecolor='#e5e7eb',
labelcolor='#374151', title='Departments', title_fontsize=10)
ax.set_title('Hospital Organization', fontsize=18, color='#1f2937',
fontweight='bold', pad=20)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Part-to-Whole
More Sunburst Chart examples
☕