Y_max = 1
X, Y = np.meshgrid(
np.linspace(0, 1.5, num=100),
np.linspace(1e-8, Y_max, num=100),
)
S = X + 1j * Y
style = dict(cmap=plt.cm.coolwarm, rasterized=True, vmin=-1, vmax=1)
text_kwargs = dict(c="black", fontsize=16)
fig, axes = plt.subplots(figsize=(8, 6), ncols=2, nrows=2, sharex=True, sharey=True)
ax1, ax2, ax3, ax4 = axes.flatten()
ax1.pcolormesh(X, Y, T1_func[0, 0](S).imag, **style)
ax1.pcolormesh(X, -Y, T3_func[0, 0](S.conj()).imag, **style)
ax1.text(0.32, 0.88, R"$T_\mathrm{I}^{11}$", transform=ax1.transAxes, **text_kwargs) # noqa: RUF027
ax1.text(0.32, 0.06, R"$T_\mathrm{III}^{11}$", transform=ax1.transAxes, **text_kwargs)
ax2.pcolormesh(X, +Y, T1_func[0, 1](S).imag, **style)
ax2.pcolormesh(X, -Y, T3_func[0, 1](S.conj()).imag, **style)
ax2.text(0.32, 0.88, R"$T_\mathrm{I}^{12}$", transform=ax2.transAxes, **text_kwargs) # noqa: RUF027
ax2.text(0.32, 0.06, R"$T_\mathrm{III}^{12}$", transform=ax2.transAxes, **text_kwargs)
ax3.pcolormesh(X, +Y, T1_func[1, 0](S).imag, **style)
ax3.pcolormesh(X, -Y, T2_func[1, 0](S.conj()).imag, **style)
ax3.text(0.32, 0.88, R"$T_\mathrm{I}^{21}$", transform=ax3.transAxes, **text_kwargs) # noqa: RUF027
ax3.text(0.32, 0.06, R"$T_\mathrm{II}^{21}$", transform=ax3.transAxes, **text_kwargs)
ax4.pcolormesh(X, +Y, T1_func[1, 1](S).imag, **style)
ax4.pcolormesh(X, -Y, T2_func[1, 1](S.conj()).imag, **style)
ax4.text(0.32, 0.88, R"$T_\mathrm{I}^{22}$", transform=ax4.transAxes, **text_kwargs) # noqa: RUF027
ax4.text(0.32, 0.06, R"$T_\mathrm{II}^{22}$", transform=ax4.transAxes, **text_kwargs)
for ax in axes.flatten():
ax.vlines(thr1, 0, Y_max, color="C0", ls="--")
ax.vlines(thr2, 0, Y_max, color="C1", ls="--")
for ax in axes[1]:
ax.set_xlabel("Re(s)")
for ax in axes[:, 0]:
ax.set_ylabel("Im(s)")
fig.tight_layout()
plt.show()