Area Chart

Percentage Stacked Area

100% stacked area showing device distribution.

Output
Percentage Stacked Area
Python
import matplotlib.pyplot as plt
import numpy as np

# Data - Device market share
years = np.arange(2018, 2026)
mobile = np.array([45, 48, 52, 55, 58, 60, 62, 64])
desktop = np.array([40, 38, 35, 32, 30, 28, 26, 25])
tablet = np.array([15, 14, 13, 13, 12, 12, 12, 11])

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

# 100% stacked with NEON colors
ax.stackplot(years, mobile, desktop, tablet, 
             colors=['#F5276C', '#27D3F5', '#6CF527'],
             labels=['Mobile', 'Desktop', 'Tablet'], alpha=0.85)

# Styling
ax.set_xlabel('Year', color='#1f2937', fontsize=11)
ax.set_ylabel('Market Share (%)', color='#1f2937', fontsize=11)
ax.set_title('Device Usage Distribution', color='#1f2937', fontsize=14, fontweight='bold', pad=15)
ax.tick_params(colors='#374151', labelsize=9)
for spine in ax.spines.values():
    spine.set_color('#e5e7eb')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.set_xlim(2018, 2025)
ax.set_ylim(0, 100)
ax.legend(loc='upper right', 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