Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EO Time Series Viewer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin Jakimow
EO Time Series Viewer
Commits
4cbc0124
Commit
4cbc0124
authored
12 years ago
by
Luke Campagnola
Browse files
Options
Downloads
Patches
Plain Diff
Added documentation on exporting
parent
927f032f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/source/exporting.rst
+67
-0
67 additions, 0 deletions
doc/source/exporting.rst
doc/source/index.rst
+1
-0
1 addition, 0 deletions
doc/source/index.rst
with
68 additions
and
0 deletions
doc/source/exporting.rst
0 → 100644
+
67
−
0
View file @
4cbc0124
Exporting
=========
PyQtGraph provides a variety of export formats for all 2D graphics. For 3D graphics, see `Exporting 3D Graphics`_ below.
Exporting from the GUI
----------------------
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:
#. 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).
#. Select an export format.
#. Change any desired export options.
#. Click the 'export' button.
Export Formats
--------------
* 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.
* 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.
* CSV - Exports plotted data as CSV. This exporter _only_ works if a PlotItem is selected for export.
* 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.
* 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.
Exporting from the API
----------------------
To export a file programatically, follow this example::
import pyqtgraph as pg
# generate something to export
plt = pg.plot([1,5,2,4,3])
# create an exporter instance, as an argument give it
# the item you wish to export
exporter = pg.exporters.ImageExporter.ImageExporter(plt.plotItem)
# set export parameters if needed
exporter.parameters()['width'] = 100 # (note this also affects height parameter)
# save to file
exporter.export('fileName.png')
Exporting 3D Graphics
---------------------
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::
glview.grabFrameBuffer().save('fileName.png')
See the Qt documentation for more information.
This diff is collapsed.
Click to expand it.
doc/source/index.rst
+
1
−
0
View file @
4cbc0124
...
...
@@ -20,6 +20,7 @@ Contents:
3dgraphics
style
region_of_interest
exporting
prototyping
parametertree/index
internals
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment