I'm trying to save a matplotlib figure in eps format, but when I use savefig(), the labels and titles all disappear. It works fine with every other type of output, so I'm not sure what's going wrong.
import numpy as np
import matplotlib.pyplot as plt
data = np.random.rand(4,4)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(data)
plt.title('Title')
plt.xlabel('x axis')
plt.ylabel('y axis')
fig.savefig('test.eps')
fig.savefig('test.png')
The .png file I get from this is properly labeled (plt.show() also looks okay), but the .eps ends up without labels. Any thoughts? (I'm still learning how to use matplotlib, so it might be an easy fix that I'm overlooking...)