MCPcopy Create free account
hub / github.com/ChristopherLu/milliEgo / plot2d

Function plot2d

utility/plot_util.py:9–28  ·  view source on GitHub ↗
(output_pred, output_gt, fig_path)

Source from the content-addressed store, hash-verified

7linestyle_ls = [':', '-', '-', '-.', ':', '-', '-.', '--']
8
9def plot2d(output_pred, output_gt, fig_path):
10 plt.rcParams['axes.facecolor'] = 'w'
11 plt.rcParams['savefig.facecolor'] = 'w'
12 plt.rcParams['grid.color'] = '#C0C0C0'
13 plt.rcParams['pdf.fonttype'] = 42
14 plt.rcParams['ps.fonttype'] = 42
15 plt.rcParams['font.size'] = 18
16
17 pred_x, pred_y = output_pred[:, 3], output_pred[:, 7]
18 plt.plot(pred_x, pred_y, linestyle=linestyle_ls[0], linewidth=lw, label='Prediction')
19 gt_x, gt_y = output_gt[:, 3], output_gt[:, 7]
20 plt.plot(gt_x, gt_y, linestyle=linestyle_ls[1], linewidth=lw, label='Ground_truth')
21
22 # plt.gca().set_aspect("equal")
23 plt.legend(loc='best', ncol=1)
24 plt.xlabel("X (m)")
25 plt.ylabel("Y (m)")
26 # plt.show()
27 plt.savefig(fig_path, bbox_inches='tight')
28 plt.close()
29
30
31def plot2d_multi(output_dict, fig_path, labels, color_sink, lw=5, ncol=2):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected