def plotXY(df, id_, x_coord, y_coord):
"""Plot the raw trajectories.
df -- the trajectories dataframe
id_ -- an identifier (for linear connections of objects)
x_coord -- the x coordinate
y_coord -- the y coordinate
"""
grid = sns.FacetGrid(df, hue=id_,
size=6, palette=sns.color_palette("Set1", 10))
grid.fig.suptitle('XY trajectories')
grid.map(plt.plot, x_coord, y_coord, marker=".", ms=0.3)
grid.map(plt.scatter, x_coord, y_coord, marker="o", s=20)
grid.set_xticklabels(rotation=90)
sns.plt.savefig("trajectories.png")
评论列表
文章目录