Contour Plot

Bessel J0 Contours

Contour plot of Bessel function J0 showing circular wave pattern.

Output
Bessel J0 Contours
Python
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
from scipy.special import jv

x = np.linspace(-12, 12, 200)
y = np.linspace(-12, 12, 200)
X, Y = np.meshgrid(x, y)
R = np.sqrt(X**2 + Y**2)
Z = jv(0, R)

fig, ax = plt.subplots(figsize=(10, 8), facecolor='#ffffff')
ax.set_facecolor('#ffffff')

# Cyan to teal
colors = ['#f0fdfa', '#5eead4', '#27F5B0', '#0d9488']
cmap = LinearSegmentedColormap.from_list('teal', colors, N=256)

cs = ax.contourf(X, Y, Z, levels=30, cmap=cmap)
ax.contour(X, Y, Z, levels=15, colors='#134e4a', linewidths=0.4, alpha=0.5)
cbar = plt.colorbar(cs, ax=ax, pad=0.02)
cbar.set_label('Jā‚€(r)', color='#374151', fontsize=11)
cbar.ax.yaxis.set_tick_params(color='#374151')
plt.setp(plt.getp(cbar.ax.axes, 'yticklabels'), color='#374151')

ax.set_xlabel('X', fontsize=11, color='#374151', fontweight='500')
ax.set_ylabel('Y', fontsize=11, color='#374151', fontweight='500')
ax.set_title('Bessel J0 Contours', fontsize=14, color='#1f2937', fontweight='bold', pad=15)

ax.tick_params(colors='#6b7280', labelsize=9)
for spine in ax.spines.values():
    spine.set_color('#d1d5db')

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Pairwise Data

ā˜•

Did this help you?

Support PyLucid to keep it free & growing

Support