Area Chart
Network Bandwidth Usage
Upload and download bandwidth over 24 hours
Output
Python
import matplotlib.pyplot as plt
import numpy as np
np.random.seed(42)
hours = np.linspace(0, 24, 288) # 5-min intervals
# Traffic patterns
download = 50 + 40*np.sin(np.pi * (hours - 6)/12)**2 + np.random.normal(0, 8, len(hours))
download = np.clip(download, 0, 100)
upload = 20 + 15*np.sin(np.pi * (hours - 8)/10)**2 + np.random.normal(0, 5, len(hours))
upload = np.clip(upload, 0, 50)
fig, ax = plt.subplots(figsize=(10, 6), facecolor='#0a0a0f')
ax.set_facecolor('#0a0a0f')
# Mirror effect
ax.fill_between(hours, 0, download, alpha=0.6, color='#27D3F5', label='Download')
ax.fill_between(hours, 0, -upload, alpha=0.6, color='#F5276C', label='Upload')
ax.plot(hours, download, color='#27D3F5', linewidth=1.5)
ax.plot(hours, -upload, color='#F5276C', linewidth=1.5)
ax.axhline(0, color='#333333', linewidth=1)
# Capacity lines
ax.axhline(100, color='#6CF527', linewidth=1, linestyle='--', alpha=0.5)
ax.axhline(-50, color='#6CF527', linewidth=1, linestyle='--', alpha=0.5)
ax.set_xlabel('Hour', color='white', fontsize=11)
ax.set_ylabel('Mbps', color='white', fontsize=11)
ax.set_title('Network Bandwidth Utilization', color='white', fontsize=14, fontweight='bold', pad=15)
ax.tick_params(colors='#888888', labelsize=9)
ax.set_yticks([-50, -25, 0, 25, 50, 75, 100])
ax.set_yticklabels(['50', '25', '0', '25', '50', '75', '100'])
for spine in ax.spines.values():
spine.set_color('#333333')
ax.set_xlim(0, 24)
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
☕