Area Chart

Energy Mix Evolution

100% stacked showing renewable transition.

Output
Energy Mix Evolution
Python
import matplotlib.pyplot as plt
import numpy as np

# Data - Energy sources over time
years = np.arange(2010, 2031)
fossil = [80, 78, 76, 74, 72, 68, 65, 62, 58, 54, 50, 46, 42, 38, 34, 30, 27, 24, 21, 18, 15]
nuclear = [12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]
renewable = [8, 10, 12, 14, 16, 20, 23, 27, 31, 35, 40, 44, 48, 52, 56, 60, 63, 66, 69, 72, 75]

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

# 100% stacked area with NEON colors
ax.stackplot(years, fossil, nuclear, renewable,
             labels=['Fossil Fuels', 'Nuclear', 'Renewable'],
             colors=['#9C2007', '#F5B027', '#6CF527'], alpha=0.85)

# Styling
ax.set_xlabel('Year', color='white', fontsize=11)
ax.set_ylabel('Energy Mix (%)', color='white', fontsize=11)
ax.set_title('Global Energy Transition Scenario', color='white', fontsize=14, fontweight='bold', pad=15)
ax.tick_params(colors='#888888', labelsize=9)
for spine in ax.spines.values():
    spine.set_color('#333333')
ax.yaxis.grid(True, color='#1a1a2e', linewidth=0.5)
ax.set_xlim(2010, 2030)
ax.set_ylim(0, 100)
ax.legend(facecolor='#0a0a0f', edgecolor='#333333', labelcolor='white', loc='center right')

# 2024 marker
ax.axvline(2024, color='#27D3F5', linewidth=1.5, linestyle='--', alpha=0.7)
ax.text(2024.5, 95, '2024', color='#27D3F5', fontsize=9)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support