ax.set_xlim(0, 10)
ax.set_ylim(0, 3)
if 'alpha' in kwargs and kwargs['alpha'] < 1:
    txt = 'This patch is transparent!'
else:
    txt = 'This patch is not transparent!'
ax.text(5, 1.5, txt, ha='center', va='center', fontsize=25, zorder=-2,
    rasterized=True)
fig, axes = plt.subplots(nrows=4, sharex=True)
add_patch(axes[0], alpha=0.2, rasterized=False)
add_patch(axes[1], alpha=0.2, rasterized=True)
add_patch(axes[2], rasterized=False)
add_patch(axes[3], rasterized=True)
plt.tight_layout()
plt.savefig('rasterized_transparency.eps')
Как лучше растеризовать график, не размывая метки в matplotlib?