Degenerate states can be mixed arbitrarily, differently in each code, so only |g|² summed over a degenerate set can be compared. With δ = 1 meV, the bands degenerate with n at k = Γ and with m at k + q are
D(n) = \{\, n' : |\varepsilon_{n'}(\Gamma) - \varepsilon_n(\Gamma)| < \delta \,\}, \qquad D_q(m) = \{\, m' : |\varepsilon_{m'}(\Gamma + q) - \varepsilon_m(\Gamma + q)| < \delta \,\}
and each plot shows, separately for every branch ν and every q-point:
\sqrt{\left\langle |g_{mn,\nu}(\Gamma, q)|^2 \right\rangle_{\mathrm{deg}}} =
\begin{cases}
|g_{mn,\nu}(\Gamma, q)| & \text{if } |D(n)| = 1 \text{ and } |D_q(m)| = 1 \\[6pt]
\sqrt{\dfrac{1}{|D(n)|} \displaystyle\sum_{n' \in D(n)} |g_{mn',\nu}(\Gamma, q)|^2} & \text{if } |D(n)| > 1 \text{ and } |D_q(m)| = 1 \\[6pt]
\sqrt{\dfrac{1}{|D_q(m)|} \displaystyle\sum_{m' \in D_q(m)} |g_{m'n,\nu}(\Gamma, q)|^2} & \text{if } |D(n)| = 1 \text{ and } |D_q(m)| > 1 \\[6pt]
\sqrt{\dfrac{1}{|D(n)|\,|D_q(m)|} \displaystyle\sum_{n' \in D(n)} \sum_{m' \in D_q(m)} |g_{m'n',\nu}(\Gamma, q)|^2} & \text{if } |D(n)| > 1 \text{ and } |D_q(m)| > 1
\end{cases}
D(n) is fixed along the path (k = Γ), so a degenerate set of bands n shares one plot (e.g. n = 5–6). Dq(m) is checked at each q-point, so m is averaged only where it is degenerate. EPW's prtgkk prints the same quantity.
The branches ν are followed through their crossings (by ω), as the bands m. Both codes also average over degenerate branches, which sets in abruptly where branches meet; the branch sum (default) does not depend on that:
\sqrt{\sum_\nu \left\langle |g_{mn,\nu}(\Gamma, q)|^2 \right\rangle_{\mathrm{deg}}}