# adding a regular data item (non-taurus) c1 = pg.PlotDataItem( name="st plot", pen=dict(color="y", width=3, style=QtCore.Qt.DashLine), fillLevel=0.3, fillBrush="g", ) c1.setData(numpy.arange(300) / 300.0) w.addItem(c1) # adding a taurus data item c2 = TaurusPlotDataItem(name="st2 plot", pen="r", symbol="o", symbolSize=10) c2.setModel("sys/tg_test/1/wave") w.addItem(c2) # attach tool to plot item of the PlotWidget tool = CurvesPropertiesTool() tool.attachToPlotItem(w.getPlotItem(), y2=y2ViewBox) w.show() # directly trigger the tool tool.trigger() sys.exit(app.exec_())
c1 = pg.PlotDataItem(name='st plot', pen='b', fillLevel=0, brush='c') c1.setData(numpy.arange(300) / 300.) w.addItem(c1) pen = pg.mkPen(color='r', style=4) brush = pg.mkBrush(color='b') brush.setStyle(3) # adding a taurus data item # c2 = TaurusPlotDataItem(name='st2 plot', pen='r', symbol='o') c2 = TaurusPlotDataItem(pen=pen, name='foo') # c2 = TaurusPlotDataItem() # c2.loadConfigFile('tmp/conf.cfg') c2.setModel('eval:Quantity(rand(256),"m")') # c2.setModel('sys/tg_test/1/wave') # c2.setModel(None) # c2.setXModel(None) # c2.setXModel('eval:Quantity(rand(256),"m")') w.addItem(c2) # ...and remove it after a while def rem(): w.removeItem(c2) Qt.QTimer.singleShot(2000, rem) modelchooser = TaurusModelChooserTool(itemClass=TaurusPlotDataItem)
y2ViewBox = Y2ViewBox() y2ViewBox.attachToPlotItem(w.getPlotItem()) # adding a regular data item (non-taurus) c1 = pg.PlotDataItem( name='st plot', pen=dict(color='y', width=3, style=QtCore.Qt.DashLine), fillLevel=0.3, fillBrush='g' ) c1.setData(numpy.arange(300)/300.) w.addItem(c1) # adding a taurus data item c2 = TaurusPlotDataItem(name='st2 plot', pen='r', symbol='o', symbolSize=10) c2.setModel('sys/tg_test/1/wave') w.addItem(c2) # attach tool to plot item of the PlotWidget tool = CurvesPropertiesTool() tool.attachToPlotItem(w.getPlotItem(), y2=y2ViewBox) w.show() # directly trigger the tool tool.trigger () sys.exit(app.exec_())