In [1]:
import plumed
import matplotlib.pyplot as plt
In [2]:
# import COLVAR file as pandas dataset
# set the right path to the COLVAR file
data=plumed.read_as_pandas("../Exercise-1/COLVAR")
# print pandas dataset
data
Out[2]:
time r d
0 0.0 1.271069 2.782998
1 1.0 1.263125 2.388697
2 2.0 1.348965 2.606062
3 3.0 1.291011 2.204363
4 4.0 1.280714 2.411836
... ... ... ...
2020 2020.0 1.125837 2.705539
2021 2021.0 1.082062 1.316837
2022 2022.0 1.112222 0.888347
2023 2023.0 1.101927 0.906969
2024 2024.0 1.083492 0.952975

2025 rows × 3 columns

In [5]:
# plot time serie of gyration radius (r) and distance (d)
plt.plot(data.time,data.r, label="gyration radius")
plt.plot(data.time,data.d, label="distance")
# x-y axis labels
plt.xlabel("MD frame")
plt.ylabel("r/d [nm]")
plt.legend()
Out[5]:
<matplotlib.legend.Legend at 0x15ed5bbe0>
No description has been provided for this image
In [6]:
# plot gyration radius vs distance
plt.plot(data.r,data.d, 'o')
# x-y axis labels
plt.xlabel("gyration radius [nm]")
plt.ylabel("distance [nm]")
Out[6]:
Text(0, 0.5, 'distance [nm]')
No description has been provided for this image
In [ ]: