1 """Procedures for plotting graphs."""
3 import matplotlib.pyplot as plt
7 def boxplot(w={}, t=""):
14 f, ax = plt.subplots()
16 ax.boxplot([v for k, v in w.items()], labels=[k for k, v in w.items()])
18 ax.grid(which="major", linestyle="-", linewidth="0.5", color="gray")
19 ax.grid(which="minor", linestyle=":", linewidth="0.5", color="gray")
22 def barplot(w={}, t=""):
23 """Plot barplot graph.
29 f, ax = plt.subplots()
33 [v for k, v in w.items()],
34 tick_label=[k for k, v in w.items()],
37 ax.grid(which="major", linestyle="-", linewidth="0.5", color="gray")
38 ax.grid(which="minor", linestyle=":", linewidth="0.5", color="gray")
41 if __name__ == "__main__":
47 boxplot(scenario.time(), "Elapsed time")
49 boxplot(scenario.cost(), "Final path cost")
51 boxplot(scenario.cusp(), "Changes in direction")
53 barplot(scenario.error_rate(), "Error rate")