forked from matplotlib/matplotlib.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackend_pdf_api.html
More file actions
369 lines (326 loc) · 20.3 KB
/
backend_pdf_api.html
File metadata and controls
369 lines (326 loc) · 20.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>matplotlib.backends.backend_pdf — Matplotlib 1.3.x documentation</title>
<link rel="stylesheet" href="../_static/mpl.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '1.3.x',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="search" type="application/opensearchdescription+xml"
title="Search within Matplotlib 1.3.x documentation"
href="../_static/opensearch.xml"/>
<link rel="top" title="Matplotlib 1.3.x documentation" href="../index.html" />
<link rel="up" title="backends" href="index_backend_api.html" />
<link rel="next" title="matplotlib.dviread" href="dviread.html" />
<link rel="prev" title="matplotlib.backends.backend_wxagg" href="backend_wxagg_api.html" />
</head>
<body>
<!-- Piwik -->
<script type="text/javascript">
if ("matplotlib.sourceforge.net" == document.location.hostname ||
"matplotlib.sf.net" == document.location.hostname) {
var pkBaseURL = (("https:" == document.location.protocol) ? "https://apps.sourceforge.net/piwik/matplotlib/" : "http://apps.sourceforge.net/piwik/matplotlib/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
<script type="text/javascript">
if ("matplotlib.sourceforge.net" == document.location.hostname ||
"matplotlib.sf.net" == document.location.hostname) {
piwik_action_name = '';
piwik_idsite = 1;
piwik_url = pkBaseURL + "piwik.php";
piwik_log(piwik_action_name, piwik_idsite, piwik_url);
document.write(unescape('%3Cobject%3E%3Cnoscript%3E%3Cp%3E%3Cimg src="http://apps.sourceforge.net/piwik/matplotlib/piwik.php?idsite=1" alt="piwik"/%3E%3C/p%3E%3C/noscript%3E%3C/object%3E'));
}
</script>
<!-- End Piwik Tag -->
<link rel="shortcut icon" href="_static/favicon.ico">
<!-- The "Fork me on github" ribbon -->
<img style="float: right; margin-bottom: -40px; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" usemap="#ribbonmap"/>
<map name="ribbonmap">
<area shape="poly" coords="15,0,148,-1,148,135" href="https://github.com/matplotlib/matplotlib" title="Fork me on GitHub" />
</map>
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="../index.html"><img src="../_static/logo2.png" border="0" alt="matplotlib"/></a>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="dviread.html" title="matplotlib.dviread"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="backend_wxagg_api.html" title="matplotlib.backends.backend_wxagg"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">home</a>| </li>
<li><a href="../examples/index.html">examples</a>| </li>
<li><a href="../gallery.html">gallery</a>| </li>
<li><a href="pyplot_summary.html">pyplot</a>| </li>
<li><a href="../contents.html">docs</a> »</li>
<li><a href="index.html" >The Matplotlib API</a> »</li>
<li><a href="index_backend_api.html" accesskey="U">backends</a> »</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="backend_wxagg_api.html"
title="previous chapter"><tt class="docutils literal"><span class="pre">matplotlib.backends.backend_wxagg</span></tt></a></p>
<h4>Next topic</h4>
<p class="topless"><a href="dviread.html"
title="next chapter"><tt class="docutils literal"><span class="pre">matplotlib.dviread</span></tt></a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/api/backend_pdf_api.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="module-matplotlib.backends.backend_pdf">
<span id="matplotlib-backends-backend-pdf"></span><h1><a class="reference internal" href="#module-matplotlib.backends.backend_pdf" title="matplotlib.backends.backend_pdf"><tt class="xref py py-mod docutils literal"><span class="pre">matplotlib.backends.backend_pdf</span></tt></a><a class="headerlink" href="#module-matplotlib.backends.backend_pdf" title="Permalink to this headline">¶</a></h1>
<p>A PDF matplotlib backend
Author: Jouni K Seppänen <<a class="reference external" href="mailto:jks%40iki.fi">jks<span>@</span>iki<span>.</span>fi</a>></p>
<dl class="class">
<dt id="matplotlib.backends.backend_pdf.FigureCanvasPdf">
<em class="property">class </em><tt class="descclassname">matplotlib.backends.backend_pdf.</tt><tt class="descname">FigureCanvasPdf</tt><big>(</big><em>figure</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.FigureCanvasPdf" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="backend_bases_api.html#matplotlib.backend_bases.FigureCanvasBase" title="matplotlib.backend_bases.FigureCanvasBase"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.backend_bases.FigureCanvasBase</span></tt></a></p>
<p>The canvas the figure renders into. Calls the draw and print fig
methods, creates the renderers, etc...</p>
<p>Public attribute</p>
<blockquote>
<div>figure - A Figure instance</div></blockquote>
</dd></dl>
<dl class="class">
<dt id="matplotlib.backends.backend_pdf.Name">
<em class="property">class </em><tt class="descclassname">matplotlib.backends.backend_pdf.</tt><tt class="descname">Name</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.Name" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>PDF name object.</p>
</dd></dl>
<dl class="class">
<dt id="matplotlib.backends.backend_pdf.Operator">
<em class="property">class </em><tt class="descclassname">matplotlib.backends.backend_pdf.</tt><tt class="descname">Operator</tt><big>(</big><em>op</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.Operator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>PDF operator object.</p>
</dd></dl>
<dl class="class">
<dt id="matplotlib.backends.backend_pdf.PdfFile">
<em class="property">class </em><tt class="descclassname">matplotlib.backends.backend_pdf.</tt><tt class="descname">PdfFile</tt><big>(</big><em>filename</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfFile" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>PDF file object.</p>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.PdfFile.alphaState">
<tt class="descname">alphaState</tt><big>(</big><em>alpha</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfFile.alphaState" title="Permalink to this definition">¶</a></dt>
<dd><p>Return name of an ExtGState that sets alpha to the given value</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.PdfFile.embedTTF">
<tt class="descname">embedTTF</tt><big>(</big><em>filename</em>, <em>characters</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfFile.embedTTF" title="Permalink to this definition">¶</a></dt>
<dd><p>Embed the TTF font from the named file into the document.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.PdfFile.fontName">
<tt class="descname">fontName</tt><big>(</big><em>fontprop</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfFile.fontName" title="Permalink to this definition">¶</a></dt>
<dd><p>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.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.PdfFile.imageObject">
<tt class="descname">imageObject</tt><big>(</big><em>image</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfFile.imageObject" title="Permalink to this definition">¶</a></dt>
<dd><p>Return name of an image XObject representing the given image.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.PdfFile.markerObject">
<tt class="descname">markerObject</tt><big>(</big><em>path</em>, <em>trans</em>, <em>fillp</em>, <em>strokep</em>, <em>lw</em>, <em>joinstyle</em>, <em>capstyle</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfFile.markerObject" title="Permalink to this definition">¶</a></dt>
<dd><p>Return name of a marker XObject representing the given path.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.PdfFile.reserveObject">
<tt class="descname">reserveObject</tt><big>(</big><em>name=''</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfFile.reserveObject" title="Permalink to this definition">¶</a></dt>
<dd><p>Reserve an ID for an indirect object.
The name is used for debugging in case we forget to print out
the object with writeObject.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.PdfFile.writeInfoDict">
<tt class="descname">writeInfoDict</tt><big>(</big><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfFile.writeInfoDict" title="Permalink to this definition">¶</a></dt>
<dd><p>Write out the info dictionary, checking it for good form</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.PdfFile.writeTrailer">
<tt class="descname">writeTrailer</tt><big>(</big><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfFile.writeTrailer" title="Permalink to this definition">¶</a></dt>
<dd><p>Write out the PDF trailer.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.PdfFile.writeXref">
<tt class="descname">writeXref</tt><big>(</big><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfFile.writeXref" title="Permalink to this definition">¶</a></dt>
<dd><p>Write out the xref table.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.backends.backend_pdf.PdfPages">
<em class="property">class </em><tt class="descclassname">matplotlib.backends.backend_pdf.</tt><tt class="descname">PdfPages</tt><big>(</big><em>filename</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfPages" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>A multi-page PDF file.</p>
<p>Use like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># Initialize:</span>
<span class="n">pp</span> <span class="o">=</span> <span class="n">PdfPages</span><span class="p">(</span><span class="s">'foo.pdf'</span><span class="p">)</span>
<span class="c"># As many times as you like, create a figure fig, then either:</span>
<span class="n">fig</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="n">pp</span><span class="p">,</span> <span class="n">format</span><span class="o">=</span><span class="s">'pdf'</span><span class="p">)</span> <span class="c"># note the format argument!</span>
<span class="c"># or:</span>
<span class="n">pp</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="n">fig</span><span class="p">)</span>
<span class="c"># Once you are done, remember to close the object:</span>
<span class="n">pp</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</pre></div>
</div>
<p>(In reality PdfPages is a thin wrapper around PdfFile, in order to
avoid confusion when using savefig and forgetting the format
argument.)</p>
<p>Create a new PdfPages object that will be written to the file
named <em>filename</em>. The file is opened at once and any older
file with the same name is overwritten.</p>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.PdfPages.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfPages.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Finalize this object, making the underlying file a complete
PDF file.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.PdfPages.infodict">
<tt class="descname">infodict</tt><big>(</big><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfPages.infodict" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a modifiable information dictionary object
(see PDF reference section 10.2.1 ‘Document Information
Dictionary’).</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.PdfPages.savefig">
<tt class="descname">savefig</tt><big>(</big><em>figure=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.PdfPages.savefig" title="Permalink to this definition">¶</a></dt>
<dd><p>Save the Figure instance <em>figure</em> to this file as a new page.
If <em>figure</em> is a number, the figure instance is looked up by
number, and if <em>figure</em> is None, the active figure is saved.
Any other keyword arguments are passed to Figure.savefig.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.backends.backend_pdf.Reference">
<em class="property">class </em><tt class="descclassname">matplotlib.backends.backend_pdf.</tt><tt class="descname">Reference</tt><big>(</big><em>id</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.Reference" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>PDF reference object.
Use PdfFile.reserveObject() to create References.</p>
</dd></dl>
<dl class="class">
<dt id="matplotlib.backends.backend_pdf.Stream">
<em class="property">class </em><tt class="descclassname">matplotlib.backends.backend_pdf.</tt><tt class="descname">Stream</tt><big>(</big><em>id</em>, <em>len</em>, <em>file</em>, <em>extra=None</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.Stream" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>PDF stream object.</p>
<p>This has no pdfRepr method. Instead, call begin(), then output the
contents of the stream by calling write(), and finally call end().</p>
<p>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</p>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.Stream.end">
<tt class="descname">end</tt><big>(</big><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.Stream.end" title="Permalink to this definition">¶</a></dt>
<dd><p>Finalize stream.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.backends.backend_pdf.Stream.write">
<tt class="descname">write</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.Stream.write" title="Permalink to this definition">¶</a></dt>
<dd><p>Write some data on the stream.</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="matplotlib.backends.backend_pdf.fill">
<tt class="descclassname">matplotlib.backends.backend_pdf.</tt><tt class="descname">fill</tt><big>(</big><em>strings</em>, <em>linelen=75</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.fill" title="Permalink to this definition">¶</a></dt>
<dd><p>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.</p>
</dd></dl>
<dl class="function">
<dt id="matplotlib.backends.backend_pdf.new_figure_manager">
<tt class="descclassname">matplotlib.backends.backend_pdf.</tt><tt class="descname">new_figure_manager</tt><big>(</big><em>num</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.new_figure_manager" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new figure manager instance</p>
</dd></dl>
<dl class="function">
<dt id="matplotlib.backends.backend_pdf.new_figure_manager_given_figure">
<tt class="descclassname">matplotlib.backends.backend_pdf.</tt><tt class="descname">new_figure_manager_given_figure</tt><big>(</big><em>num</em>, <em>figure</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.new_figure_manager_given_figure" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new figure manager instance for the given figure.</p>
</dd></dl>
<dl class="function">
<dt id="matplotlib.backends.backend_pdf.pdfRepr">
<tt class="descclassname">matplotlib.backends.backend_pdf.</tt><tt class="descname">pdfRepr</tt><big>(</big><em>obj</em><big>)</big><a class="headerlink" href="#matplotlib.backends.backend_pdf.pdfRepr" title="Permalink to this definition">¶</a></dt>
<dd><p>Map Python objects to PDF syntax.</p>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="dviread.html" title="matplotlib.dviread"
>next</a> |</li>
<li class="right" >
<a href="backend_wxagg_api.html" title="matplotlib.backends.backend_wxagg"
>previous</a> |</li>
<li><a href="../index.html">home</a>| </li>
<li><a href="../examples/index.html">examples</a>| </li>
<li><a href="../gallery.html">gallery</a>| </li>
<li><a href="pyplot_summary.html">pyplot</a>| </li>
<li><a href="../contents.html">docs</a> »</li>
<li><a href="index.html" >The Matplotlib API</a> »</li>
<li><a href="index_backend_api.html" >backends</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2013 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the matplotlib development team.
Last updated on May 21, 2013.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2b1.
</div>
</body>
</html>