I am plotting an image with matplotlib, by far the best interpolation parameter for imshow
in my case is interpolation='None'
but if I also give an alpha
parameter, when saving the figure, the alpha is not kept.
Minimal example:
import matplotlib.pyplot as plt
import numpy as np
arr = np.abs(np.sin(np.linspace(0, 2*np.pi)))
x,y = np.meshgrid(arr,arr)
arr = x*y
plt.figure()
plt.imshow(arr,alpha=arr,interpolation='None')
plt.savefig("fig1.pdf")
expected result:
what I get:
I only experience this issue for this particular interpolation setting.
matplotlib version: 3.4.3