From the documentation, matplotlib.pyplot.savefig takes a transparency and backend argument that may help you. Also, it takes a format argument so that you could save the figure as png to see if that works instead, if that's an option for you. You could try calling it like this:
plt.savefig("test.pdf", format="png")