Polar Chart
Sleep Cycle Distribution
Hourly sleep quality pattern with smooth curves - light theme
Output
Python
import matplotlib.pyplot as plt
import numpy as np
hours = list(range(24))
# Sleep quality peaks during night hours
quality = [85, 90, 95, 92, 88, 75, 40, 20, 15, 12, 15, 20, 25, 20, 18, 22, 30, 35, 45, 55, 65, 70, 75, 80]
angles = np.linspace(0, 2 * np.pi, 24, endpoint=False)
quality_closed = quality + [quality[0]]
angles_closed = np.append(angles, angles[0])
fig, ax = plt.subplots(figsize=(10, 10), subplot_kw=dict(polar=True), facecolor='#ffffff')
ax.set_facecolor('#ffffff')
ax.plot(angles_closed, quality_closed, color='#4927F5', linewidth=2.5)
ax.fill(angles_closed, quality_closed, color='#4927F5', alpha=0.3)
ax.set_xticks(angles[::3])
ax.set_xticklabels([f'{h}:00' for h in range(0, 24, 3)], fontsize=10, color='#1f2937', fontweight='500')
ax.set_ylim(0, 100)
ax.set_yticks([25, 50, 75, 100])
ax.set_yticklabels(['', '', '', ''], fontsize=9)
ax.spines['polar'].set_color('#e5e7eb')
ax.grid(color='#e5e7eb', linewidth=0.8)
ax.set_title('Sleep Cycle Distribution', fontsize=16, color='#1f2937', fontweight='bold', pad=20, y=1.08)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Part-to-Whole
More Polar Chart examples
☕