for i in range(3):
    ellip = Ellipse(xy=(0.5, 0.5), width=1, height=1, facecolor='red',
        alpha=0.5)
ax.add_patch(ellip)
ellipses.append(ellip)
for i in range(100):
    fig.canvas.restore_region(bg)
for ellip in ellipses:
    ellip.width, ellip.height, ellip.angle = np.random.random(3)
ellip.angle *= 180
ax.draw_artist(ellip)
fig.canvas.blit(ax.bbox)
Очистка фона в matplotlib с помощью wxPython