def addPolyLine(self):
[[xmin, xmax], [ymin, ymax]] = self.plot.viewRange()
self.poly_line = pg.PolyLineROI(
positions=[(xmin+(xmax-xmin)*.4,
ymin+(ymax-ymin)*.4),
(xmin+(xmax-xmin)*.6,
ymin+(ymax-ymin)*.6)],
pen=pg.mkPen('g', width=2))
self.plot.addItem(self.poly_line)
self.updateTransPlot()
self.poly_line.sigRegionChangeFinished.connect(
self.updateTransPlot)
评论列表
文章目录