The following notebook creates plots of the spherical harmonics as well as an HTML file that lists these images together with an explicit expression of the function, both in angular coordinates and Cartesian coordinates.

Load packages

We use the packages included in Quanty.nb in order to do the plotting and to create the basis functions. Note that BasisY as included in Quanty is equivalent to SphericalHarmonicY which is Mathematica's standard. For other basis functions there is no Mathematica standard.

Needs["Quanty`PointGroupSymmetry`"];
Needs["Quanty`PlotTools`"];

Create plots

lmax=6;

Monitor[For[l=0,l≤lmax,l++,
For[m=1,m≤2l+1,m++,
(* axes *)
plaxes=Graphics3D[{Thickness[0.01 ],Black,Line[{{-0.1 (l+1) ,-0.1(l+1),0.1 (l+1)},{-0.1 (l+1) ,-0.1(l+1),-0.1 (l+1)}}],Line[{{-0.1 (l+1) ,0.1(l+1),-0.1 (l+1)},{-0.1 (l+1) ,-0.1(l+1),-0.1 (l+1)}}],Line[{{0.1 (l+1) ,-0.1(l+1),-0.1 (l+1)},{-0.1 (l+1) ,-0.1(l+1),-0.1 (l+1)}}]}];
pltext3D=Graphics3D[{Text["z",{-0.1(l+1) ,-0.085(l+1),0.095 (l+1)}],Text["x",{0.092(l+1) ,-0.085(l+1),-0.1 (l+1)}],Text["y",{-0.087(l+1) ,0.095(l+1),-0.11 (l+1)}]}];
pltextx=Graphics3D[{Text["y",{0 ,0.095(l+1),-0.085 (l+1)}],Text["z",{0 ,-0.087(l+1),0.095 (l+1)}]}];
pltexty=Graphics3D[{Text["z",{-0.085(l+1) ,0,0.095 (l+1)}],Text["x",{0.095(l+1) ,0,-0.087 (l+1)}]}];
pltextz=Graphics3D[{Text["x",{0.095(l+1) ,-0.085(l+1),0}],Text["y",{-0.087(l+1) ,0.095(l+1),0}]}];
(* Shperical Harmonic Y *)
pl=Rasterize[GraphicsRow[{Show[WavePlot[BasisY[l][[m]],{θ,ϕ},ViewPoint->{300,20,50},PlotRange->{{-0.15 (l+1),0.15 (l+1)},{-0.15 (l+1),0.15 (l+1)},{-0.15 (l+1),0.15 (l+1)}},Boxed->False,Axes->False],pltext3D,plaxes],Show[WavePlot[BasisY[l][[m]],{θ,ϕ},ViewPoint->{500,0,0},PlotRange->{{-0.15 (l+1),0.15 (l+1)},{-0.15 (l+1),0.15 (l+1)},{-0.15 (l+1),0.15 (l+1)}},Boxed->False,Axes->False],plaxes,pltextx],Show[WavePlot[BasisY[l][[m]],{θ,ϕ},ViewPoint->{0,500,0},ViewVertical->{1,0,0},PlotRange->{{-0.15 (l+1),0.15 (l+1)},{-0.15 (l+1),0.15 (l+1)},{-0.15 (l+1),0.15 (l+1)}},Boxed->False,Axes->False],plaxes,pltexty],Show[WavePlot[BasisY[l][[m]],{θ,ϕ},ViewPoint->{0,0,500},PlotRange->{{-0.15 (l+1),0.15 (l+1)},{-0.15 (l+1),0.15 (l+1)},{-0.15 (l+1),0.15 (l+1)}},Boxed->False,Axes->False],plaxes,pltextz]},Spacings->0],RasterSize->3200];
Export[NotebookDirectory[]<>"plOrbY"<>ToString[l]<>ToString[m]<>".eps",pl];

];
];,{l,m}]

Create text

ClearAll[x,y,z,θ,ϕ]

ToReal[f_]:=FullSimplify[FullSimplify[(SphericalToCarthesianCoordinates[f]/.x->x/r/.y->y/r/.z->z/r)r^l]/.r->(Sqrt[(x^2)+(y^2)+(z^2)])]

lmax=6;

resultstr="";
For[l=0,l≤lmax,l++,
resultstr=resultstr<>"----\n----\n===== $l="<>ToString[l]<>"$ =====\n";
For[ml=-l,ml≤l,ml++,
resultstr=resultstr<>"==== $m_l="<>ToString[ml]<>"$ ====\n$$\n";
resultstr=resultstr<>"Y_{"<>ToString[l]<>"}^{("<>ToString[ml]<>")}="<>ToString[TeXForm[BasisY[l][[ml+l+1]]]]<>"\\\\\n";
resultstr=resultstr<>"\\phantom{Y_{"<>ToString[l]<>"}^{("<>ToString[ml]<>")}}="<>ToString[TeXForm[ToReal[BasisY[l][[ml+l+1]]]]];
resultstr=resultstr<>"\n$$\n\n";
resultstr=resultstr<>"{{:physics_chemistry:orbitals:plorby"<>ToString[l]<>ToString[ml+l+1]<>".png?nolink |}}\n\n"
]
]

resultstr