If I interpret properly the linked diagram, the emitted electric field is along the axis of a molecule, so its components go like sin and cos. The power per unit of area is proportional to E×H, hence to E2 in a given medium and for plane waves, hence the sin2 and cos2. This is also consistent with the conservation of power: sin2 + cos2 = 1. The φ and θ only result from 3D rotations.
What I just wrote is a heresy in quantum mechanics. The electric field is just a statistical illusion that appears if enough photons are detected. A photon has no electric field. Proper wording would rather go like "the probability of detecting a photon with angle φ between the source and the detector's orientations varies like cos2φ". But as the received power depends on the mean number of detected photons, the probability of detecting a photon varies like E2.
Though, macroscopic quantities are often a means to find or double-check the probability calculations of QM, or provide one direction of understanding. After all, both must often meet if taking many particles. Sometimes it fails: for a hydrogen atom that de-excites from 3s to 2p, no electric field can represent the wave function ψ. As we're here, the wave function of a photon is a scalar ψ, it's not the electric field as many books allege.
A similar situation is for the "orientation" of proton magnetic moment in NMR. Probably everyone figures mentally the magnetic moment as a definite vector, despite this is not a measurable quantity for one proton, and not even a hidden entity inaccessible to measurements, it's only a statistics. Only probabilities for each component exist for one proton, and are treated as such by QM. A thought definite vector helps imagine how the probabilities of each component evolve in an external magnetic field.