当前位置: 首页>>代码示例>>Python>>正文


Python PlotWidget.hideAxis方法代码示例

本文整理汇总了Python中pyqtgraph.PlotWidget.hideAxis方法的典型用法代码示例。如果您正苦于以下问题:Python PlotWidget.hideAxis方法的具体用法?Python PlotWidget.hideAxis怎么用?Python PlotWidget.hideAxis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyqtgraph.PlotWidget的用法示例。


在下文中一共展示了PlotWidget.hideAxis方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Ui_plotWindow

# 需要导入模块: from pyqtgraph import PlotWidget [as 别名]
# 或者: from pyqtgraph.PlotWidget import hideAxis [as 别名]
class Ui_plotWindow(QtGui.QWidget, subpanel):
    def setupUi(self, plotWindow, commTransport):
        plotWindow.setObjectName(_fromUtf8("plotWindow"))
        plotWindow.resize(818, 418)
        self.gridLayout = QtGui.QGridLayout(plotWindow)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.graphicsView = PlotWidget(plotWindow)
        self.graphicsView.setObjectName(_fromUtf8("graphicsView"))
        self.gridLayout.addWidget(self.graphicsView, 0, 0, 1, 1)

        self.retranslateUi(plotWindow)
        QtCore.QMetaObject.connectSlotsByName(plotWindow)
        
        self.serialComm = commTransport
        self.graphicsView.hideAxis('bottom')
        self.graphicsView.getAxis('left').setWidth(100)
        
        # custom code added
        '''
        self.dataPlot.hideAxis('bottom')
        self.dataPlot.showGrid(y=True)
        self.dataPlot.getAxis('left').setWidth(100)
        
        plotSize = 256
        self.plotCount = 6

        self.output = []
        for i in range(self.plotCount):
            self.output.append(deque([0.0]*plotSize))
            
        self.axis = deque(range(plotSize))
        self.value = plotSize
        '''

    def retranslateUi(self, plotWindow):
        plotWindow.setWindowTitle(QtGui.QApplication.translate("plotWindow", "Form", None, QtGui.QApplication.UnicodeUTF8))

    def readContinuousData(self, serialComm):
        '''
开发者ID:Kenny9999,项目名称:AeroQuadConfiguratorPyQt,代码行数:41,代码来源:dataPlotWindow.py

示例2: Tiare

# 需要导入模块: from pyqtgraph import PlotWidget [as 别名]
# 或者: from pyqtgraph.PlotWidget import hideAxis [as 别名]
class Tiare(QtGui.QMainWindow):
    def __init__(self, *args):
        QtGui.QMainWindow.__init__(self, *args)
        self.statusBar().showMessage('Pret')
        self.th = 0
        self.widget = QtGui.QWidget(self)
        exitAction = QtGui.QAction(QtGui.QIcon('exit.png'), '&Quitter', self)
        exitAction.setShortcut('Ctrl+Q')
        exitAction.setStatusTip("Ferme l'application")
        exitAction.triggered.connect(self.close)

        openAction = QtGui.QAction(QtGui.QIcon('open.png'), '&Charger', self)
        openAction.setShortcut('Ctrl+L')
        openAction.setStatusTip("Charge un fichier wav")
        openAction.triggered.connect(self.load)

        self.saveAction = QtGui.QAction(QtGui.QIcon('save.png'), '&Exporter', self)
        self.saveAction.setShortcut('Ctrl+S')
        self.saveAction.setStatusTip("Exporter en CSV")
        self.saveAction.triggered.connect(self.export)
        self.saveAction.setEnabled(False)
        menubar = self.menuBar()
        fileMenu = menubar.addMenu('&Fichier')
        fileMenu.addAction(openAction)
        fileMenu.addAction(self.saveAction)
        fileMenu.addAction(exitAction)

        self.th_slider = QtGui.QSlider(QtCore.Qt.Horizontal, self)
        self.th_slider.setValue(self.th)
        self.th_slider.valueChanged[int].connect(self.change_threshold)

        self.min_len = QtGui.QSlider(QtCore.Qt.Horizontal, self)
        self.min_len.setValue(10)
        self.min_len.setMinimum(1)
        self.min_len.setMaximum(100)
        self.min_len.valueChanged[int].connect(self.change_min_len)

        self.min_len_sil = QtGui.QSlider(QtCore.Qt.Horizontal, self)
        self.min_len_sil.setValue(10)
        self.min_len_sil.setMinimum(1)
        self.min_len_sil.setMaximum(100)
        self.min_len_sil.valueChanged[int].connect(self.change_min_len)


        # Make sizer and embed stuff
        self.sizer = QtGui.QVBoxLayout(self.widget)
        self.fig_signal = PlotWidget(self.widget, background="w")
        self.fig_signal.setLimits(xMin=0, yMin=-1, yMax=1, minXRange=1, maxXRange=30, minYRange=2, maxYRange=2)
        self.fig_energy = PlotWidget(self.widget, background="w")
        self.fig_energy.setXLink(self.fig_signal)
        self.fig_segments = PlotWidget(self.widget, background="w")
        self.fig_segments.setXLink(self.fig_signal)
        self.fig_segments.hideAxis('bottom')
        self.fig_segments.hideAxis('left')
        self.fig_segments.setLimits(yMin=-1, yMax=1, minYRange=2, maxYRange=2)

        self.sizer.addWidget(self.fig_signal, 5)
        self.sizer.addWidget(self.fig_energy, 5)
        self.sizer.addWidget(self.fig_segments, 3)
        self.sizer.addWidget(QtGui.QLabel('Seuil de segmentation'), 0)
        self.sizer.addWidget(self.th_slider, 0)
        self.min_seg_label = QtGui.QLabel('Longeur minimal de segment (%.3f s)' % (float(self.min_len.value())/100))
        self.sizer.addWidget(self.min_seg_label, 0)
        self.sizer.addWidget(self.min_len, 0)

        self.min_sil_label = QtGui.QLabel('Longeur minimal de silence (%.3f s)' % (float(self.min_len_sil.value())/100))
        self.sizer.addWidget(self.min_sil_label, 0)
        self.sizer.addWidget(self.min_len_sil, 0)

        # Apply sizers
        self.setCentralWidget(self.widget)

        # Finish
        self.resize(560, 420)
        self.setWindowTitle('Tiare')
        self.energy_tl, self.energy = [], []
        self.thline = None
        self.seg_up = None
        self.seg_down = None
        self.fig_energy_plot = None
        self.segments = []
        self.samples = []
        self.sr = 0
        self.filepath = None
        self.widget.hide()
        self.show()

    def change_threshold(self, value):
        value = float(value)/100
        if self.thline is not None :
            self.thline.setData([self.energy_tl[0], self.energy_tl[-1]], [value]*2)
            self.segments = map(lambda (x, y): (self.energy_tl[x],self.energy_tl[y]),
                                cut(self.energy, value, self.min_len.value(), self.min_len_sil.value()))
            x = [v for start, stop in self.segments for v in [start, start, stop, stop]]
            y = [v for _ in self.segments for v in [-0.85, 0.85, 0.85, -0.85]]
            self.seg_up.setData(x, y)
            self.seg_down.setData([self.energy_tl[0], self.energy_tl[-1]], [-0.85, -0.85])

    def change_min_len(self, value=0):
        self.min_seg_label.setText("Longeur minimale d'un segment (%.3f s)" % (float(self.min_len.value())/100))
#.........这里部分代码省略.........
开发者ID:LeCoz,项目名称:Tiare,代码行数:103,代码来源:__init__.py

示例3: CamViewer

# 需要导入模块: from pyqtgraph import PlotWidget [as 别名]
# 或者: from pyqtgraph.PlotWidget import hideAxis [as 别名]
class CamViewer(Display):
    # Emitted when the user changes the value.
    roi_x_signal = Signal(str)
    roi_y_signal = Signal(str)
    roi_w_signal = Signal(str)
    roi_h_signal = Signal(str)

    def __init__(self, parent=None, args=None):
        super(CamViewer, self).__init__(parent=parent, args=args)

        # Set up the list of cameras, and all the PVs
        test_dict = { "image": "ca://MTEST:Image", "max_width": "ca://MTEST:ImageWidth", "max_height": "ca://MTEST:ImageWidth", "roi_x": None, "roi_y": None, "roi_width": None, "roi_height": None }
        # self.cameras = { "VCC": vcc_dict, "C-Iris": c_iris_dict, "Test": test_dict }
        self.cameras = {"Testing IOC Image": test_dict }
        self._channels = []
        self.imageChannel = None

        # Populate the camera combo box
        self.ui.cameraComboBox.clear()
        for camera in self.cameras:
            self.ui.cameraComboBox.addItem(camera)

        # When the camera combo box changes, disconnect from PVs, re-initialize, then reconnect.
        self.ui.cameraComboBox.activated[str].connect(self.cameraChanged)

        # Set up the color map combo box.
        self.ui.colorMapComboBox.clear()
        for key, map_name in cmap_names.items():
            self.ui.colorMapComboBox.addItem(map_name, userData=key)
        self.ui.imageView.colorMap = self.ui.colorMapComboBox.currentData()
        self.ui.colorMapComboBox.activated[str].connect(self.colorMapChanged)

        # Set up the color map limit sliders and line edits.
        # self._color_map_limit_sliders_need_config = True
        self.ui.colorMapMinSlider.valueChanged.connect(self.setColorMapMin)
        self.ui.colorMapMaxSlider.valueChanged.connect(self.setColorMapMax)
        self.ui.colorMapMinLineEdit.returnPressed.connect(self.colorMapMinLineEditChanged)
        self.ui.colorMapMaxLineEdit.returnPressed.connect(self.colorMapMaxLineEditChanged)

        # Set up the stuff for single-shot and average modes.
        self.ui.singleShotRadioButton.setChecked(True)
        self._average_mode_enabled = False
        self.ui.singleShotRadioButton.clicked.connect(self.enableSingleShotMode)
        self.ui.averageRadioButton.clicked.connect(self.enableAverageMode)
        self.ui.numShotsLineEdit.returnPressed.connect(self.numAverageChanged)

        # Add a plot for vertical lineouts
        self.yLineoutPlot = PlotWidget()
        self.yLineoutPlot.setMaximumWidth(80)
        self.yLineoutPlot.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Expanding)
        self.yLineoutPlot.getPlotItem().invertY()
        self.yLineoutPlot.hideAxis('bottom')
        # self.yLineoutPlot.setYLink(self.ui.imageView.getView())
        self.ui.imageGridLayout.addWidget(self.yLineoutPlot, 0, 0)
        self.yLineoutPlot.hide()
        # We do some mangling of the .ui file here and move the imageView over a cell, kind of ugly.
        self.ui.imageGridLayout.removeWidget(self.ui.imageView)
        self.ui.imageGridLayout.addWidget(self.ui.imageView, 0, 1)

        # Add a plot for the horizontal lineouts
        self.xLineoutPlot = PlotWidget()
        self.xLineoutPlot.setMaximumHeight(80)
        self.xLineoutPlot.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
        self.xLineoutPlot.hideAxis('left')
        # self.xLineoutPlot.setXLink(self.ui.imageView.getView())
        self.ui.imageGridLayout.addWidget(self.xLineoutPlot, 1, 1)
        self.xLineoutPlot.hide()

        # Update the lineout plot ranges when the image gets panned or zoomed
        self.ui.imageView.getView().sigRangeChanged.connect(self.updateLineoutRange)

        # Instantiate markers.
        self.marker_dict = {1:{}, 2:{}, 3:{}, 4:{}}
        marker_size = QPointF(20., 20.)
        self.marker_dict[1]['marker'] = ImageMarker((0, 0), size=marker_size, pen=mkPen((100, 100, 255), width=5))
        self.marker_dict[1]['button'] = self.ui.marker1Button
        self.marker_dict[1]['xlineedit'] = self.ui.marker1XPosLineEdit
        self.marker_dict[1]['ylineedit'] = self.ui.marker1YPosLineEdit

        self.marker_dict[2]['marker'] = ImageMarker((0, 0), size=marker_size, pen=mkPen((255, 100, 100), width=5))
        self.marker_dict[2]['button'] = self.ui.marker2Button
        self.marker_dict[2]['xlineedit'] = self.ui.marker2XPosLineEdit
        self.marker_dict[2]['ylineedit'] = self.ui.marker2YPosLineEdit

        self.marker_dict[3]['marker'] = ImageMarker((0, 0), size=marker_size, pen=mkPen((60, 255, 60), width=5))
        self.marker_dict[3]['button'] = self.ui.marker3Button
        self.marker_dict[3]['xlineedit'] = self.ui.marker3XPosLineEdit
        self.marker_dict[3]['ylineedit'] = self.ui.marker3YPosLineEdit

        self.marker_dict[4]['marker'] = ImageMarker((0, 0), size=marker_size, pen=mkPen((255, 60, 255), width=5))
        self.marker_dict[4]['button'] = self.ui.marker4Button
        self.marker_dict[4]['xlineedit'] = self.ui.marker4XPosLineEdit
        self.marker_dict[4]['ylineedit'] = self.ui.marker4YPosLineEdit
        # Disable auto-ranging the image (it feels strange when the zoom changes as you move markers around.)
        self.ui.imageView.getView().disableAutoRange()
        for d in self.marker_dict:
            marker = self.marker_dict[d]['marker']
            marker.setZValue(20)
            marker.hide()
            marker.sigRegionChanged.connect(self.markerMoved)
#.........这里部分代码省略.........
开发者ID:slaclab,项目名称:pydm,代码行数:103,代码来源:camviewer.py


注:本文中的pyqtgraph.PlotWidget.hideAxis方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。