3D Line

Double Cone Helix (Hourglass)

A helix wrapping around a double cone creating an hourglass shape, in teal/mint colors.

Output
Double Cone Helix (Hourglass)
Python
import matplotlib.pyplot as plt
import numpy as np

# Double cone helix (hourglass shape)
n = 600
t = np.linspace(-5 * np.pi, 5 * np.pi, n)

# Radius varies as absolute value (creates hourglass)
r = 0.1 + 0.3 * np.abs(t / np.pi)

x = r * np.cos(t * 2)
y = r * np.sin(t * 2)
z = t / np.pi

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

# Mint/teal colors
ax.plot(x, y, z, color='#14b8a6', linewidth=4, alpha=0.2)
ax.plot(x, y, z, color='#2dd4bf', linewidth=2)
ax.plot(x, y, z, color='#5eead4', linewidth=0.8)

# Add center point
ax.scatter([0], [0], [0], color='#f0fdfa', s=50, zorder=5)

ax.set_xlim(-2, 2)
ax.set_ylim(-2, 2)
ax.set_zlim(-6, 6)

ax.set_xlabel('X', color='white', fontsize=10)
ax.set_ylabel('Y', color='white', fontsize=10)
ax.set_zlabel('Z', color='white', fontsize=10)
ax.set_title('Double Cone Helix (Hourglass)', color='white', fontsize=14, 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.grid(True, alpha=0.2, color='#334155')

ax.view_init(elev=15, azim=45)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support