3D Line
Conical Helix Trajectory
A 3D spiral wrapping around a cone shape, showing a decreasing radius trajectory in warm amber and orange tones.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
# Conical helix (spiral on a cone)
n = 400
t = np.linspace(0, 10 * np.pi, n)
# Radius decreases as we go up
r = 2 * (1 - t / (10 * np.pi))
x = r * np.cos(t)
y = r * np.sin(t)
z = t / (10 * np.pi) * 3
fig = plt.figure(figsize=(10, 8), facecolor='#0a0a0f')
ax = fig.add_subplot(111, projection='3d', facecolor='#0a0a0f')
# Color gradient from amber to orange
colors = plt.cm.ScalarMappable(cmap=plt.cm.YlOrRd).to_rgba(np.linspace(0, 1, n-1))
# Plot segments with gradient
for i in range(n-1):
ax.plot(x[i:i+2], y[i:i+2], z[i:i+2],
color='#f59e0b' if i % 2 == 0 else '#f97316', linewidth=2)
# Glow effect
ax.plot(x, y, z, color='#fbbf24', linewidth=5, alpha=0.15)
ax.set_xlim(-2.5, 2.5)
ax.set_ylim(-2.5, 2.5)
ax.set_zlim(0, 3.5)
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('Conical Helix Trajectory', 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=20, azim=45)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
3D Charts
More 3D Line examples
☕