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

Function plot2d_multi

utility/plot_util.py:31–60  ·  view source on GitHub ↗
(output_dict, fig_path, labels, color_sink, lw=5, ncol=2)

Source from the content-addressed store, hash-verified

29
30
31def plot2d_multi(output_dict, fig_path, labels, color_sink, lw=5, ncol=2):
32 plt.rcParams['axes.facecolor'] = 'w'
33 plt.rcParams['savefig.facecolor'] = 'w'
34 plt.rcParams['grid.color'] = '#C0C0C0'
35 plt.rcParams['pdf.fonttype'] = 42
36 plt.rcParams['ps.fonttype'] = 42
37 plt.rcParams['font.size'] = 20
38
39 counter = 0
40 for label in labels:
41 output = output_dict[label]
42 print(counter)
43 print(label)
44 print(output.shape)
45 pred_x, pred_y = output[:, 3], output[:, 7]
46 if counter < 2:
47 plt.plot(pred_x, pred_y, color_sink[counter], linestyle=linestyle_ls[counter], linewidth=lw*1.8, label=label)
48 else:
49 plt.plot(pred_x, pred_y, color_sink[counter], linestyle=linestyle_ls[counter], linewidth=lw, label=label)
50 counter += 1
51
52 # plt.gca().set_aspect("equal")
53 if ncol:
54 plt.legend(loc='upper center', bbox_to_anchor=(0.5, -0.05), shadow = True, ncol = ncol)
55 plt.xlabel("X (m)")
56 plt.ylabel("Y (m)")
57 # plt.show()
58 plt.savefig(fig_path + '.png', bbox_inches='tight')
59 plt.savefig(fig_path + '.pdf', bbox_inches='tight')
60 plt.close()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected