Adding a vector graphic to a plot with transparent background

Viewed 107

I am trying to add an image on top of a plot. The image (of a car) has a transparent background, that is supposed to be transparent in the plot too, meaning, I don't want it to cover what's behind. (also it just looks bad otherwise)

I can achieve this with a .png file, no problem. But when I use a .eps file, the background that is supposed to be transparent, is white in my plot, covering what's behind it.

Here's an example, the blue car is from a .png file, the red from a .eps file.

Demonstration

I'm currently using

from PIL import Image
pic = Image.open(<path>)
# ...
ax.imshow(pic, ...)

Is there a way to fix this? I don't care whether I use a .eps file specifically. I just want it to be a vector file, so that it exports a nice vector graphic.

0 Answers
Related