<span class="mw-page-title-namespace">Blog</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Hacks/Wavy lines for photons in plot</span>
Fabrice P. Laussy's Web

Wavy lines for photons in plot

From laussy.org's Blog about Hacks.
Published: 21:24, 9 April 2026.

I often need to picture photons in graphs. Here is what I keep rewriting each time, saved for posterity and ease of access.

The sine wave is too "harmonic". I find it better to flatten a bit:

Plot[Tanh[1.25 Sin[x]], {x, 0, 10 \[Pi]}, Frame -> False, 
 Axes -> False, AspectRatio -> 1/10]

I also worked out how to put that on circular or elliptic shapes (describing the bubble of a photon-photon or photon-exciton pair creation):

All this is in the attached notebook: wavy.nb.