Pie Chart

E-commerce Sales Categories

Dark theme donut showing online shopping category distribution

Output
E-commerce Sales Categories
Python
import matplotlib.pyplot as plt
import numpy as np

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

categories = ['Electronics', 'Fashion', 'Home & Garden', 'Beauty', 'Sports', 'Books']
sales = [28, 24, 18, 14, 10, 6]
colors = ['#f59e0b', '#fbbf24', '#fcd34d', '#fde68a', '#fef3c7', '#fffbeb']

wedges, texts, autotexts = ax.pie(sales, labels=categories, autopct='%1.1f%%',
                                   colors=colors, startangle=90,
                                   wedgeprops={'width': 0.5, '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('E-commerce Sales by Category', fontsize=16, fontweight='bold', color='white', pad=20)
plt.tight_layout()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support