本文整理汇总了Python中pyqtgraph.GraphicsLayoutWidget.setAntialiasing方法的典型用法代码示例。如果您正苦于以下问题:Python GraphicsLayoutWidget.setAntialiasing方法的具体用法?Python GraphicsLayoutWidget.setAntialiasing怎么用?Python GraphicsLayoutWidget.setAntialiasing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph.GraphicsLayoutWidget
的用法示例。
在下文中一共展示了GraphicsLayoutWidget.setAntialiasing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Aditi
# 需要导入模块: from pyqtgraph import GraphicsLayoutWidget [as 别名]
# 或者: from pyqtgraph.GraphicsLayoutWidget import setAntialiasing [as 别名]
class Aditi(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
# title
self.setWindowTitle("Aditi")
self.setDockOptions(QMainWindow.VerticalTabs | QMainWindow.AnimatedDocks)
#self.showMaximized()
# model
self.rawfiles_by_short_path = {}
self.xic_by_rawfile_short_path = {}
self.tic_by_rawfile_short_path = {}
self.spec_by_rawfile_short_path = {}
self.inf_line_tic_item = None
self.curr_scan_id_by_short_path = {}
# menu
self.file_menu = self.menuBar().addMenu('&File')
#self.file_menu.setTearOffEnabled(False)
open_action = QAction("&Open...", self)
open_action.setToolTip("Open a rawfile")
open_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_O))
self.file_menu.addAction(open_action)
open_action.triggered.connect(self.show_open_dialog)
exit_action = QAction("&Exit", self)
exit_action.setShortcut(QKeySequence(Qt.CTRL + Qt.Key_Q))
self.file_menu.addAction(exit_action)
exit_action.triggered.connect(self.quit)
self.tab_widget = QTabWidget(self)
# spectrum plot Widget
self.graphics_layout_widget = GraphicsLayoutWidget(parent=self.tab_widget)
self.graphics_layout_widget.keyPressEvent = self.handle_key_press_event
self.graphics_layout_widget.useOpenGL(False)
self.graphics_layout_widget.setAntialiasing(False)
self.plot_widget_tic = self.graphics_layout_widget.addPlot(title="TIC(s)",
labels={'left': "Intensity",
'bottom': "Retention Time (sec)"})
self.plot_widget_tic.showGrid(x=True, y=True)
self.graphics_layout_widget.nextRow()
self.plot_widget_spectrum = self.graphics_layout_widget.addPlot(title="Spectrum", labels={'left': "Intensity",
'bottom': "m/z"})
self.plot_widget_spectrum.showGrid(x=True, y=True)
# finally add tab
self.tab_widget.addTab(self.graphics_layout_widget, "Spectrum")
# Xic plotWidget
self.plot_widget_xic = PlotWidget(name="MainPlot", labels={'left': "Intensity",
'bottom': "Retention Time (sec)"})
self.plot_widget_xic.showGrid(x=True, y=True)
self.tab_widget.addTab(self.plot_widget_xic, "Xic extraction")
self.setCentralWidget(self.tab_widget)
self.statusBar().showMessage("Ready")
# dock 1
self.rawfile_dock_widget = QDockWidget("Rawfiles")
self.rawfile_table_view = QTableView()
self.rawfile_table_view.horizontalHeader().setVisible(False)
self.rawfile_table_view.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
self.rawfile_dock_widget.setWidget(self.rawfile_table_view)
self.rawfile_model = QStandardItemModel()
self.rawfile_model.setHorizontalHeaderLabels(["Rawfiles"])
self.rawfile_table_view.setModel(self.rawfile_model)
self.rawfile_model.itemChanged.connect(self.item_changed)
self.addDockWidget(0x2, self.rawfile_dock_widget)
# xic dock widget extraction parameter
self.xic_dock_widget = QDockWidget("Xic extraction")
self.xic_widget = XicWidget()
self.xic_widget.plotButton.clicked.connect(self.plot)
self.xic_dock_widget.setWidget(self.xic_widget)
self.addDockWidget(0x2, self.xic_dock_widget)
def handle_key_press_event(self, evt):
if self.inf_line_tic_item is None:
return
times = []
if evt.key() == Qt.Key_Left:
for rawfile in self.rawfiles_by_short_path.values()[:1]:
if not rawfile.is_checked:
#.........这里部分代码省略.........