3D Trisurf

Seismic Wave Propagation

Simulated seismic wave amplitude decay from epicenter in coral-cyan gradient.

Output
Seismic Wave Propagation
Python
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LinearSegmentedColormap

# Scattered seismic stations
np.random.seed(99)
n_points = 600
x = np.random.uniform(-5, 5, n_points)
y = np.random.uniform(-5, 5, n_points)

# Epicenter at origin, wave propagation
r = np.sqrt(x**2 + y**2)
t = 2.0  # snapshot time
wave_speed = 3.0
z = np.sin(2*np.pi*(r - wave_speed*t)) * np.exp(-0.3*r) * (r > 0.5)

# Custom colormap
colors = ['#0a0a0f', '#4a1942', '#F5276C', '#27D3F5', '#67e8f9']
cmap = LinearSegmentedColormap.from_list('coral_cyan', colors, N=256)

fig = plt.figure(figsize=(10, 8), facecolor='#0a0a0f')
ax = fig.add_subplot(111, projection='3d', facecolor='#0a0a0f')

surf = ax.plot_trisurf(x, y, z, cmap=cmap, alpha=0.9, linewidth=0.1, edgecolor='#ffffff08')

ax.set_xlabel('X (km)', fontsize=10, color='#94a3b8', labelpad=10)
ax.set_ylabel('Y (km)', fontsize=10, color='#94a3b8', labelpad=10)
ax.set_zlabel('Amplitude', fontsize=10, color='#94a3b8', labelpad=10)
ax.set_title("Seismic Wave Propagation", fontsize=14, color='white', fontweight='bold', pad=20)

ax.tick_params(colors='#64748b', labelsize=8)
ax.xaxis.pane.fill = False
ax.yaxis.pane.fill = False
ax.zaxis.pane.fill = False
ax.xaxis.pane.set_edgecolor('#1e293b')
ax.yaxis.pane.set_edgecolor('#1e293b')
ax.zaxis.pane.set_edgecolor('#1e293b')

ax.view_init(elev=30, azim=135)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support