def clear_graph(self):
# reset caching. if not, it is not cleared when view changing when zoomed
self.highlighted = None
self.curves_cont.setCacheMode(QGraphicsItem.NoCache)
self.curves_cont.setCacheMode(QGraphicsItem.DeviceCoordinateCache)
self.plot.vb.disableAutoRange()
self.curves_cont.clear()
self.curves_cont.update()
self.plotview.clear()
self.multiple_curves_info = []
self.curves_plotted = [] # currently plotted elements (for rescale)
self.curves = [] # for finding closest curve
self.plotview.addItem(self.label, ignoreBounds=True)
self.highlighted_curve = pg.PlotCurveItem(pen=self.pen_mouse)
self.highlighted_curve.setZValue(10)
self.highlighted_curve.hide()
self.plot.addItem(self.highlighted_curve)
self.plot.addItem(self.vLine, ignoreBounds=True)
self.plot.addItem(self.hLine, ignoreBounds=True)
self.viewhelpers = True
self.plot.addItem(self.curves_cont)
for m in self.markings:
self.plot.addItem(m, ignoreBounds=True)
评论列表
文章目录