Replace deprecate class in examples

Using class GraphicsLayoutWidget to replace the deprecated class
GraphicsWindow, cc #631.
This commit is contained in:
Billy Su 2018-02-16 12:15:32 +08:00
parent ae2f0c155f
commit afd8a6f423
20 changed files with 20 additions and 20 deletions

View File

@ -12,7 +12,7 @@ import numpy as np
# Enable antialiasing for prettier plots # Enable antialiasing for prettier plots
pg.setConfigOptions(antialias=True) pg.setConfigOptions(antialias=True)
w = pg.GraphicsWindow() w = pg.GraphicsLayoutWidget(show=True)
w.setWindowTitle('pyqtgraph example: CustomGraphItem') w.setWindowTitle('pyqtgraph example: CustomGraphItem')
v = w.addViewBox() v = w.addViewBox()
v.setAspectLocked() v.setAspectLocked()

View File

@ -13,7 +13,7 @@ import numpy as np
# Enable antialiasing for prettier plots # Enable antialiasing for prettier plots
pg.setConfigOptions(antialias=True) pg.setConfigOptions(antialias=True)
w = pg.GraphicsWindow() w = pg.GraphicsLayoutWidget(show=True)
w.setWindowTitle('pyqtgraph example: GraphItem') w.setWindowTitle('pyqtgraph example: GraphItem')
v = w.addViewBox() v = w.addViewBox()
v.setAspectLocked() v.setAspectLocked()

View File

@ -10,7 +10,7 @@ import pyqtgraph as pg
app = QtGui.QApplication([]) app = QtGui.QApplication([])
win = pg.GraphicsWindow(title="Plotting items examples") win = pg.GraphicsLayoutWidget(show=True, title="Plotting items examples")
win.resize(1000,600) win.resize(1000,600)
# Enable antialiasing for prettier plots # Enable antialiasing for prettier plots

View File

@ -12,7 +12,7 @@ import pyqtgraph as pg
app = QtGui.QApplication([]) app = QtGui.QApplication([])
win = pg.GraphicsWindow(title="Basic plotting examples") win = pg.GraphicsLayoutWidget(show=True, title="Basic plotting examples")
win.resize(1000,600) win.resize(1000,600)
win.setWindowTitle('pyqtgraph example: LogPlotTest') win.setWindowTitle('pyqtgraph example: LogPlotTest')

View File

@ -9,7 +9,7 @@ import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui from pyqtgraph.Qt import QtCore, QtGui
import numpy as np import numpy as np
win = pg.GraphicsWindow() win = pg.GraphicsLayoutWidget(show=True)
win.setWindowTitle('pyqtgraph example: PanningPlot') win.setWindowTitle('pyqtgraph example: PanningPlot')
plt = win.addPlot() plt = win.addPlot()

View File

@ -16,7 +16,7 @@ app = QtGui.QApplication([])
#mw = QtGui.QMainWindow() #mw = QtGui.QMainWindow()
#mw.resize(800,800) #mw.resize(800,800)
win = pg.GraphicsWindow(title="Plot auto-range examples") win = pg.GraphicsLayoutWidget(show=True, title="Plot auto-range examples")
win.resize(800,600) win.resize(800,600)
win.setWindowTitle('pyqtgraph example: PlotAutoRange') win.setWindowTitle('pyqtgraph example: PlotAutoRange')

View File

@ -17,7 +17,7 @@ app = QtGui.QApplication([])
#mw = QtGui.QMainWindow() #mw = QtGui.QMainWindow()
#mw.resize(800,800) #mw.resize(800,800)
win = pg.GraphicsWindow(title="Basic plotting examples") win = pg.GraphicsLayoutWidget(show=True, title="Basic plotting examples")
win.resize(1000,600) win.resize(1000,600)
win.setWindowTitle('pyqtgraph example: Plotting') win.setWindowTitle('pyqtgraph example: Plotting')

View File

@ -33,7 +33,7 @@ arr[8:13, 44:46] = 10
## create GUI ## create GUI
app = QtGui.QApplication([]) app = QtGui.QApplication([])
w = pg.GraphicsWindow(size=(1000,800), border=True) w = pg.GraphicsLayoutWidget(show=True, size=(1000,800), border=True)
w.setWindowTitle('pyqtgraph example: ROI Examples') w.setWindowTitle('pyqtgraph example: ROI Examples')
text = """Data Selection From Image.<br>\n text = """Data Selection From Image.<br>\n

View File

@ -13,7 +13,7 @@ pg.setConfigOptions(imageAxisOrder='row-major')
## create GUI ## create GUI
app = QtGui.QApplication([]) app = QtGui.QApplication([])
w = pg.GraphicsWindow(size=(800,800), border=True) w = pg.GraphicsLayoutWidget(show=True, size=(800,800), border=True)
v = w.addViewBox(colspan=2) v = w.addViewBox(colspan=2)
v.invertY(True) ## Images usually have their Y-axis pointing downward v.invertY(True) ## Images usually have their Y-axis pointing downward
v.setAspectLocked(True) v.setAspectLocked(True)

View File

