Effects of anharmonicity on the pair correlation function of classical crystals are studied. The recently proposed shortest-graph approach using the Gaussian representation of the individual correlation peaks (the peak width is determined by the length of the shortest graph connecting a given pair of particles) is further improved, to account for anharmonic corrections due to finite temperatures and hard-sphere-like interactions. Two major effects are identified, leading to a modification of the correlation peaks at large or short distances: (i) the peaks at large distances, well described by Gaussians, should be calculated from the finite-temperature phonon spectra; (ii) at short distances, the correlation peaks deviate significantly from the Gaussian form due to the lattice discreteness. We propose the analytical interpolation method, based on the shortest-graph approach, which includes both effects. By employing the molecular dynamics simulations, the accuracy of the method is verified for three- and two-dimensional crystals with the Yukawa, inverse-power-law, and pseudo-hard-sphere pair interactions. The capabilities of the method are demonstrated by calculating the phase diagram of a three-dimensional Yukawa system.