mdevaluate/examples/plot_temperature.py

18 lines
485 B
Python
Raw Normal View History

2022-04-20 12:08:38 +00:00
"""
Plotting the Temperature from an Energy File
============================================
This example reads an Gromacs energy file and plots the evolultion and mean of the temperature.
"""
from matplotlib import pyplot as plt
2023-12-18 13:47:22 +00:00
from src import mdevaluate as md
2022-04-20 12:08:38 +00:00
import tudplot
tudplot.activate()
edr = md.open_energy('/data/niels/sim/water/bulk/300K/out/energy_water1000bulk300.edr')
T = edr['Temperature']
plt.plot(edr.time, T)
plt.plot(edr.time[[0, -1]], [T.mean(), T.mean()])