Ejemplo n.º 1
0
    def __init__(self):
        # Check syntax
        super(PmtXYPlot, self).__init__()
        
        # Counter
        self.ctr = expt.getNICounter(gateTime=100)

        self.setCanvasBackground(QtGui.QColor("white"))
        #self.alignScales()


        self.x = arange(0.0, 100.1, 1.)
        self.y = zeros(len(self.x), Float)

        self.setTitle("PMT Counts")
        self.curve = Qwt.QwtPlotCurve("Counts")
        self.curve.attach(self)

        self.curve.setSymbol(Qwt.QwtSymbol(
            Qwt.QwtSymbol.Ellipse,
            QtGui.QBrush(QtGui.QColor("black")),
            QtGui.QPen(QtGui.QColor("black")),
            QtCore.QSize(5, 5),
        ))

        self.setAxisTitle(Qwt.QwtPlot.xBottom, "Time (units)")
        self.setAxisTitle(Qwt.QwtPlot.yLeft, "Counts/bin")
        
        self.startTimer(10)
Ejemplo n.º 2
0
    def __init__(self, QwtPlot, chartHistoryLen, **kwargs):
        curveColor = kwargs.get('curveColor', Qt.Qt.green)
        curveTitle = kwargs.get('curveTitle', '')
        self.curveMovement = kwargs.get('curveMovement', 0)

        self.curve = Qwt.QwtPlotCurve(curveTitle)
        self.x = arange(0, chartHistoryLen, 1)
        self.y = zeros(len(self.x), Float)
        self.curve.attach(QwtPlot)
        self.curve.setPen(Qt.QPen(curveColor))
        self.curve.setSymbol(
            Qwt.QwtSymbol(
                Qwt.QwtSymbol.Ellipse,
                Qt.QBrush(curveColor),
                Qt.QPen(curveColor),
                Qt.QSize(5, 5),
            ))