3D Surface
Kuen Pseudospherical Surface
Kuen's surface with constant negative curvature in green-lime gradient.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
# Kuen surface parametrization
u = np.linspace(-4.5, 4.5, 100)
v = np.linspace(0.03, np.pi - 0.03, 80)
u, v = np.meshgrid(u, v)
x = 2 * (np.cos(u) + u * np.sin(u)) * np.sin(v) / (1 + u**2 * np.sin(v)**2)
y = 2 * (np.sin(u) - u * np.cos(u)) * np.sin(v) / (1 + u**2 * np.sin(v)**2)
z = np.log(np.tan(v/2)) + 2 * np.cos(v) / (1 + u**2 * np.sin(v)**2)
# Custom colormap
colors = ['#ffffff', '#dcfce7', '#22c55e', '#6CF527', '#d9f99d']
cmap = LinearSegmentedColormap.from_list('green_lime', colors, N=256)
fig = plt.figure(figsize=(10, 8), facecolor='#ffffff')
ax = fig.add_subplot(111, projection='3d', facecolor='#ffffff')
surf = ax.plot_surface(x, y, z, cmap=cmap, alpha=0.85, linewidth=0.1, edgecolor='#33333315')
ax.set_xlabel('X', fontsize=10, color='#374151', labelpad=10)
ax.set_ylabel('Y', fontsize=10, color='#374151', labelpad=10)
ax.set_zlabel('Z', fontsize=10, color='#374151', labelpad=10)
ax.set_title("Kuen Pseudospherical Surface", fontsize=14, color='#1f2937', 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.set_zlim(-5, 5)
ax.view_init(elev=20, azim=45)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
3D Charts
More 3D Surface examples
☕