本文整理汇总了Python中pyqtgraph.setConfigOptions函数的典型用法代码示例。如果您正苦于以下问题:Python setConfigOptions函数的具体用法?Python setConfigOptions怎么用?Python setConfigOptions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setConfigOptions函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __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)
示例2: __init__
def __init__(self):
# *******************Setup interactive plotting*********************************
self.app = QtGui.QApplication([])
self.staticLayout = QtGui.QGridLayout()
self.win = pg.GraphicsWindow(title="Basic plotting examples")
self.win.setLayout(self.staticLayout)
self.win.resize(1000, 600)
self.win.setWindowTitle('Smith_Charts')
pg.setConfigOptions(antialias=True) # Enable anti-aliasing for prettier plots
# ****************** Variable Definitions ***********************************
self.df = pd.DataFrame # where main bulk of data is stored
self.windowCount = 1
# ********************** Dynamic widgets decelerations ****************************************
self.plotTypeGroup = {}
self.plotCanvas = QtGui.QGraphicsWidget()
self.plotCanvasLayout = QtGui.QGraphicsGridLayout(self.plotCanvas)
self.filesLabel = QtGui.QLabel()
# Dictionaries to keep track of user settings
self.settings={}
self.currentSelectedWindow = 0
# Dictionaries to keep track of dynamic widgets
self.files = {}
self.filesP = {}
self.markerFreq={}
self.markerFreqP={}
self.freqSlice = {}
self.freqSlice = {}
self.colors = {}
self.canvas = {}
self.titles={}
self.titlesP={}
self.smithBoxes={}
self.smithBoxesP ={}
self.logMagBoxes={}
self.logMagBoxesP={}
self.plots = {}
self.trace = {}
self.ports = {}
self.portsP = {}
# ******************** Static widgets *****************************************************
self.staticWidgets = QtGui.QGraphicsWidget()
self.staticLayout = QtGui.QGraphicsGridLayout(self.staticWidgets)
# Data selection button
self.dataButton = QtGui.QPushButton('Grab Data')
self.dataButtonP = QtGui.QGraphicsProxyWidget()
self.dataButtonP.setWidget(self.dataButton)
self.dataButton.clicked.connect(self.GrabData)
self.staticLayout.addItem(self.dataButtonP, 0, 0)
# Number of windows
self.numberOfWindows = QtGui.QLineEdit()
self.doubleValidator = QtGui.QIntValidator()
self.numberOfWindows.setValidator(self.doubleValidator)
self.numberOfWindows.textChanged.connect(self.ValidateWindowCount)
self.numberOfWindows.setStyleSheet('background-color:black;border-style: outset;color: rgb(255,255,255)')
self.numberOfWindows.setPlaceholderText("How Many Data Windows")
self.numberOfWindowsP = QtGui.QGraphicsProxyWidget()
self.numberOfWindowsP.setWidget(self.numberOfWindows)
self.staticLayout.addItem(self.numberOfWindowsP, 0, 1)
self.staticWidgets.setLayout(self.staticLayout)
self.win.addItem(self.staticWidgets, 0, 0, 1, 1)
示例3: create_window
def create_window():
win = QtGui.QMainWindow()
win.resize(1000,600)
win.setWindowTitle('HypnoPy')
pg.setConfigOptions(antialias=True) # Enable antialiasing for prettier plots
plot_widget = create_plot_widget('Spiral')
sidebar_width = 200
slider_widget1 = create_slider_widget(label='SPL threshold',
unit='dB',
min_value=-50,
max_value=50,
init_value=0,
step=1,
connect=_update_SPL_THRESHOLD,
max_width=sidebar_width)
slider_widget2 = create_slider_widget(label='Window size',
unit='',
min_value=256,
max_value=len(get_buffer()),
init_value=len(get_buffer()),
step=2,
connect=_update_WINDOW_SIZE,
max_width=sidebar_width)
sidebar = create_sidebar(sidebar_width, slider_widget1, slider_widget2)
layout = pg.LayoutWidget()
layout.addWidget(plot_widget)
layout.addWidget(sidebar)
layout.show()
return layout, plot_widget
示例4: __init__
def __init__(self):
"""
Constructor
"""
self.win.resize(1400, 800)
self.win.setWindowTitle("Attitude plots")
pg.setConfigOptions(antialias=True)
# self.win2.resize(1000,600)
# self.win2.setWindowTitle('Following control')
self.buildQuaternion()
self.buildTheta()
self.buildX()
self.buildXDot()
self.win.nextRow()
self.buildThetaDot()
self.buildTorque()
self.buildA()
self.buildMotor()
# self.buildMoveX()
# self.buildMoveY()
# self.buildMoveZ()
timer = QtCore.QTimer()
timer.timeout.connect(self.update)
timer.start(50)
示例5: __init__
def __init__(self, conn, ide, sensor, numCanal):
super(QObject, self).__init__()
self.conn = conn
self.sensor = sensor
self.ide = ide
self.numCanal = numCanal
pg.setConfigOptions(antialias=True)
self.dlg = QDialog()
self.plotDlg = Ui_PlotDlg()
self.plotDlg.setupUi(self.dlg)
self.dlg.setWindowModality(Qt.ApplicationModal)
self.plot = pg.PlotWidget(parent=None, background='default', labels={'left': ('Temperature', 'ºC')},
axisItems={'bottom': TimeAxisItem(orientation='bottom')})
self.plot.setObjectName("plot")
self.plotDlg.verticalLayout.addWidget(self.plot)
self.dlg.show()
self.curve = self.plot.plot()
self.plot.enableAutoRange()
self.curve.curve.setClickable(True)
self.plot.showGrid(x=True, y=True, alpha=0.5)
self.plotDlg.dayButton.clicked.connect(self.dayData)
self.plotDlg.hourButton.clicked.connect(self.hourData)
self.plotDlg.weekButton.clicked.connect(self.weekData)
self.plotDlg.monthButton.clicked.connect(self.monthData)
self.plotDlg.yearButton.clicked.connect(self.yearData)
self.plot.sigRangeChanged.connect(self.plotClicked)
self.plot.scene().sigMouseMoved.connect(self.mouseMoved)
#self.cpoint = pg.CurvePoint(self.curve)
#self.plot.addItem(self.cpoint)
self.label = pg.TextItem(anchor=(0, 0))
#self.label.setParentItem(self.cpoint)
self.plot.addItem(self.label)
self.plotDlg.dayButton.setFocus()
self.dayData()
示例6: initUi
def initUi(self):
"""初始化界面"""
portfolio = self.portfolio
self.setWindowTitle(u'波动率图表')
pg.setConfigOptions(antialias=True) #启用抗锯齿
# 创建绘图区以及线
for chain in portfolio.chainDict.values():
symbol = chain.symbol + CALL_SUFFIX
chart = self.addPlot(title=symbol)
chart.showGrid(x=True, y=True)
chart.setLabel('left', u'波动率') #设置左边标签
chart.setLabel('bottom', u'行权价') #设置底部标签
self.bidCurveDict[symbol] = chart.plot(pen='r', symbol='t', symbolSize=8, symbolBrush='r')
self.askCurveDict[symbol] = chart.plot(pen='g', symbolSize=8, symbolBrush='g')
self.pricingCurveDict[symbol] = chart.plot(pen='w', symbol = 's', symbolSize=8, symbolBrush='w')
self.nextRow()
for chain in portfolio.chainDict.values():
symbol = chain.symbol + PUT_SUFFIX
chart = self.addPlot(title=symbol)
chart.showGrid(x=True, y=True)
chart.setLabel('left', u'波动率')
chart.setLabel('bottom', u'行权价')
self.bidCurveDict[symbol] = chart.plot(pen='r', symbol='t', symbolSize=8, symbolBrush='r')
self.askCurveDict[symbol] = chart.plot(pen='g', symbolSize=8, symbolBrush='g')
self.pricingCurveDict[symbol] = chart.plot(pen='w', symbol = 's', symbolSize=8, symbolBrush='w')
示例7: plotting
def plotting():
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
app = QtGui.QApplication([])
pg.setConfigOptions(antialias=True)
win = pg.GraphicsWindow(title="examples")
win.resize(1000,600)
win.setWindowTitle('Plotting')
a = win.addPlot(title=title[0][6:title[0].find(',')])
a.plot(listing[0], listing[1])
a.showGrid(x=True, y=True)
for i in range(2, len(listing), 2):
print i
if i % 3 == 0:
win.nextRow()
p1 = win.addPlot(title=title[i/ 2][6:title[i/2].find(',')])
p1.plot(listing[i], listing[i + 1])
p1.showGrid(x=True, y=True)
p1.setXLink(a)
p1.setYLink(a)
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
示例8: init_gui
def init_gui(self):
# create a window with 14 plots (7 rows x 2 columns)
## create a window with 8 plots (4 rows x 2 columns)
win = pg.GraphicsWindow(title="Trigno display")
win.resize(1000,600)
win.setWindowTitle('Trigno display')
pg.setConfigOptions(antialias=True)
#cols, rows = 2, 4
cols = 2
rows = self.config.nchan / cols
self.npt = 2000
self.axes = np.empty((rows, cols), dtype=object)
for i in xrange(rows):
for j in xrange(cols):
ax = win.addPlot(title="EMG%d" % (i * cols + j))
#ax.disableAutoRange(axis=None)
self.axes[i,j] = ax.plot(np.random.normal(1,1, size=432*3))
win.nextRow()
self.old_data = np.zeros((self.config.nchan, self.npt))
self.new_data = np.zeros((self.config.nchan, self.npt))
timer = QtCore.QTimer(self)
timer.connect(timer, QtCore.SIGNAL("timeout()"), self.timer_event)
timer.start(0)
示例9: __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_()
示例10: onZipfPlot
def onZipfPlot(self):
before = time.time()
pg.setConfigOptions(antialias=True)
dialog= QtGui.QDialog(self)
plotWidget = pg.PlotWidget(name='Zipf\'s Law Plot')
logx = self.model.getLogX()
ab = self.model.getPolyFit()
s = ScatterPlotItem(logx, self.model.getLogfreqDist(), size=4, pen=None, brush=pg.mkBrush(255, 255, 255))
s.addPoints(logx, self.model.getLogfreqDist())
plot = plotWidget.plot(logx, [self.model.getPoly(x) for x in logx], pen=(0,255,255), size=4)
legend = LegendItem((130,60), offset=(500,30))
legend.setParentItem(plotWidget.getPlotItem())
legend.addItem(s, 'Corpus data')
legend.addItem(plot, str(round(ab[0], 3)) + 'x + ' +str(round(ab[1], 3)))
plotWidget.addItem(s)
lay = QtGui.QVBoxLayout()
lay.addWidget(plotWidget)
dialog.setLayout(lay)
dialog.show()
self.fillTimeData("creating Zipf plot", time.time() - before)
示例11: __init__
def __init__(self, parent=None):
pg.GraphicsWindow.__init__(self, title="Spectrum Analyzer")
self.resize(400,300)
self.setWindowTitle('Spectrum Analyzer')
pg.setConfigOptions(antialias=True)
self.plot_item = self.addPlot(title='Time Domain - u(t)', labels={'left': 'u(t)', 'bottom': 't'})
self.plot_samples()
示例12: initUI
def initUI(self):
win = pg.GraphicsLayoutWidget()
win.resize(1000, 600)
win.setWindowTitle(u"Node: "+unicode(self.parent().name()))
# Enable anti-aliasing for prettier plots
pg.setConfigOptions(antialias=True)
# Add Label where coords of current mouse position will be printed
self.coordLabel = pg.LabelItem(justify='right')
win.addItem(self.coordLabel)
#add custom datetime axis
x_axis1 = DateAxisItem(orientation='bottom')
x_axis2 = DateAxisItem(orientation='bottom')
self.y_axis1 = pg.AxisItem(orientation='left') # keep reference to itm since we want to modify its label
self.y_axis2 = pg.AxisItem(orientation='left') # keep reference to itm since we want to modify its label
self.p1 = win.addPlot(row=1, col=0, axisItems={'bottom': x_axis1, 'left': self.y_axis1})
#self.p1.setClipToView(True)
self.p2 = win.addPlot(row=2, col=0, axisItems={'bottom': x_axis2, 'left': self.y_axis2}, enableMenu=False, title=' ')
#self.p1.setClipToView(True)
self.vb = self.p1.vb # ViewBox
self.zoomRegion = pg.LinearRegionItem()
self.zoomRegion.setZValue(-10)
self.zoomRegion.setRegion([1000, 2000])
self.p2.addItem(self.zoomRegion, ignoreBounds=True)
self.p1.setAutoVisible(y=True)
self.legend = self.p1.addLegend()
self.initCrosshair()
self.win = win
示例13: plotting
def plotting():
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
ts = listing[0]
gids = listing[1]
#QtGui.QApplication.setGraphicsSystem('raster')
app = QtGui.QApplication([])
#mw = QtGui.QMainWindow()
#mw.resize(800,800)
# Enable antialiasing for prettier plots
pg.setConfigOptions(antialias=True)
win = pg.GraphicsWindow(title="Basic plotting examples")
win.resize(1000,600)
win.setWindowTitle('pyqtgraph example: Plotting')
p4 = win.addPlot(title="Parametric, grid enabled")
p4.plot(ts, gids)
p4.showGrid(x=True, y=True)
## Start Qt event loop unless running in interactive mode or using pyside.
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
QtGui.QApplication.instance().exec_()
示例14: setup_graphics
def setup_graphics(app):
print("setup graphics")
global curve1, curve2, win, timer
win = pg.GraphicsWindow(title="Basic plotting examples")
win.resize(1000,600)
win.setWindowTitle('pyqtgraph example: Plotting')
# Enable antialiasing for prettier plots
pg.setConfigOptions(antialias=True)
# add the main plot
p = win.addPlot(title="ADC1")
p.showGrid(x=True, y=True)
p.setRange(xRange=[0, 45000], yRange=[0, 256])
curve1 = p.plot(pen='y')
curve2 = p.plot(pen='r')
#data = np.random.normal(size=(10,1000))
#ptr = 0
timer = QtCore.QTimer()
timer.timeout.connect(update_plot)
timer.start(50)
print("timer set")
示例15: main
def main():
print "Starting main"
win = QtGui.QMainWindow()
cw = QtGui.QWidget()
#component = DoubleBusRing()
component = SingleBusCROW()
lbda_step = 0.00001
lbdas = np.arange(1.5455,1.5485+lbda_step,lbda_step)
manip = Manipulate(component, lbdas)
cw.setLayout(manip.layout)
win.setCentralWidget(cw)
win.show()
win.setCentralWidget(cw)
pg.setConfigOptions(antialias=True)
win.setGeometry(100,100,1200,600)
win.setWindowTitle('Analysor')
import sys
pg.setConfigOptions(useWeave=False)
print "Hello"
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
print "Running"
QtGui.QApplication.instance().exec_()
print "Done"