def plot_pd_compare(self, traj_lst, traj_names, itr, name='Full_State', save_dir='full_state', goals=None, goalidx=None): colors = ['magenta', 'green', 'black', 'yellow'] if goals is not None: if goals.reshape((-1, 2)).shape[0] > len(colors): import matplotlib.cm as cm colors = cm.rainbow(np.linspace(0, 1, goals.shape[0])) goals = goals[goalidx:] colors = colors[goalidx:] f, axarr = plt.subplots(1, len(traj_lst), sharex=True, sharey=True) for ax, traj, traj_name in zip(axarr, traj_lst, traj_names): self.plot_all_traj(traj, ax) if goals is not None: for pt, color in zip(goals.reshape((-1, 2)), colors): ax.scatter(pt[0], pt[1], color=color, marker='x') ax.set_xlim(-3, 3) ax.set_ylim(-3, 3) ax.set_title(traj_name) record_fig(name, save_dir, itr)
def plot_pd_compare(self, traj_lst, traj_names, itr, name='Full_State', save_dir='full_state'): f, axarr = plt.subplots(1, len(traj_lst), sharex=True, sharey=True) for ax, traj, traj_name in zip(axarr, traj_lst, traj_names): self.plot_all_traj(traj, ax) ax.set_title(traj_name) record_fig(name, save_dir, itr)
def plot_pd_compare(self, traj_lst, traj_names, itr, name='Full_State', save_dir='full_state'): f, axarr = plt.subplots(1, len(traj_lst)) for ax, traj, traj_name in zip(axarr, traj_lst, traj_names): #import pdb; pdb.set_trace() ax.imshow(traj.reshape((-1, self.path_len))) ax.set_title(traj_name) #break record_fig(name, save_dir, itr)
def plot_hard_samples(self, hard_sd, easy_sd, hard_pd, easy_pd, itr, name='hard_samples', save_dir='hardveasy'): f, axarr = plt.subplots(1, 2, sharex=True, sharey=True) for traj in hard_sd: self.plot_all_traj(traj, axarr[0], color='red') for traj in easy_sd: self.plot_all_traj(traj, axarr[0], color='blue') for traj in hard_pd: self.plot_all_traj(traj, axarr[1], color='red') for traj in easy_pd: self.plot_all_traj(traj, axarr[1], color='blue') axarr[0].set_title('sd') axarr[1].set_title('pd') record_fig(name, save_dir, itr)