/usr/share/doc/python-pyqtgraph-doc/html/exporting.html is in python-pyqtgraph-doc 0.9.8-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!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>Exporting — pyqtgraph documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '',
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="top" title="pyqtgraph documentation" href="index.html" />
<link rel="next" title="Rapid GUI prototyping" href="prototyping.html" />
<link rel="prev" title="Interactive Data Selection Controls" href="region_of_interest.html" />
</head>
<body>
<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="prototyping.html" title="Rapid GUI prototyping"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="region_of_interest.html" title="Interactive Data Selection Controls"
accesskey="P">previous</a> |</li>
<li><a href="index.html">pyqtgraph documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="exporting">
<h1>Exporting<a class="headerlink" href="#exporting" title="Permalink to this headline">¶</a></h1>
<p>PyQtGraph provides a variety of export formats for all 2D graphics. For 3D graphics, see <a class="reference internal" href="#exporting-3d-graphics">Exporting 3D Graphics</a> below.</p>
<div class="section" id="exporting-from-the-gui">
<h2>Exporting from the GUI<a class="headerlink" href="#exporting-from-the-gui" title="Permalink to this headline">¶</a></h2>
<p>Any 2D graphics can be exported by right-clicking on the graphic, then selecting ‘export’ from the context menu.
This will display the export dialog in which the user must:</p>
<ol class="arabic simple">
<li>Select an item (or the entire scene) to export. Selecting an item will cause the item to be hilighted in the original
graphic window (but this hilight will not be displayed in the exported file).</li>
<li>Select an export format.</li>
<li>Change any desired export options.</li>
<li>Click the ‘export’ button.</li>
</ol>
</div>
<div class="section" id="export-formats">
<h2>Export Formats<a class="headerlink" href="#export-formats" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Image - PNG is the default format. The exact set of image formats supported will depend on your Qt libraries. However,
common formats such as PNG, JPG, and TIFF are almost always available.</li>
<li>SVG - Graphics exported as SVG are targeted to work as well as possible with both Inkscape and
Adobe Illustrator. For high quality SVG export, please use PyQtGraph version 0.9.3 or later.
This is the preferred method for generating publication graphics from PyQtGraph.</li>
<li>CSV - Exports plotted data as CSV. This exporter _only_ works if a PlotItem is selected for export.</li>
<li>Matplotlib - This exporter opens a new window and attempts to re-plot the
data using matplotlib (if available). Note that some graphic features are either not implemented
for this exporter or not available in matplotlib. This exporter _only_ works if a PlotItem is selected
for export.</li>
<li>Printer - Exports to the operating system’s printing service. This exporter is provided for completeness,
but is not well supported due to problems with Qt’s printing system.</li>
</ul>
</div>
<div class="section" id="exporting-from-the-api">
<h2>Exporting from the API<a class="headerlink" href="#exporting-from-the-api" title="Permalink to this headline">¶</a></h2>
<p>To export a file programatically, follow this example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">pyqtgraph</span> <span class="kn">as</span> <span class="nn">pg</span>
<span class="c"># generate something to export</span>
<span class="n">plt</span> <span class="o">=</span> <span class="n">pg</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">3</span><span class="p">])</span>
<span class="c"># create an exporter instance, as an argument give it</span>
<span class="c"># the item you wish to export</span>
<span class="n">exporter</span> <span class="o">=</span> <span class="n">pg</span><span class="o">.</span><span class="n">exporters</span><span class="o">.</span><span class="n">ImageExporter</span><span class="o">.</span><span class="n">ImageExporter</span><span class="p">(</span><span class="n">plt</span><span class="o">.</span><span class="n">plotItem</span><span class="p">)</span>
<span class="c"># set export parameters if needed</span>
<span class="n">exporter</span><span class="o">.</span><span class="n">parameters</span><span class="p">()[</span><span class="s">'width'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">100</span> <span class="c"># (note this also affects height parameter)</span>
<span class="c"># save to file</span>
<span class="n">exporter</span><span class="o">.</span><span class="n">export</span><span class="p">(</span><span class="s">'fileName.png'</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="exporting-3d-graphics">
<h2>Exporting 3D Graphics<a class="headerlink" href="#exporting-3d-graphics" title="Permalink to this headline">¶</a></h2>
<p>The exporting functionality described above is not yet available for 3D graphics. However, it is possible to
generate an image from a GLViewWidget by using QGLWidget.grabFrameBuffer or QGLWidget.renderPixmap:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">glview</span><span class="o">.</span><span class="n">grabFrameBuffer</span><span class="p">()</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="s">'fileName.png'</span><span class="p">)</span>
</pre></div>
</div>
<p>See the Qt documentation for more information.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Exporting</a><ul>
<li><a class="reference internal" href="#exporting-from-the-gui">Exporting from the GUI</a></li>
<li><a class="reference internal" href="#export-formats">Export Formats</a></li>
<li><a class="reference internal" href="#exporting-from-the-api">Exporting from the API</a></li>
<li><a class="reference internal" href="#exporting-3d-graphics">Exporting 3D Graphics</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="region_of_interest.html"
title="previous chapter">Interactive Data Selection Controls</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="prototyping.html"
title="next chapter">Rapid GUI prototyping</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/exporting.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="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="prototyping.html" title="Rapid GUI prototyping"
>next</a> |</li>
<li class="right" >
<a href="region_of_interest.html" title="Interactive Data Selection Controls"
>previous</a> |</li>
<li><a href="index.html">pyqtgraph documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2011, Luke Campagnola.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>
|