Pie Chart

Coffee Consumption Types

Light theme donut showing coffee drink preferences

Output
Coffee Consumption Types
Python
import matplotlib.pyplot as plt
import numpy as np

fig, ax = plt.subplots(figsize=(10, 6), facecolor='#ffffff')
ax.set_facecolor('#ffffff')

drinks = ['Espresso', 'Latte', 'Cappuccino', 'Americano', 'Cold Brew', 'Mocha']
preference = [20, 28, 18, 15, 12, 7]
colors = ['#78350f', '#92400e', '#a16207', '#ca8a04', '#eab308', '#facc15']

wedges, texts, autotexts = ax.pie(preference, labels=drinks, autopct='%1.0f%%',
                                   colors=colors, startangle=90,
                                   wedgeprops={'width': 0.55, 'edgecolor': 'white', 'linewidth': 2})

for text in texts:
    text.set_color('#1f2937')
    text.set_fontsize(10)
for autotext in autotexts:
    autotext.set_color('white')
    autotext.set_fontweight('bold')

centre_circle = plt.Circle((0, 0), 0.35, fc='#ffffff')
ax.add_patch(centre_circle)
ax.text(0, 0, 'Coffee', ha='center', va='center', fontsize=14, fontweight='bold', color='#78350f')

ax.set_title('Coffee Consumption by Type', fontsize=16, fontweight='bold', color='#1f2937', pad=20)
plt.tight_layout()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support