Polar Chart

Nutrient Balance Radar

Daily nutrition intake visualization - light theme

Output
Nutrient Balance Radar
Python
import matplotlib.pyplot as plt
import numpy as np

nutrients = ['Protein', 'Carbs', 'Fat', 'Fiber', 'Vitamins', 'Minerals', 'Water']
daily_intake = [85, 72, 65, 58, 78, 70, 90]
recommended = [100, 100, 100, 100, 100, 100, 100]

daily_intake += daily_intake[:1]
recommended += recommended[:1]
angles = np.linspace(0, 2 * np.pi, len(nutrients), endpoint=False).tolist()
angles += angles[:1]

fig, ax = plt.subplots(figsize=(10, 10), subplot_kw=dict(polar=True), facecolor='#ffffff')
ax.set_facecolor('#ffffff')

ax.plot(angles, recommended, color='#e5e7eb', linewidth=2, linestyle='--', label='Recommended')
ax.plot(angles, daily_intake, color='#6CF527', linewidth=2.5, label='Your Intake')
ax.fill(angles, daily_intake, color='#6CF527', alpha=0.3)

ax.set_xticks(angles[:-1])
ax.set_xticklabels(nutrients, fontsize=10, color='#1f2937', fontweight='500')
ax.set_ylim(0, 110)
ax.set_yticks([25, 50, 75, 100])
ax.set_yticklabels(['25%', '50%', '75%', '100%'], fontsize=9, color='#374151')
ax.spines['polar'].set_color('#e5e7eb')
ax.grid(color='#e5e7eb', linewidth=0.8)
ax.legend(loc='upper right', bbox_to_anchor=(1.2, 1.1), fontsize=10)
ax.set_title('Nutrient Balance Radar', fontsize=16, color='#1f2937', fontweight='bold', pad=20, y=1.08)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Part-to-Whole

Did this help you?

Support PyLucid to keep it free & growing

Support