def pendulum_traj_draw(traj, ax=None): plt.ion() if ax is None: fig = plt.figure() ax = fig.add_subplot(111) traj_array = np.array(traj) ax.hold(True) line = ax.plot(traj_array[:, 0], traj_array[:, 1], '-k') #add larger marker for the initial point ax.plot(traj_array[0, 0], traj_array[0, 1], '*k', markersize=10.0) #add arrow to curve utils.add_arrow_to_line2D(ax, line) return ax