MCPcopy Create free account
hub / github.com/MAC-VO/MAC-VO / plot_compare_plot

Function plot_compare_plot

Evaluation/PlotSpeed.py:12–33  ·  view source on GitHub ↗
(spaces: list[str])

Source from the content-addressed store, hash-verified

10
11
12def 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

Callers 1

PlotSpeed.pyFile · 0.85

Calls 6

plot_cumulative_densityFunction · 0.90
loadMethod · 0.80
pathMethod · 0.80
writeMethod · 0.80
openMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected