Area Chart

Gradient Mesh Area

Smooth gradient from edge to center.

Output
Gradient Mesh Area
Python
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LinearSegmentedColormap

# Data
x = np.linspace(0, 10, 100)
y = 5 + 3*np.sin(x) + np.sin(2*x)

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

# Create gradient mesh effect
cmap = LinearSegmentedColormap.from_list('neon', ['#ffffff', '#F5276C'], N=50)
for i in range(50):
    y_level = y * (i + 1) / 50
    ax.fill_between(x, 0, y_level, color=cmap(i/50), alpha=0.1)

ax.plot(x, y, color='#F5276C', linewidth=2.5)

# Styling
ax.set_xlabel('X', color='#1f2937', fontsize=11)
ax.set_ylabel('Y', color='#1f2937', fontsize=11)
ax.set_title('Gradient Mesh Area', 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(0, 10)
ax.set_ylim(0, 10)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support