The spherical harmonic function is the angular part of the form solution of the spherical coordinate system of the Laplace equation. It is widely used in classical field theory, quantum mechanics and other fields. Based on the angular momentum operator and associated Legendre equation in quantum mechanics, the general equation of spheric harmonic function is deduced using the separation variable method under the generalized function condition, and then the spherical harmonic function is obtained when n and l are 0, 1, 2, 3, 4 and 5, respectively. According to the independent variable domain of spherical coordinate, under the independent variables θ, φ condition, spheric harmonic function and its atomic orbitals at different states are studied, and the visualization research is made. Finally, using MATLAB software, we simulate spheric harmonic function and its atomic orbitals at different n, l, then obtain concise, readable and clear visualization results. The visualization study provides a feasible way to investigate other characteristics for spheric harmonic function and its atomic orbitals.