本文整理匯總了Python中silx.gui.plot.PlotWidget.saveGraph方法的典型用法代碼示例。如果您正苦於以下問題:Python PlotWidget.saveGraph方法的具體用法?Python PlotWidget.saveGraph怎麽用?Python PlotWidget.saveGraph使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類silx.gui.plot.PlotWidget
的用法示例。
在下文中一共展示了PlotWidget.saveGraph方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: RGBCorrelatorGraph
# 需要導入模塊: from silx.gui.plot import PlotWidget [as 別名]
# 或者: from silx.gui.plot.PlotWidget import saveGraph [as 別名]
#.........這裏部分代碼省略.........
tb.setChecked(False)
if position is not None:
self.toolBarLayout.insertWidget(position, tb)
else:
self.toolBarLayout.addWidget(tb)
if action is not None:
tb.clicked.connect(action)
return tb
def __zoomReset(self):
self._zoomReset()
def _zoomReset(self, replot=None):
_logger.debug("_zoomReset")
if self.graph is not None:
self.graph.resetZoom()
def _yAutoScaleToggle(self):
if self.graph is not None:
self.yAutoScaleToolButton.setDown(
not self.graph.isYAxisAutoScale())
self.graph.setYAxisAutoScale(
not self.graph.isYAxisAutoScale())
def _xAutoScaleToggle(self):
if self.graph is not None:
self.xAutoScaleToolButton.setDown(
not self.graph.isXAxisAutoScale())
self.graph.setXAxisAutoScale(
not self.graph.isXAxisAutoScale())
def _copyIconSignal(self):
pngFile = BytesIO()
self.graph.saveGraph(pngFile, fileFormat='png')
pngFile.flush()
pngFile.seek(0)
pngData = pngFile.read()
pngFile.close()
image = qt.QImage.fromData(pngData, 'png')
qt.QApplication.clipboard().setImage(image)
def _saveIconSignal(self):
self.saveDirectory = PyMcaDirs.outputDir
fileTypeList = ["Image *.png",
"Image *.jpg",
"ZoomedImage *.png",
"ZoomedImage *.jpg",
"Widget *.png",
"Widget *.jpg"]
outfile = qt.QFileDialog(self)
outfile.setModal(1)
outfile.setWindowTitle("Output File Selection")
if hasattr(qt, "QStringList"):
strlist = qt.QStringList()
else:
strlist = []
for f in fileTypeList:
strlist.append(f)
if hasattr(outfile, "setFilters"):
outfile.setFilters(strlist)
else:
outfile.setNameFilters(strlist)
outfile.setFileMode(outfile.AnyFile)
outfile.setAcceptMode(qt.QFileDialog.AcceptSave)