The savefig method can be used to save figures to a file:
fig.savefig("filename.png")
It is possible to optionally specify the DPI and to choose between different output formats:
fig.savefig("filename.png", dpi=200)
Output can be generated in the formats PNG, JPG, EPS, SVG, PGF and PDF.