import matplotlib.pyplot as plt
import numpy as np
from matplotlib import rcParams

# Use a commonly available serif font
rcParams.update({
    "font.family": "serif",
    "font.serif": ["DejaVu Serif"],
    "font.size": 12,
    "axes.labelsize": 14,
    "axes.titlesize": 16,
    "xtick.labelsize": 12,
    "ytick.labelsize": 12,
    "legend.fontsize": 11,
    "lines.linewidth": 1.8,
    "axes.linewidth": 1.5,
    "xtick.major.width": 1.2,
    "ytick.major.width": 1.2,
    "text.usetex": False,
    "figure.dpi": 600,
    "savefig.dpi": 600,
    "figure.autolayout": True
})

# Load band data
try:
    data = np.loadtxt('ti3in_bands.dat.gnu')
    k = np.unique(data[:, 0])
    bands = data[:, 1].reshape(-1, len(k))
except FileNotFoundError:
    raise FileNotFoundError("Band structure data file 'ti3in_bands.dat.gnu' not found.")

# Fermi energy
fermi_energy = 13.7295

# High-symmetry points
sym_indices = [0, 40, 80, 120, 160, 200, 240, 280]
sym_points = [k[i] for i in sym_indices]
sym_labels = [r'Γ', 'M', 'K', r'Γ', 'A', 'L', 'H', 'A']

# Plot
fig, ax = plt.subplots(figsize=(8, 6))
colors = plt.cm.viridis(np.linspace(0, 1, len(bands)))

for band, color in zip(bands, colors):
    band_clipped = np.clip(band, 11, 16)
    ax.plot(k, band_clipped, color=color, alpha=0.8)

ax.axhline(fermi_energy, linestyle='--', color='red', linewidth=1.5)
ax.text(k[0]+0.02, fermi_energy+0.15, r'$E_\mathrm{F}$', color='red', fontsize=12)

for point in sym_points[1:-1]:
    ax.axvline(point, color='gray', linestyle=':', linewidth=0.8)

ax.set_xticks(sym_points)
ax.set_xticklabels(sym_labels)
ax.set_xlabel("Wave Vector")
ax.set_ylabel("Energy (eV)")
ax.set_title(r"Electronic Band Structure of Ti$_3$In")

ax.set_ylim(11, 16)
ax.set_xlim(k[0], k[-1])
ax.grid(axis='y', linestyle=':', alpha=0.4)

plt.tight_layout()
plt.savefig('Ti3In_Bands.png', dpi=600)
plt.show()
   "legend.fontsize": 11,
    "lines.linewidth": 1.8,
    "axes.linewidth": 1.5,
    "xtick.major.width": 1.2,
    "ytick.major.width": 1.2,
    "text.usetex": False,
    "figure.dpi": 600,
    "savefig.dpi": 600,
    "figure.autolayout": True
})

# Load band data
try:
    data = np.loadtxt('ti3in_bands.dat.gnu')
    k = np.unique(data[:, 0])
    bands = data[:, 1].reshape(-1, len(k))
except FileNotFoundError:
    raise FileNotFoundError("Band structure data file 'ti3in_bands.dat.gnu' not found.")

# Fermi energy
fermi_energy = 13.7295

# High-symmetry points
sym_indices = [0, 40, 80, 120, 160, 200, 240, 280]
sym_points = [k[i] for i in sym_indices]
sym_labels = [r'Γ', 'M', 'K', r'Γ', 'A', 'L', 'H', 'A']

# Plot
fig, ax = plt.subplots(figsize=(8, 6))
colors = plt.cm.viridis(np.linspace(0, 1, len(bands)))

for band, color in zip(bands, colors):
    band_clipped = np.clip(band, 11, 16)
    ax.plot(k, band_clipped, color=color, alpha=0.8)

ax.axhline(fermi_energy, linestyle='--', color='red', linewidth=1.5)
ax.text(k[0]+0.02, fermi_energy+0.15, r'$E_\mathrm{F}$', color='red', fontsize=12)

for point in sym_points[1:-1]:
    ax.axvline(point, color='gray', linestyle=':', linewidth=0.8)

ax.set_xticks(sym_points)
ax.set_xticklabels(sym_labels)
ax.set_xlabel("Wave Vector")
ax.set_ylabel("Energy (eV)")
ax.set_title(r"Electronic Band Structure of Ti$_3$In")

ax.set_ylim(11, 16)
ax.set_xlim(k[0], k[-1])
ax.grid(axis='y', linestyle=':', alpha=0.4)

plt.tight_layout()
plt.savefig('Ti3In_Bands.png', dpi=600)
plt.show()

Would you like help checking which fonts are available on your system to avoid this in the future?

in region ylim(11, 16)  the bands color are not seeing very differenct.now write code in which bands in the mention y axis region look as an above image