Currently, I have plotted using rectangular patches to display a sequence of positions.

EDIT: the code used to create it (built from the RLPy library) -
def visualize_trajectory(self, trajectory=[[0,0,0,0], [0.1,0.1,0,0]]): domain_fig = plt.figure() for i, s in enumerate(trajectory): x, y, speed, heading = s[:4] car_xmin = x - self.REAR_WHEEL_RELATIVE_LOC car_ymin = y - self.CAR_WIDTH / 2. car_fig = matplotlib.patches.Rectangle( [car_xmin, car_ymin], self.CAR_LENGTH, self.CAR_WIDTH, alpha=(0.8 * i) / len(trajectory) ) rotation = Affine2D().rotate_deg_around( x, y, heading * 180 / np.pi) + plt.gca().transData car_fig.set_transform(rotation) plt.gca().add_patch(car_fig)
Is there any way to apply each of these patches to images? Ideally, instead of each rectangle in each position there will be an image of a car.
I played with AnnotationBbox and TransformedBbox , but both of them seem inflexible when working with rotations.
source share