chemosim-lab / ProLIF

Interaction Fingerprints for protein-ligand complexes and more
https://prolif.readthedocs.io
Apache License 2.0
337 stars 66 forks source link

Interactions vs Time #195

Closed Anujkumarp closed 3 months ago

Anujkumarp commented 3 months ago

How to convert number of frames to time and plot it FI vs Time.

cbouy commented 3 months ago

I suppose this is for the "barcode" plot??

Something like this should do the trick

ax = fp.plot_barcode()

# replace time labels with frames
frames = [int(label.get_text()) for label in ax.xaxis.get_ticklabels()]
times = [int(u.trajectory[frame].time / 1000) for frame in frames]
ax.set_xticklabels(times)
ax.set_xlabel("Time (ns)")
ax