def plotTrajectory(data):
# points = np.array([x, y]).T.reshape(-1, 1, 2)
# segments = np.concatenate([points[:-1], points[1:]], axis=1)
#
# lc = LineCollection(segments, cmap=plt.get_cmap('Spectral'))
# lc.set_array(z)
# #lc.set_linewidth(2)
#
# plt.gca().add_collection(lc)
import matplotlib.cm as cm
cmap = cm.jet;
c = np.linspace(0, 10, len(data[:,0]));
plt.scatter(data[:,0], data[:,1], c = c, cmap = cmap, marker = '+');
评论列表
文章目录