Area Chart

Year Comparison Area

Overlapping areas comparing yearly data.

Output
Year Comparison Area
Python
import matplotlib.pyplot as plt
import numpy as np

# Data
months = np.arange(1, 13)
year_2023 = [45, 52, 68, 85, 95, 110, 125, 118, 98, 78, 55, 48]
year_2024 = [50, 58, 75, 92, 105, 122, 138, 130, 108, 85, 62, 55]
year_2025 = [55, 65, 82, 100, 115, 135, 150, 142, 118, 92, 68, 60]

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

# Stacked comparison with NEON colors
ax.fill_between(months, 0, year_2023, alpha=0.4, color='#4927F5', label='2023')
ax.fill_between(months, 0, year_2024, alpha=0.4, color='#27D3F5', label='2024')
ax.fill_between(months, 0, year_2025, alpha=0.4, color='#6CF527', label='2025')
ax.plot(months, year_2023, color='#4927F5', linewidth=2)
ax.plot(months, year_2024, color='#27D3F5', linewidth=2)
ax.plot(months, year_2025, color='#6CF527', linewidth=2)

# Styling
ax.set_xlabel('Month', color='#1f2937', fontsize=11)
ax.set_ylabel('Revenue ($K)', color='#1f2937', fontsize=11)
ax.set_title('Annual Revenue Comparison', color='#1f2937', fontsize=14, fontweight='bold', pad=15)
ax.tick_params(colors='#374151', 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('#e5e7eb')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.yaxis.grid(True, color='#f3f4f6', linewidth=0.5)
ax.legend(facecolor='#ffffff', edgecolor='#e5e7eb', labelcolor='#1f2937')

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support