Area Chart

Audio Waveform Area

Symmetric audio-style visualization.

Output
Audio Waveform Area
Python
import matplotlib.pyplot as plt
import numpy as np

# Data - Simulated audio waveform
np.random.seed(42)
t = np.linspace(0, 2, 2000)
freq1, freq2, freq3 = 440, 880, 220
envelope = np.exp(-t * 0.5) * (1 + 0.3 * np.sin(t * 5))
waveform = envelope * (0.5 * np.sin(2 * np.pi * freq1 * t) + 
                        0.3 * np.sin(2 * np.pi * freq2 * t) +
                        0.2 * np.sin(2 * np.pi * freq3 * t))

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

# Symmetric waveform
ax.fill_between(t, 0, waveform, where=(waveform >= 0), alpha=0.6, color='#27D3F5')
ax.fill_between(t, 0, waveform, where=(waveform < 0), alpha=0.6, color='#F5276C')
ax.plot(t, waveform, color='white', linewidth=0.3, alpha=0.5)

# Center line
ax.axhline(0, color='#333333', linewidth=0.5)

# Styling
ax.set_xlabel('Time (s)', color='white', fontsize=11)
ax.set_ylabel('Amplitude', color='white', fontsize=11)
ax.set_title('Audio Waveform Visualization', 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.set_xlim(0, 2)
ax.set_ylim(-1.2, 1.2)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support