Area Chart
Traffic Sources
Website traffic by channel over time.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
# Data - Website traffic sources
months = np.arange(1, 13)
organic = [1200, 1350, 1500, 1700, 1900, 2100, 2300, 2200, 2000, 1800, 1500, 1400]
direct = [800, 850, 900, 950, 1000, 1100, 1150, 1100, 1050, 950, 900, 850]
social = [400, 500, 650, 800, 950, 1100, 1200, 1150, 1000, 850, 600, 500]
referral = [300, 320, 350, 380, 420, 460, 500, 480, 440, 400, 350, 320]
# Figure - DARK THEME
fig, ax = plt.subplots(figsize=(10, 6), facecolor='#0a0a0f')
ax.set_facecolor('#0a0a0f')
# Stacked area with NEON colors
ax.stackplot(months, organic, direct, social, referral,
labels=['Organic', 'Direct', 'Social', 'Referral'],
colors=['#6CF527', '#27D3F5', '#F5276C', '#F5B027'], alpha=0.8)
# Styling
ax.set_xlabel('Month', color='white', fontsize=11)
ax.set_ylabel('Sessions', color='white', fontsize=11)
ax.set_title('Website Traffic by Source', color='white', fontsize=14, fontweight='bold', pad=15)
ax.tick_params(colors='#888888', labelsize=9)
ax.set_xticks(months)
ax.set_xticklabels(['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'])
for spine in ax.spines.values():
spine.set_color('#333333')
ax.yaxis.grid(True, color='#1a1a2e', linewidth=0.5)
ax.set_xlim(1, 12)
ax.legend(facecolor='#0a0a0f', edgecolor='#333333', labelcolor='white', loc='upper right')
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Basic Charts
More Area Chart examples
☕