本文整理汇总了Python中pyqtgraph.setConfigOption函数的典型用法代码示例。如果您正苦于以下问题:Python setConfigOption函数的具体用法?Python setConfigOption怎么用?Python setConfigOption使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setConfigOption函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
QtGui.QMainWindow.__init__(self) # These three commands
Ui_MainWindow.__init__(self) # are needed to
pg.setConfigOption('background', 'w') # sets graph background to white
pg.setConfigOption('foreground', 'k') # sets axis color to black
self.setupUi(self) # to setup the ui
# La logica di programmare una interfaccia mi sembra la seguente:
# per prima cosa inizializzo l'interfaccia grafica
# dopo aver inizializzato l'interfaccia
# (che modifico e organizzo tramite Qt Creator)
# associo ad ogni azione che eseguo sulla interfaccia
# un metodo della classe che definisco a seguito
self.btnStart.clicked.connect(self.Start)
self.timer = QtCore.QTimer(self) # qui richiamo l'oggetto timer delle libreria QT
self.timer.timeout.connect(self.UpdateView) # e gli dico che quando il timer va in timeout devo fare l'update dells visuale
# le istruzioni seguenti servono a disabilitare il mouse su tutti
# i possobili plot dell'interfaccia
self.pltMonitor.setMouseEnabled(x=False,y=False)
self.pltAlign.setMouseEnabled(x=False,y=False)
self.pltDelay.setMouseEnabled(x=False,y=False)
self.NumCh = 8
self.inAcq = False # flag di acquisizione in corso o meno
self.getParameters()
开发者ID:qLuxor,项目名称:pylabtools,代码行数:31,代码来源:channels.py
示例2: __init__
def __init__(self, name="Demo", icon="cwicon"):
super(MainChip, self).__init__()
self.manageTraces = TraceManagerDialog(self)
# self.manageTraces.tracesChanged.
self.name = name
self.filename = None
self.dirty = True
self.projEditWidget = ProjectTextEditor(self)
self.projectChanged.connect(self.projEditWidget.setProject)
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
self.lastMenuActionSection = None
self.initUI(icon)
self.paramTrees = []
self.originalStdout = None
#Fake widget for dock
#TODO: Would be nice if this auto-resized to keep small, but not amount of playing
#with size policy or min/max sizes has worked.
fake = QWidget()
self.setCentralWidget(fake)
self.paramScripting = self.addConsole("Script Commands", visible=False)
self.addPythonConsole()
开发者ID:firebitsbr,项目名称:chipwhisperer,代码行数:25,代码来源:MainChip.py
示例3: __init__
def __init__(self, xtitle, ytitle,*args):
super(QBPlot, self).__init__(*args)
self.setupUi(self)
self.x_axis_title = xtitle
self.y_axis_title = ytitle
pg.setConfigOption('background', (226, 226, 226))
pg.setConfigOption('foreground', 'k')
开发者ID:emptyewer,项目名称:DEEPN,代码行数:7,代码来源:plot.py
示例4: figure
def figure(title = None, background='w'):
if background == 'w':
pg.setConfigOption('background', 'w') # set background to white
pg.setConfigOption('foreground', 'k')
pg.mkQApp()
win = pg.GraphicsWindow(title=title)
return win
开发者ID:pbmanis,项目名称:pylibrary,代码行数:7,代码来源:pyqtgraphPlotHelpers.py
示例5: __init__
def __init__(self, versionNo):
print("PyVNA __init__()")
self.version = versionNo
pyqtgraph.setConfigOption('background', 'w')
pyqtgraph.setConfigOption('foreground', 'k')
self.vna_idx = 1
super(PyVNA, self).__init__()
icopath = "./Akela Logo.ico"
# Icon isn't on current path, and we're running in a frozen context,
# so therefore look for the icon at the frozen location.
if not os.path.exists(icopath) and getattr(sys, 'frozen', False):
icopath = os.path.join(sys._MEIPASS, icopath)
icon = QIcon(icopath)
self.setWindowIcon(icon)
self.vnas = []
self.initUI()
self.setWindowTitle("OpenVNA Python Example Program")
开发者ID:AkelaInc,项目名称:OpenVNA-Python-Demo,代码行数:25,代码来源:GUI.py
示例6: __init__
def __init__(self, args):
self.args = args
#QtGui.QApplication.setGraphicsSystem('raster')
app = QtGui.QApplication([])
#mw = QtGui.QMainWindow()
#mw.resize(800,800)
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
win = pg.GraphicsWindow(title="Basic plotting examples")
win.resize(1000,600)
win.setWindowTitle('plot')
# Enable antialiasing for prettier plots
pg.setConfigOptions(antialias=True)
self.order_book_plot = OrderBookPlot(self.args, win)
if self.args.enable_sample_mode:
timer = QtCore.QTimer()
timer.timeout.connect(self.update_sample)
timer.start(500)
else:
thread = RabbitMQThread(self.args)
thread.newData.connect(self.order_book_plot.update)
thread.start()
import sys
## Start Qt event loop unless running in interactive mode or using pyside.
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
开发者ID:bigtonylewis,项目名称:rabbit4mt4,代码行数:33,代码来源:receive_dom_plot_pyqtgraph.py
示例7: plot
def plot(self, Rs=None, Vg=0):
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
# Generate plot
plt = pg.plot(title=self.__class__.__name__, clear=True)
plt.setYRange(0, self.IDSS_MAX)
plt.setXRange(self.VP_MAX, 0)
plt.showGrid(True, True, 1.0)
plt.setLabel('left', "Id (mA)")
plt.setLabel('bottom', "Vgs (V)")
(x, y) = self.id_max_points()
plt.plot(x, y, pen=pg.mkPen('g', width=3))
(x, y) = self.id_min_points()
plt.plot(x, y, pen=pg.mkPen('b', width=3))
if Rs is not None:
(x, y) = self.vg_intercept(Rs, Vg)
plt.plot(x, y, pen=pg.mkPen('r', width=3))
# Display plot
QtGui.QApplication.instance().exec_()
pg.exit()
开发者ID:devttys0,项目名称:EE,代码行数:25,代码来源:jfet.py
示例8: __init__
def __init__(self, stream, buf_size, col="w", chnames=False, invert=False):
""" Initializes the grapher.
Args:
stream: <pylsl.StreamInfo instance> pointer to a stream
buf_size: <integer> visualization buffer length in samples
col: <char> color of the line plot (b,r,g,c,m,y,k and w)
"""
self.stream = stream
self.inlet = pylsl.StreamInlet(stream)
self.buf_size = buf_size
self.channel_count = self.inlet.channel_count
self.gbuffer = np.zeros(self.buf_size * self.channel_count)
self.gtimes = np.zeros(self.buf_size) + pylsl.local_clock()
self.col = col
if chnames:
if self.channel_count == len(chnames):
self.chnames = chnames
else:
print("Channel names vs channel count mismatch, skipping")
else:
self.chnames = False
if invert:
pg.setConfigOption("background", "w")
pg.setConfigOption("foreground", "k")
self.fill_buffer()
self.start_graph()
开发者ID:jtorniainen,项目名称:lslgraph,代码行数:30,代码来源:lslgraph.py
示例9: __init__
def __init__(self,filename,env,parent=None):
super(correlateAttributes,self).__init__(parent)
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
self.fileName=filename
self.setWindowTitle("Correlate attributes")
self.resize(1000,1000)
self.env=env
self.attr1=QtGui.QLineEdit()
self.attr2=QtGui.QLineEdit()
formbox=QtGui.QFormLayout()
formbox.addRow('Name of attribute 1 : ',self.attr1)
formbox.addRow('Name of attribute 2 : ',self.attr2)
form=QtGui.QFrame()
form.setLayout(formbox)
self.p1=pg.PlotWidget()
button1=QtGui.QPushButton('Calculate correlation')
button1.clicked.connect(self.calculate)
vbox1=QtGui.QVBoxLayout()
vbox1.addStretch(1)
vbox1.addWidget(form)
vbox1.addWidget(button1)
vbox1.addWidget(self.p1)
self.setLayout(vbox1)
self.show()
开发者ID:albanatita,项目名称:data-process,代码行数:25,代码来源:processActions.py
示例10: __init__
def __init__(self, plot_params):
pg.setConfigOption('background', 'w')
self.pw = pg.PlotWidget(pen=pg.mkPen('b', width=4))
self.pw.setYRange(-0.4,0.4)
self.pw.disableAutoRange(ViewBox.ViewBox.YAxis)
self.pw.hideButtons()
self.bar_color = (100,100,255)
self.data = {}# All of the data points ever received
self.plot_data = {}# The datapoints that are shown on the screen
self.plots = {}
self.lines = set()
self.listeners = []
plot_params.setdefault("type", "bar")
if plot_params['type'] == "bar":
self.bar = True
self.bar_buffer = {} # A buffer that holds datapoints until they are averaged into bars
self.dp_counter = {} # The number of datapoints in the buffer so far
if 'bar_width' in plot_params:
self.bar_width = int(plot_params['bar_width'])
else:
self.bar_width = 15
else:
self.bar = False
print "'", plot_params['signals'], "'"
for sig in plot_params['signals'].split(","):
signal_name = self.read_signal(sig)
self.lines = self.lines.union(signal_name)
开发者ID:g4-KN,项目名称:fealines,代码行数:28,代码来源:EEGPlot.py
示例11: __init__
def __init__(self):
QtGui.QMainWindow.__init__(self)
Ui_MainWindow.__init__(self)
pg.setConfigOption('background', 'w') # sets background to white
pg.setConfigOption('foreground', 'k') # sets axis color to black
self.setupUi(self)
self.btnStart.clicked.connect(self.Start)
self.tabWidget.currentChanged.connect(self.SetupView)
self.timer = QtCore.QTimer(self)
self.timer.timeout.connect(self.UpdateView)
self.curTab = self.tabWidget.currentIndex()
self.SetupView(self.curTab)
self.pltMonitor.setMouseEnabled(x=False,y=False)
self.pltAlign.setMouseEnabled(x=False,y=False)
self.pltDelay.setMouseEnabled(x=False,y=False)
self.pltSingle.setMouseEnabled(x=False,y=False)
self.pltCoinc.setMouseEnabled(x=False,y=False)
self.pltSingleVis.setMouseEnabled(x=False,y=False)
self.pltCoincVis.setMouseEnabled(x=False,y=False)
self.inAcq = False
self.getParameters()
开发者ID:matteoschiav,项目名称:pylabtools,代码行数:29,代码来源:monitor.py
示例12: set_pg_colors
def set_pg_colors(form):
'''Set default BG and FG color for pyqtgraph plots.'''
bgColorRGBA = form.palette().color(QtGui.QPalette.ColorRole.Window)
fgColorRGBA = form.palette().color(QtGui.QPalette.ColorRole.WindowText)
pg.setConfigOption('background', bgColorRGBA)
pg.setConfigOption('foreground', fgColorRGBA)
pg.setConfigOptions(antialias=True) ## this will be expensive for the local plot
开发者ID:sjara,项目名称:taskontrol,代码行数:7,代码来源:sidesplot.py
示例13: __init__
def __init__(self, parent = None):
QtGui.QWidget.__init__(self, parent)
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
pg.setConfigOptions(antialias=False)
self.scopeWidget = pg.PlotWidget()
self.scopeWidget.setTitle('Scope trace', size='12')
self.vbl = QtGui.QVBoxLayout()
self.vbl.addWidget(self.scopeWidget)
self.setLayout(self.vbl)
self.scopeWidget.setLabel('left', 'Signal', units='V')
self.scopeWidget.setLabel('bottom', 'Time', units='s')
self.scopeWidget.showGrid(x=False, y=True)
self.scopeWidget.clear()
self.lr1 = pg.LinearRegionItem([0,0], brush=pg.mkBrush(0,0,160,80))
self.lr2 = pg.LinearRegionItem([0,0], brush=pg.mkBrush(52,124,23,80))
self.lr1.setZValue(10)
self.lr2.setZValue(10)
self.scopeWidget.addItem(self.lr2)
self.scopeWidget.addItem(self.lr1)
self.lr1.setMovable(False)
self.lr2.setMovable(False)
开发者ID:mikekohlhoff,项目名称:ryexpctl,代码行数:25,代码来源:PyQtGraphWidgetScope.py
示例14: __init__
def __init__(self):
QtGui.QWidget.__init__(self)
subpanel.__init__(self)
#pg.setConfigOption('background', (255,255,255))
pg.setConfigOption('foreground', (128,128,128))
self.ui = Ui_plotWindow()
self.ui.setupUi(self)
self.ui.graphicsView.hideAxis('bottom')
self.ui.graphicsView.getAxis('top').setHeight(10)
self.ui.graphicsView.getAxis('bottom').setHeight(10)
self.ui.graphicsView.getAxis('left').setWidth(50)
self.ui.graphicsView.setBackground((255,255,255))
#brush = QtGui.QBrush()
#self.ui.graphicsView.setForegroundBrush(brush.color(QtGui.QColor('grey')))
self.plotCount = 0
self.legend = None
self.colors = [QtGui.QColor('blue'),
QtGui.QColor('red'),
QtGui.QColor('lime'),
QtGui.QColor('cornflowerblue'),
QtGui.QColor('greenyellow'),
QtGui.QColor('violet'),
QtGui.QColor('orange'),
QtGui.QColor('deepskyblue'),
QtGui.QColor('firebrick'),
QtGui.QColor('aqua')]
开发者ID:Zekan,项目名称:AeroQuadConfiguratorPyQt,代码行数:29,代码来源:dataPlot.py
示例15: setupGUI
def setupGUI(self):
self.setWindowTitle("Calculator plot")
self.setGeometry(80, 50, 800, 600)
self.setWindowIcon(QtGui.QIcon('../images/Logo.png'))
pg.setConfigOption('background', (255,255,255))
pg.setConfigOption('foreground',(0,0,0))
self.layout = QtGui.QVBoxLayout()
self.layout.setContentsMargins(0,0,0,0)
self.layout.setSpacing(0)
self.setLayout(self.layout)
# split window into two halfs
self.splitter = QtGui.QSplitter()
self.splitter.setOrientation(QtCore.Qt.Horizontal)
self.layout.addWidget(self.splitter)
self.tree = pg.TreeWidget()
self.sublayout = pg.GraphicsLayoutWidget()
self.splitter.addWidget(self.tree)
self.splitter.addWidget(self.sublayout)
self.plt = self.sublayout.addPlot()
setup_plot(self.plt)
pg.setConfigOptions(antialias=True)
self.tree.setHeaderHidden(True)
self.tree.setDragEnabled(False)
self.tree.setIndentation(10)
self.tree.setColumnCount(3)
self.tree.setColumnWidth(0, 110)
self.tree.setColumnWidth(1, 90)
self.tree.setColumnWidth(2, 5)
optItem = pg.TreeWidgetItem(['Options'])
xNameItem = pg.TreeWidgetItem(['x title'])
yNameItem = pg.TreeWidgetItem(['y title'])
optItem.addChild(xNameItem)
optItem.addChild(yNameItem)
addPlotItem = pg.TreeWidgetItem()
self.addPlotButton = QtGui.QPushButton('Add')
self.enterAction = QtGui.QAction('',self,shortcut='Return')
self.addAction(self.enterAction)
self.applyButton = QtGui.QPushButton('Apply')
self.applyButton.setDisabled(True)
addPlotItem.setWidget(0,self.applyButton)
addPlotItem.setWidget(1,self.addPlotButton)
self.items = pg.TreeWidgetItem(['Items'])
self.tree.addTopLevelItem(optItem)
self.tree.addTopLevelItem(self.items)
self.tree.addTopLevelItem(pg.TreeWidgetItem())
self.tree.addTopLevelItem(addPlotItem)
optItem.setExpanded(True)
self.xNameEdit = QtGui.QLineEdit('X')
self.yNameEdit = QtGui.QLineEdit('Y')
xNameItem.setWidget(1,self.xNameEdit)
yNameItem.setWidget(1,self.yNameEdit)
self.plt.setLabel('bottom', 'X',**LabelStyle)
self.plt.setLabel('left', 'Y',**LabelStyle)
开发者ID:ishovkun,项目名称:TCI,代码行数:59,代码来源:CalculatorPlot.py
示例16: __init__
def __init__(self, parent=None, scale_min=0, scale_max=1, steps=0.1, title='None'):
setConfigOption('background', 'w')
PlotWidget.__init__(self, parent, enableMenu=False, border=False, title=title)
self.range_ = arange(scale_min, scale_max, steps)
self.curve = self.plot(self.range_, zeros([len(self.range_)]), clear=False, pen='b')
# self.curve2 = self.plot(self.range_, zeros([len(self.range_)]) + 0.5, clear=False, pen='r')
self.disableAutoRange()
self.setRange(xRange=(scale_min, scale_max))
开发者ID:magicangleimperial,项目名称:pyscanMRI,代码行数:8,代码来源:pyqtgraphwidget.py
示例17: __init__
def __init__(self):
QtGui.QMainWindow.__init__(self)
Ui_MainWindow.__init__(self)
pg.setConfigOption('background', 'w') # sets background to white
pg.setConfigOption('foreground', 'k') # sets axis color to black
self.setupUi(self)
self.btnStart.clicked.connect(self.Start)
self.apparatus = apparatus.Apparatus()
self.btnConfig.clicked.connect(self.showConfigUI)
self.btnConnect.clicked.connect(self.connectApparatus)
self.config = config.Config()
self.configUI = config.ConfigUI(self.config,self.apparatus)
self.btnMainDir.clicked.connect(self.SetMainDir)
self.btnAutoMeasure.clicked.connect(self.autoStart)
self.connected = False
self.savetimer = QtCore.QTimer(self)
self.savetimer.timeout.connect(self.SaveData)
self.updatetimer = QtCore.QTimer(self)
self.NumCh = 4
self.pltMonitor.setMouseEnabled(x=False,y=False)
self.pltAlign.setMouseEnabled(x=False,y=False)
self.pltDelay.setMouseEnabled(x=False,y=False)
self.pltSingleVis.setMouseEnabled(x=False,y=False)
self.pltCoincVis.setMouseEnabled(x=False,y=False)
self.inAcq = False
self.clock = QtCore.QTime()
self.clock.start()
self.saving = False
self.maindir = ''
self.saveStartIndex = 0
self.saveCurIndex = 0
self.saveInterval = 30
self.savedSize = 0
self.autoIndex = 0
iters = [
[0,1], # outcome Bob1
[0,1], # Bob1
[0,1], # Bob2
[2,3] # Alice
]
self.autoBases = list(itertools.product(*iters))
self.autoAcq = False
self.measNumber = 1
self.getParameters()
开发者ID:qLuxor,项目名称:pylabtools,代码行数:58,代码来源:pol.py
示例18: main
def main():
gsac, opts = getDataOpts()
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
gui = mainGUI(gsac, opts)
### Start Qt event loop unless running in interactive mode or using pyside.
if sys.flags.interactive != 1 or not hasattr(QtCore, 'PYQT_VERSION'):
#pg.QtGui.QApplication.exec_()
gui.app.exec_()
开发者ID:pysmo,项目名称:aimbat,代码行数:9,代码来源:ttguiqt.py
示例19: main
def main():
parser = argparse.ArgumentParser("plot values from msgpack stream")
parser.add_argument("--hist", help="length of the plot-history", type=int, default=1000)
parser.add_argument("var", help="variable to plot", nargs='+')
args = parser.parse_args()
app = QtGui.QApplication([])
pg.setConfigOption('background', '#EEEEEE')
pg.setConfigOptions(antialias=True)
win = pg.GraphicsWindow(title="graph")
plot = Plot(win, histlen=args.hist)
for color_idx, var in enumerate(args.var):
plot.addLine(plot_colors[color_idx % len(plot_colors)], var)
timer = QtCore.QTimer()
timer.timeout.connect(plot.update)
timer.start(50)
class DatagramRcv(QtCore.QThread):
def __init__(self, remote, variables):
self.remote = remote
self.variables = variables
super(DatagramRcv, self).__init__()
def run(self):
context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.connect(self.remote)
for entry in self.variables:
topic, var = entry.split(':')
socket.setsockopt(zmq.SUBSCRIBE, msgpack.packb(topic))
while True:
buf = socket.recv()
unpacker = msgpack.Unpacker(encoding='ascii')
unpacker.feed(buf)
topic, data = tuple(unpacker)
for idx, var in enumerate(self.variables):
var_topic, var_path = var.split(':')
if topic == var_topic:
val = variable_path_extract_value(var_path, data)
if val is not None:
plot.lines[idx].updateData(val)
rcv_thread = DatagramRcv("tcp://localhost:5556", args.var)
rcv_thread.start()
signal.signal(signal.SIGINT, signal.SIG_DFL) # to kill on ctl-C
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
rcv_thread.terminate()
开发者ID:Stapelzeiger,项目名称:INS-board-fw,代码行数:56,代码来源:graph.py
示例20: main
def main():
# Set PyQtGraph colors
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
# Enable antialiasing for prettier plots
pg.setConfigOptions(antialias=True)
app = MyApplication(sys.argv)
sys.exit(app.exec_())
开发者ID:scls19fr,项目名称:numpy-buffer,代码行数:10,代码来源:sample_pyqtgraph_with_datetime.py
注:本文中的pyqtgraph.setConfigOption函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论