Replace deprecate class in examples
Using class GraphicsLayoutWidget to replace the deprecated class GraphicsWindow, cc #631.
This commit is contained in:
parent
ae2f0c155f
commit
afd8a6f423
@ -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()
|
||||||
|
@ -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()
|
||||||
|
@ -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
|
||||||
|
@ -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')
|
||||||
|
|
||||||
|
@ -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()
|
||||||
|
@ -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')
|
||||||
|
|
||||||
|
@ -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')
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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)
|
||||||
|
@ -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()
|
||||||
|
@ -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)
|
||||||
|
@ -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))
|
||||||
|
@ -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')
|
||||||
|
|
||||||
|
|
||||||
|
@ -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)
|
||||||
|
@ -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()
|
||||||
|
@ -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])
|
||||||
|
@ -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)
|
||||||
|
@ -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")
|
||||||
|
@ -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()
|
||||||
|
|
||||||
|
@ -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')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user