3D Fill Between
Spiral Staircase
3D spiral staircase visualization with blue and mint neon
Output
Python
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure(figsize=(10, 8), facecolor='white')
ax = fig.add_subplot(111, projection='3d')
ax.set_facecolor('white')
# Spiral staircase parameters
n = 150
theta = np.linspace(0, 4*np.pi, n)
r_inner = 0.5
r_outer = 1.5
x1 = r_inner * np.cos(theta)
y1 = r_inner * np.sin(theta)
z1 = np.linspace(0, 3, n)
x2 = r_outer * np.cos(theta)
y2 = r_outer * np.sin(theta)
z2 = z1
ax.plot(x1, y1, z1, linewidth=2.5, color='#276CF5')
ax.plot(x2, y2, z2, linewidth=2.5, color='#27F5B0')
# Steps connecting inner and outer
for i in range(0, n, 4):
ax.plot([x1[i], x2[i]], [y1[i], y2[i]], [z1[i], z2[i]],
color='#F5B027', alpha=0.5, linewidth=1.2)
ax.set_xlabel('X', fontsize=11, color='#1f2937')
ax.set_ylabel('Y', fontsize=11, color='#1f2937')
ax.set_zlabel('Z', fontsize=11, color='#1f2937')
ax.set_title('Spiral Staircase', fontsize=14, color='#1f2937', fontweight='bold', pad=15)
ax.xaxis.pane.fill = False
ax.yaxis.pane.fill = False
ax.zaxis.pane.fill = False
ax.xaxis.pane.set_edgecolor('#000000')
ax.yaxis.pane.set_edgecolor('#000000')
ax.zaxis.pane.set_edgecolor('#000000')
ax.tick_params(colors='#000000', labelsize=9)
ax.grid(True, alpha=0.5, linewidth=0.5)
ax.xaxis._axinfo['grid']['color'] = '#000000'
ax.yaxis._axinfo['grid']['color'] = '#000000'
ax.zaxis._axinfo['grid']['color'] = '#000000'
ax.view_init(elev=20, azim=45)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
3D Charts
More 3D Fill Between examples
☕