$l=0$ $Y_{0\,,0}\left(\theta,\phi\right)\, = \, \frac{1}{\sqrt{4 \pi}}$ a sphere.
%matplotlib widget
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib as mpl
import scipy.special as spl_fn
from ipywidgets import *
fig = plt.figure(figsize=[6,6])
ax = fig.add_subplot(projection='3d')
theta1=np.linspace(0, np.pi, 30)
phi1=np.linspace(0, 2*np.pi, 30)
[theta,phi]=np.meshgrid(theta1, phi1)
l=0; m=0
R=spl_fn.sph_harm(m, l, phi, theta)
X=np.real(R*np.sin(theta)*np.cos(phi))
Y=np.real(R*np.sin(theta)*np.sin(phi))
Z=np.real(R*np.cos(theta))
cmap=mpl.colormaps['cool']
ax.plot_surface(X, Y, Z, cmap=cmap)
ax.plot_wireframe(X, Y, Z, color='w', lw=0.2)
ax.set_xlabel('x axis')
ax.set_ylabel('y axis')
ax.set_position(pos=[-0.1,-0.1, 1.1,1.1])
#ax.axes(False)
plt.title('Spherical Harmonics' + str(l)+str(m))
interact();
$l=1$ is dipole! There are two components one. One of the dipole is aligned along z axis, $Y_{10} \left(\theta, \phi\right)$ the second one is in $x-y \, plane$, which is presented as complex number becase the orientation $Y_{11} \left(\theta, \phi\right)$. $$ Y_{1,0} \, =\, \sqrt{\frac{3}{4\pi}} \cos\theta $$ This is simple as it is real function. $$ Y_{1,1} \, =\, -\sqrt{\frac{3}{8\pi}} \sin\theta \, e^{i\phi} $$ This is a complex function. There is no point in plotting Absolute value, that would be. just $\sin\theta$, Real and Imaginary part represent two compments, we plot them seperately
%matplotlib widget
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib as mpl
import scipy.special as spl_fn
from ipywidgets import *
fig = plt.figure(figsize=[6,6])
ax = fig.add_subplot(projection='3d')
theta1=np.linspace(0, np.pi, 30)
phi1=np.linspace(0, 2*np.pi, 30)
[theta,phi]=np.meshgrid(theta1, phi1)
l=1; m=0
R=np.abs(spl_fn.sph_harm(m, l,phi, theta))
X=R*np.sin(theta)*np.cos(phi)
Y=R*np.sin(theta)*np.sin(phi)
Z=R*np.cos(theta)
cmap=mpl.colormaps['cool']
ax.plot_surface(X, Y, Z, cmap=cmap)
ax.plot_wireframe(X, Y, Z, color='w', lw=0.2)
ax.set_xlabel('x axis')
ax.set_ylabel('y axis')
#ax.set_position(pos=[-0.1,-0.1, 1.1,1.1])
#ax.axes(False)
plt.title('Spherical Harmonics' + str(l)+str(m))
interact();
%matplotlib widget
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib as mpl
import scipy.special as spl_fn
from ipywidgets import *
fig = plt.figure(figsize=[6,6])
ax = fig.add_subplot(projection='3d')
theta1=np.linspace(0, np.pi, 30)
phi1=np.linspace(0, 2*np.pi, 30)
[theta,phi]=np.meshgrid(theta1, phi1)
l=1; m=1
R=spl_fn.sph_harm(m, l,phi, theta)
X=np.abs(np.real(R))*np.sin(theta)*np.cos(phi)
Y=np.abs(np.real(R))*np.sin(theta)*np.sin(phi)
Z=np.abs(np.real(R))*np.cos(theta)
X1=np.abs(np.imag(R))*np.sin(theta)*np.cos(phi)
Y1=np.abs(np.imag(R))*np.sin(theta)*np.sin(phi)
Z1=np.abs(np.imag(R))*np.cos(theta)
cmap=mpl.colormaps['cool']
cmap1=mpl.colormaps['YlGn']
ax.plot_surface(X, Y, Z, cmap=cmap)
ax.plot_surface(X1, Y1, Z1, cmap=cmap1)
ax.plot_wireframe(X, Y, Z, color='w', lw=0.2)
ax.plot_wireframe(X1, Y1, Z1, color='w', lw=0.2)
ax.set_xlabel('x axis')
ax.set_ylabel('y axis')
#ax.set_position(pos=[-0.1,-0.1, 1.1,1.1])
#ax.axes(False)
plt.title('Spherical Harmonics' + str(l)+str(m))
interact();