Introduction
Like other kinds of technical figures, scientific figures are rarely standalone documents—they are meant to be part of a document. matplotlib can render any figure to various common file formats such as PNG, EPS, SVG, and PDF. By default, a figure is shown with a minimalistic user interface, which allows you to save a figure to a file. However, this approach is not convenient if you have to generate a large batch of figures. Also, you might want to be able to generate a new figure every time some data is updated. In this chapter, we explore the file output capabilities of matplotlib. Apart from programmatically generating the file output, we are going to learn how to control important factors such as the resolution and size of the output, and dealing with transparency.