I am plotting two intersecting transparent histograms with the code below. When I look at the figure, which pops up when I run the code in iPython, everything looks as expected. When I export this figure in png-format, everything is fine as well, but when I export it in eps-format, the transparency is gone and I cannot see the intersecting part of the histograms. I would like to export this in eps-format with transparency. Any advice would be appreciated.
import numpy
from matplotlib import pyplot as plt
d1 = numpy.random.normal(-0.2, 0.25, 5000)
d2 = numpy.random.normal(0.2, 0.25, 5000)
bins = numpy.linspace(-1,1,30)
fig = plt.figure(1,figsize=(30.0, 15.0))
plt.ion()
plt.hist(d1, bins, alpha=0.5, normed=1)
plt.hist(d2, bins, alpha=0.5, normed=1)
plt.show()
plt.savefig('myfig.eps') # <-- loses transparency
plt.savefig('myfig.png') # <-- preserves transparency