Pie Chart
Food Consumption Breakdown
Dark theme pie chart showing daily food group consumption
Output
Python
import matplotlib.pyplot as plt
import numpy as np
fig, ax = plt.subplots(figsize=(10, 6), facecolor='#0a0a0f')
ax.set_facecolor('#0a0a0f')
food_groups = ['Carbs', 'Protein', 'Vegetables', 'Fruits', 'Dairy', 'Fats']
consumption = [30, 25, 20, 12, 8, 5]
colors = ['#fcd34d', '#f87171', '#4ade80', '#fb923c', '#60a5fa', '#a78bfa']
explode = (0.02, 0.02, 0.02, 0.02, 0.02, 0.02)
wedges, texts, autotexts = ax.pie(consumption, labels=food_groups, autopct='%1.0f%%',
colors=colors, explode=explode, startangle=45,
wedgeprops={'edgecolor': '#0a0a0f', 'linewidth': 2})
for text in texts:
text.set_color('white')
text.set_fontsize(10)
for autotext in autotexts:
autotext.set_color('#0a0a0f')
autotext.set_fontweight('bold')
ax.set_title('Daily Food Consumption', fontsize=16, fontweight='bold', color='white', pad=20)
plt.tight_layout()
Library
Matplotlib
Category
Basic Charts
More Pie Chart examples
☕