Pie Chart

Website Traffic Sources

Light theme donut with legend showing website traffic acquisition channels

Output
Website Traffic Sources
Python
import matplotlib.pyplot as plt
import numpy as np

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

sources = ['Organic Search', 'Direct', 'Social Media', 'Referral', 'Email', 'Paid Ads']
traffic = [40, 22, 15, 10, 8, 5]
colors = ['#0284c7', '#0369a1', '#075985', '#0c4a6e', '#164e63', '#1e3a5f']

wedges, texts, autotexts = ax.pie(traffic, autopct='%1.1f%%',
                                   colors=colors, startangle=90,
                                   wedgeprops={'width': 0.5, 'edgecolor': 'white', 'linewidth': 2})

for autotext in autotexts:
    autotext.set_color('white')
    autotext.set_fontweight('bold')
    autotext.set_fontsize(9)

ax.legend(wedges, sources, title='Traffic Sources', loc='center left', 
          bbox_to_anchor=(1, 0.5), fontsize=10)

ax.set_title('Website Traffic Sources', 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