Skip to content

Commit

Permalink
changed plot fig saving rgy
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCox822 committed Aug 8, 2024
1 parent 9b4a0b9 commit ee6eb4e
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions mdagent/tools/base_tools/analysis_tools/rgy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
from typing import Optional

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -55,19 +54,13 @@ def plot_rgy(self) -> str:
plot_name = self.path_registry.write_file_name(
type=FileType.FIGURE, fig_analysis=fig_analysis, file_format="png"
)
print("plot_name: ", plot_name)
plot_id = self.path_registry.get_fileid(
file_name=plot_name, type=FileType.FIGURE
)
if plot_name.endswith(".png"):
plot_name = plot_name.split(".png"[0])
plot_path = next(
f"{self.path_registry.ckpt_figures}/{plot_name}_{i}.png"
for i in range(1000)
if not os.path.exists(
f"{self.path_registry.ckpt_figures}/{plot_name}_{i}.png"
)
)

plot_name = plot_name.split(".png")[0]
plot_path = f"{self.path_registry.ckpt_figures}/{plot_name}"
plt.plot(rg_per_frame)
plt.xlabel("Frame")
plt.ylabel("Radius of Gyration (nm)")
Expand Down

0 comments on commit ee6eb4e

Please sign in to comment.