Correction to exporting docs

This commit is contained in:
Luke Campagnola 2014-10-03 10:33:08 -04:00
parent 35cacc78aa
commit 88bf8880e1

View File

@ -39,13 +39,14 @@ Exporting from the API
To export a file programatically, follow this example:: To export a file programatically, follow this example::
import pyqtgraph as pg import pyqtgraph as pg
import pyqtgraph.exporters
# generate something to export # generate something to export
plt = pg.plot([1,5,2,4,3]) plt = pg.plot([1,5,2,4,3])
# create an exporter instance, as an argument give it # create an exporter instance, as an argument give it
# the item you wish to export # the item you wish to export
exporter = pg.exporters.ImageExporter.ImageExporter(plt.plotItem) exporter = pg.exporters.ImageExporter(plt.plotItem)
# set export parameters if needed # set export parameters if needed
exporter.parameters()['width'] = 100 # (note this also affects height parameter) exporter.parameters()['width'] = 100 # (note this also affects height parameter)