Пример #1
0
 def polarUpdate(self, value, theta):
     """
     Updates the plot and redraws it
     """
     
     self.restore_region(self.background)
     if theta < 54 and theta >= 0:
         self.r[53-theta] = rangeConvert(value,0,"cm") #reverse the theta becase of the way the polar-plot works
     
     self.line[0].set_ydata(self.r)
     self.line[1].set_ydata(self.r)
     
     self.ax.draw_artist(self.line[0])
     self.ax.draw_artist(self.line[1])
     
     self.blit(self.ax.bbox)        
Пример #2
0
    def updatePlot(self, newValue, angle):
        """
        Add a new value to this chart, somewhere. Angle is unused atm
        """
        self.data[1:] = self.data[0:-1]

        self.data[0] = rangeConvert(newValue,0,"cm")
        
        self.timeData += self.timer.elapsed()*0.001 #scale to MS (timer.elapsed returns an int-number of MS)

        self.timer.restart()
        
        #rescale x axis
        self.setAxisScale(
            Qwt.QwtPlot.xBottom, self.timeData[-1], self.timeData[0])
        
        #update the data that we plot
        self.curve.setData(self.timeData, self.data)
        self.replot()