@ -9,7 +9,7 @@ from pyqtgraph.Qt import QtCore, QtGui
import numpy as np import numpy as np
pg.mkQApp() pg.mkQApp()
win = pg.GraphicsWindow() win = pg.GraphicsLayoutWidget(show=True)
win.setWindowTitle('pyqtgraph example: ScaleBar') win.setWindowTitle('pyqtgraph example: ScaleBar')
vb = win.addViewBox() vb = win.addViewBox()

View File

@ -11,7 +11,7 @@ from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg import pyqtgraph as pg
app = QtGui.QApplication([]) app = QtGui.QApplication([])
win = pg.GraphicsWindow(title="Scatter Plot Symbols") win = pg.GraphicsLayoutWidget(show=True, title="Scatter Plot Symbols")
win.resize(1000,600) win.resize(1000,600)
pg.setConfigOptions(antialias=True) pg.setConfigOptions(antialias=True)

View File

@ -16,7 +16,7 @@ x = np.arange(1000, dtype=float)
y = np.random.normal(size=1000) y = np.random.normal(size=1000)
y += 5 * np.sin(x/100) y += 5 * np.sin(x/100)
win = pg.GraphicsWindow() win = pg.GraphicsLayoutWidget(show=True)
win.setWindowTitle('pyqtgraph example: ____') win.setWindowTitle('pyqtgraph example: ____')
win.resize(1000, 800) win.resize(1000, 800)
win.ci.setBorder((50, 50, 100)) win.ci.setBorder((50, 50, 100))

View File

@ -14,7 +14,7 @@ import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui from pyqtgraph.Qt import QtCore, QtGui
import numpy as np import numpy as np
win = pg.GraphicsWindow() win = pg.GraphicsLayoutWidget(show=True)
win.setWindowTitle('pyqtgraph example: context menu') win.setWindowTitle('pyqtgraph example: context menu')

View File

@ -13,7 +13,7 @@ from pyqtgraph.Point import Point
#generate layout #generate layout
app = QtGui.QApplication([]) app = QtGui.QApplication([])
win = pg.GraphicsWindow() win = pg.GraphicsLayoutWidget(show=True)
win.setWindowTitle('pyqtgraph example: crosshair') win.setWindowTitle('pyqtgraph example: crosshair')
label = pg.LabelItem(justify='right') label = pg.LabelItem(justify='right')
win.addItem(label) win.addItem(label)

View File

@ -8,7 +8,7 @@ import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui from pyqtgraph.Qt import QtCore, QtGui
import numpy as np import numpy as np
win = pg.GraphicsWindow() win = pg.GraphicsLayoutWidget(show=True)
win.resize(800,350) win.resize(800,350)
win.setWindowTitle('pyqtgraph example: Histogram') win.setWindowTitle('pyqtgraph example: Histogram')
plt1 = win.addPlot() plt1 = win.addPlot()

View File

@ -20,7 +20,7 @@ data = np.concatenate([data, data], axis=0)
data = pg.gaussianFilter(data, (10, 10, 10))[frames/2:frames + frames/2] data = pg.gaussianFilter(data, (10, 10, 10))[frames/2:frames + frames/2]
data[:, 15:16, 15:17] += 1 data[:, 15:16, 15:17] += 1
win = pg.GraphicsWindow() win = pg.GraphicsLayoutWidget(show=True)
win.setWindowTitle('pyqtgraph example: Isocurve') win.setWindowTitle('pyqtgraph example: Isocurve')
vb = win.addViewBox() vb = win.addViewBox()
img = pg.ImageItem(data[0]) img = pg.ImageItem(data[0])

View File

@ -20,7 +20,7 @@ app = QtGui.QApplication([])
x = np.linspace(-50, 50, 1000) x = np.linspace(-50, 50, 1000)
y = np.sin(x) / x y = np.sin(x) / x
win = pg.GraphicsWindow(title="pyqtgraph example: Linked Views") win = pg.GraphicsLayoutWidget(show=True, title="pyqtgraph example: Linked Views")
win.resize(800,600) win.resize(800,600)
win.addLabel("Linked Views", colspan=2) win.addLabel("Linked Views", colspan=2)

View File

@ -11,7 +11,7 @@ import pyqtgraph as pg
app = QtGui.QApplication([]) app = QtGui.QApplication([])
w = pg.GraphicsWindow() w = pg.GraphicsLayoutWidget(show=True)
w.setWindowTitle('pyqtgraph example: logAxis') w.setWindowTitle('pyqtgraph example: logAxis')
p1 = w.addPlot(0,0, title="X Semilog") p1 = w.addPlot(0,0, title="X Semilog")
p2 = w.addPlot(1,0, title="Y Semilog") p2 = w.addPlot(1,0, title="Y Semilog")

View File

@ -17,7 +17,7 @@ from pyqtgraph import Point
app = pg.QtGui.QApplication([]) app = pg.QtGui.QApplication([])
w = pg.GraphicsWindow(border=0.5) w = pg.GraphicsLayoutWidget(show=True, border=0.5)
w.resize(1000, 900) w.resize(1000, 900)
w.show() w.show()

View File

@ -8,7 +8,7 @@ import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui from pyqtgraph.Qt import QtCore, QtGui
import numpy as np import numpy as np
win = pg.GraphicsWindow() win = pg.GraphicsLayoutWidget(show=True)
win.setWindowTitle('pyqtgraph example: Scrolling Plots') win.setWindowTitle('pyqtgraph example: Scrolling Plots')