A PDF matplotlib backend Author: Jouni K Seppänen <firstname.lastname@example.org>
The canvas the figure renders into. Calls the draw and print fig methods, creates the renderers, etc...
figure - A Figure instance
PDF name object.
PDF operator object.
PDF file object.
Return name of an ExtGState that sets alpha to the given value
Embed the TTF font from the named file into the document.
Select a font based on fontprop and return a name suitable for Op.selectfont. If fontprop is a string, it will be interpreted as the filename (or dvi name) of the font.
Return name of an image XObject representing the given image.
Return name of a marker XObject representing the given path.
Reserve an ID for an indirect object. The name is used for debugging in case we forget to print out the object with writeObject.
Write out the info dictionary, checking it for good form
Write out the PDF trailer.
Write out the xref table.
A multi-page PDF file.
Use like this:
# Initialize: with PdfPages('foo.pdf') as pdf: # As many times as you like, create a figure fig and save it: # When no figure is specified the current figure is saved pdf.savefig(fig) pdf.savefig()
(In reality PdfPages is a thin wrapper around PdfFile, in order to avoid confusion when using savefig and forgetting the format argument.)
Create a new PdfPages object that will be written to the file named filename. The file is opened at once and any older file with the same name is overwritten.
Finalize this object, making the underlying file a complete PDF file.
Returns the current number of pages in the multipage pdf file.
Return a modifiable information dictionary object (see PDF reference section 10.2.1 ‘Document Information Dictionary’).
Save the Figure instance figure to this file as a new page. If figure is a number, the figure instance is looked up by number, and if figure is None, the active figure is saved. Any other keyword arguments are passed to Figure.savefig.
PDF reference object. Use PdfFile.reserveObject() to create References.
PDF stream object.
This has no pdfRepr method. Instead, call begin(), then output the contents of the stream by calling write(), and finally call end().
id: object id of stream; len: an unused Reference object for the length of the stream, or None (to use a memory buffer); file: a PdfFile; extra: a dictionary of extra key-value pairs to include in the stream header
Write some data on the stream.
Make one string from sequence of strings, with whitespace in between. The whitespace is chosen to form lines of at most linelen characters, if possible.
Create a new figure manager instance
Create a new figure manager instance for the given figure.
Map Python objects to PDF syntax.