from sympy import *
from spb import *
import param
n, m = symbols("n, m")
phi, theta = symbols("phi, theta", real=True)
r = re(Ynm(n, m, theta, phi).expand(func=True).rewrite(sin).expand())
plot3d_spherical(
    abs(r), (theta, 0, pi), (phi, 0, 2*pi),
    params = {
        n: param.Integer(2, label="n"),
        m: param.Integer(0, label="m"),
    },
    force_real_eval=True,
    use_cm=True, color_func=r,
    backend=KB, imodule="panel")