(spaces: list[str])
| 10 | |
| 11 | |
| 12 | def plot_compare_plot(spaces: list[str]): |
| 13 | fig = plt.figure(figsize=(5, 5), dpi=300) |
| 14 | ax = fig.add_subplot(1, 1, 1) |
| 15 | |
| 16 | for space in spaces: |
| 17 | box = Sandbox.load(space) |
| 18 | if not box.path("time_elapsed.json").exists(): |
| 19 | Logger.write("warn", f"Sandbox at path {space} does not have 'time_elapsed.json', passed.") |
| 20 | continue |
| 21 | with box.open("time_elapsed.json", "r") as f: |
| 22 | timestamps = json.load(f) |
| 23 | timestamps = np.array(timestamps) |
| 24 | elapsed = timestamps[1:] - timestamps[:-1] |
| 25 | plot_cumulative_density(elapsed, label=box.folder.parent.name)(ax) |
| 26 | |
| 27 | ax.legend(frameon=False) |
| 28 | ax.set_xlim(left=0.0, right=1.0) |
| 29 | ax.set_ylabel("Proportion of frame") |
| 30 | ax.set_xlabel("Time elapsed (sec)") |
| 31 | plt.tight_layout() |
| 32 | plt.savefig("output.png") |
| 33 | plt.close() |
| 34 | |
| 35 | |
| 36 |
no test coverage detected