I am using matplotlib with multiprocessing to make many figures quickly. The issue is that the text in the title on some figures is messed up.
Some titles are messed up, like this...
Has anyone else ever had this problem, and is there a way to prevent it from happening?
For reference, I am using the method in this answer to make my figures: https://stackoverflow.com/a/40032128/2383070
def make_plot(d):
plt.cla()
plt.clf()
d1 = np.random.rand(10,10)*d
d2 = np.random.rand(10,10)*d
d3 = np.random.rand(10,10)*d
figs, (ax1, ax2, ax3) = plt.subplots(1,3, figsize=(20,10))
plt.sca(ax1)
plt.title('A title for d1')
plt.pcolormesh(d1, vmin=0, vmax=1)
plt.sca(ax2)
plt.title('A title for d2')
plt.pcolormesh(d2, vmin=0, vmax=1)
plt.sca(ax3)
plt.title('A title for d3')
plt.pcolormesh(d3, vmin=0, vmax=1)
plt.savefig('./%s' % d)
p = multiprocessing.Pool(10)
p.map(make_plot, range(30))