3D Fill Between

3D Wave Interference Pattern

3D visualization of wave interference showing constructive and destructive patterns with neon gradient.

Output
3D Wave Interference Pattern
Python
import matplotlib.pyplot as plt
import numpy as np

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

t = np.linspace(0, 4*np.pi, 200)
z = np.linspace(0, 3, 200)

# Two interfering waves
wave1_x = np.sin(t) * np.exp(-z/4)
wave1_y = np.cos(t) * np.exp(-z/4)

wave2_x = np.sin(t + np.pi/3) * np.exp(-z/4) * 0.7
wave2_y = np.cos(t + np.pi/3) * np.exp(-z/4) * 0.7

# Plot waves
ax.plot(wave1_x, wave1_y, z, linewidth=2.5, color='#27D3F5')
ax.plot(wave2_x, wave2_y, z, linewidth=2.5, color='#F5276C')

# Fill between
for i in range(0, len(t), 4):
    ax.plot([wave1_x[i], wave2_x[i]], [wave1_y[i], wave2_y[i]], [z[i], z[i]], 
            color='#6CF527', alpha=0.3, linewidth=0.8)

ax.set_xlabel('X', fontsize=11, color='white')
ax.set_ylabel('Y', fontsize=11, color='white')
ax.set_zlabel('Z', fontsize=11, color='white')
ax.set_title('Wave Interference Pattern', fontsize=14, color='white', fontweight='bold', pad=15)

ax.tick_params(colors='#888888', labelsize=9)
ax.xaxis.pane.fill = False
ax.yaxis.pane.fill = False
ax.zaxis.pane.fill = False
ax.xaxis.pane.set_edgecolor('#333333')
ax.yaxis.pane.set_edgecolor('#333333')
ax.zaxis.pane.set_edgecolor('#333333')
ax.grid(True, alpha=0.3, color='#555555')

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support