mdevaluate/examples/plot_temperature.py

18 lines
476 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
import mdevaluate as md
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()])