3D Line

Slinky Wave Motion

A slinky-like spiral with traveling wave motion, demonstrating mechanical wave propagation in purple.

Output
Slinky Wave Motion
Python
import matplotlib.pyplot as plt
import numpy as np

# Slinky-like curve with wave motion
n = 600
t = np.linspace(0, 8 * np.pi, n)

# Slinky with traveling wave
radius = 1 + 0.2 * np.sin(3 * t)
x = radius * np.cos(t)
y = radius * np.sin(t)
z = t / (2 * np.pi) + 0.3 * np.sin(5 * t)

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

# Purple gradient on light background
ax.plot(x, y, z, color='#7c3aed', linewidth=3, alpha=0.4)
ax.plot(x, y, z, color='#8b5cf6', linewidth=1.8)

ax.set_xlim(-2, 2)
ax.set_ylim(-2, 2)
ax.set_zlim(0, 5)

ax.set_xlabel('X', color='#1f2937', fontsize=10)
ax.set_ylabel('Y', color='#1f2937', fontsize=10)
ax.set_zlabel('Z', color='#1f2937', fontsize=10)
ax.set_title('Slinky Wave Motion', color='#1f2937', fontsize=14, fontweight='bold', pad=20)

ax.tick_params(colors='#6b7280', labelsize=8)
ax.xaxis.pane.fill = False
ax.yaxis.pane.fill = False
ax.zaxis.pane.fill = False
ax.xaxis.pane.set_edgecolor('#e5e7eb')
ax.yaxis.pane.set_edgecolor('#e5e7eb')
ax.zaxis.pane.set_edgecolor('#e5e7eb')
ax.grid(True, alpha=0.3, color='#d1d5db')

ax.view_init(elev=20, azim=40)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support