3D Surface
Bessel Function J₀(r)
Zeroth-order Bessel function of the first kind, important in wave physics.
Output
Python
import matplotlib.pyplot as plt
import numpy as np
from scipy.special import jv
from matplotlib.colors import LinearSegmentedColormap
colors = ['#ffffff', '#ede9fe', '#8b5cf6', '#6d28d9']
cmap = LinearSegmentedColormap.from_list('light_purple', colors, N=256)
X = np.linspace(-10, 10, 100)
Y = np.linspace(-10, 10, 100)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = jv(0, R) # Bessel function of first kind, order 0
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, linewidth=0, antialiased=True)
ax.set_xlabel('X', color='#1f2937', fontsize=10)
ax.set_ylabel('Y', color='#1f2937', fontsize=10)
ax.set_zlabel('J₀(r)', color='#1f2937', fontsize=10)
ax.set_title('Bessel Function J₀(r)', color='#1f2937', fontsize=14, 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.view_init(elev=25, azim=45)
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
3D Charts
More 3D Surface examples
☕