Decide if there are some edges to plot and plot just one figure if not.
from json import loads
from math import copysign, cos, pi, sin
from matplotlib import pyplot as plt
from json import loads
from math import copysign, cos, pi, sin
from matplotlib import pyplot as plt
+from sys import argv, exit
sign = lambda x: copysign(1, x)
sign = lambda x: copysign(1, x)
################
## 1st subplot
################
## 1st subplot
- ax = fig.add_subplot(121)
+ if "edge" in t.keys():
+ ax = fig.add_subplot(121)
+ else:
+ ax = fig.add_subplot(111)
ax.set_aspect("equal")
ax.set_title("Final path")
ax.set_xlabel("x [m]")
ax.set_aspect("equal")
ax.set_title("Final path")
ax.set_xlabel("x [m]")
handles, labels = ax.get_legend_handles_labels()
handles, labels = ax.get_legend_handles_labels()
+ if not "edge" in t.keys():
+ plt.show()
+ plt.close(fig)
+ exit(0)
+
################
## 2nd subplot
################
## 2nd subplot