3D Surface

Dini's Surface

Twisted pseudospherical surface with constant negative Gaussian curvature, rendered in pink-cyan gradient.

Output
Dini's Surface
Python
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LinearSegmentedColormap

# Dini's surface parameters
u = np.linspace(0, 4*np.pi, 150)
v = np.linspace(0.1, 2, 50)
u, v = np.meshgrid(u, v)

a = 1.0
b = 0.2
x = a * np.cos(u) * np.sin(v)
y = a * np.sin(u) * np.sin(v)
z = a * (np.cos(v) + np.log(np.tan(v/2))) + b * u

# Custom colormap
colors = ['#0a0a0f', '#4a1942', '#F527B0', '#27D3F5', '#67e8f9']
cmap = LinearSegmentedColormap.from_list('pink_cyan', colors, N=256)

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

surf = ax.plot_surface(x, y, z, cmap=cmap, alpha=0.9, linewidth=0.1, edgecolor='#ffffff22')

ax.set_xlabel('X', fontsize=10, color='#94a3b8', labelpad=10)
ax.set_ylabel('Y', fontsize=10, color='#94a3b8', labelpad=10)
ax.set_zlabel('Z', fontsize=10, color='#94a3b8', labelpad=10)
ax.set_title("Dini's Surface", fontsize=14, color='white', 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.view_init(elev=20, azim=45)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support