matplotlib.backends.backend_template
A fully functional, do-nothing backend intended as a template for backend writers. It is fully functional in that you can select it as a backend e.g. with
import matplotlib
matplotlib.use("template")
and your program will (should!) run without error, though no output is produced. This provides a starting point for backend writers; you can selectively implement drawing methods (~.RendererTemplate.draw_path, ~.RendererTemplate.draw_image, etc.) and slowly see your figure come to life instead having to have a full-blown implementation before getting any results.
Copy this file to a directory outside the Matplotlib source tree, somewhere
where Python can import it (by adding the directory to your sys.path
or by
packaging it as a normal Python package); if the backend is importable as
import my.backend
you can then select it using
import matplotlib
matplotlib.use("module://my.backend")
If your backend implements support for saving figures (i.e. has a print_xyz method), you can register it as the default handler for a given file type:
from matplotlib.backend_bases import register_backend
register_backend('xyz', 'my_backend', 'XYZ File Format')
...
plt.savefig("figure.xyz")