import matplotlib.pyplot as plt

# Adat beolvasása
frames = []
hbonds = []

with open("hbond_hoogsteen.dat") as f:
    for line in f:
        if line.startswith("#"):  # fejléc átugrása
            continue
        parts = line.split()
        if len(parts) >= 2:
            frames.append(int(parts[0]))
            hbonds.append(int(parts[1]))

# Plot
plt.figure(figsize=(8,5))
plt.plot(frames, hbonds, linestyle='-', color='r')
plt.xlabel("Frame")
plt.ylabel("Number of Hoogsteen H-bonds")
plt.title("Evolution of TBA tetrad H-bonds during the simulation")
plt.grid(True)
plt.tight_layout()
plt.savefig("hbonds_tetrad_plot", dpi=300)  # elmentjük képként
plt.show()