From ac1fd7a45ee8352aca4a7557508ffc099c8b6905 Mon Sep 17 00:00:00 2001 From: Jiri Hubacek Date: Fri, 9 Nov 2018 14:43:34 +0100 Subject: [PATCH] Fix plot labels and poses markers --- plot.py | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/plot.py b/plot.py index 43f7525..e7c04b6 100644 --- a/plot.py +++ b/plot.py @@ -139,9 +139,9 @@ if __name__ == "__main__": ## 1st subplot ax = fig.add_subplot(121) ax.set_aspect("equal") - ax.set_title("RRT* final path") - ax.set_xlabel("Longitudinal direction [m]") - ax.set_ylabel("Lateral direction [m]") + ax.set_title("Final path") + ax.set_xlabel("x [m]") + ax.set_ylabel("y [m]") # plot here for o in s["obst"]: @@ -152,7 +152,7 @@ if __name__ == "__main__": try: ax.add_artist(plt.Circle((o["circle"][0], o["circle"][1]), o["circle"][2], - color="black", fill=False)) + color="black", fill=False, hatch="/")) except: pass if PLOT["node"]: @@ -205,8 +205,10 @@ if __name__ == "__main__": label=t["cost"][traj]) except: print("No trajectory") - plt.plot(*plot_nodes([s["init"]]), color=COLOR["start"], marker=".") - plt.plot(*plot_nodes([s["goal"]]), color=COLOR["goal"], marker=".") + plt.plot(*car_frame(s["init"]), color="red", lw=2) + plt.plot(*car_frame(s["goal"]), color="red", lw=2) + plt.plot(*plot_nodes([s["init"]]), color="red", marker="+", ms=12) + plt.plot(*plot_nodes([s["goal"]]), color="red", marker="+", ms=12) # end plot here handles, labels = ax.get_legend_handles_labels() @@ -215,9 +217,9 @@ if __name__ == "__main__": ## 2nd subplot ax = fig.add_subplot(122) ax.set_aspect("equal") - ax.set_title("RRT* all edges") - ax.set_xlabel("Longitudinal direction [m]") - ax.set_ylabel("Lateral direction [m]") + ax.set_title("All edges") + ax.set_xlabel("x [m]") + ax.set_ylabel("y [m]") # plot here for o in s["obst"]: @@ -227,8 +229,8 @@ if __name__ == "__main__": pass try: ax.add_artist(plt.Circle((o["circle"][0], o["circle"][1]), - o["circle"][2], - color="black", fill=False)) + o["circle"][2], + color="black", fill=False)) except: pass if PLOT["node"]: @@ -281,8 +283,10 @@ if __name__ == "__main__": label=t["cost"][traj]) except: print("No trajectory") - plt.plot(*plot_nodes([s["init"]]), color=COLOR["start"], marker=".") - plt.plot(*plot_nodes([s["goal"]]), color=COLOR["goal"], marker=".") + plt.plot(*car_frame(s["init"]), color="red", lw=2) + plt.plot(*car_frame(s["goal"]), color="red", lw=2) + plt.plot(*plot_nodes([s["init"]]), color="red", marker="+", ms=12) + plt.plot(*plot_nodes([s["goal"]]), color="red", marker="+", ms=12) # end plot here handles, labels = ax.get_legend_handles_labels() -- 2.39.2