def __init__(self, sandbox, *args, **kwargs):
pg.GraphicsLayoutWidget.__init__(self, **kwargs)
self.sandbox = sandbox
self.plots = [
DisplacementPlot(
sandbox,
title='North',
component=lambda m: m.north),
DisplacementPlot(
sandbox,
title='East',
component=lambda m: m.east),
DisplacementVectorPlot(
sandbox,
title='Down',
component=lambda m: m.down),
DisplacementPlot(
sandbox,
title='LOS',
component=lambda m: m.displacement)]
self.plots[-1].addHintText()
self._mov_sig = pg.SignalProxy(
self.scene().sigMouseMoved,
rateLimit=60, slot=self.mouseMoved)
for ip, plt in enumerate(self.plots):
row = ip / 2
col = ip % 2 + 1
self.addItem(plt, row=row, col=col)
plt.showGrid(x=True, y=True)
plt.hideAxis('bottom')
plt.hideAxis('left')
plt.vb.border = pg.mkPen(50, 50, 50)
if ip != 0:
plt.setXLink(self.plots[0])
plt.setYLink(self.plots[0])
def getAxis(plt, orientation, label):
axis = pg.AxisItem(
orientation=orientation,
linkView=plt.vb)
axis.setLabel(label, units='m')
return axis
plts = self.plots
self.addItem(getAxis(plts[0], 'left', 'Northing'), row=0, col=0)
self.addItem(getAxis(plts[1], 'left', 'Northing'), row=1, col=0)
self.addItem(getAxis(plts[0], 'bottom', 'Easting'), row=2, col=1)
self.addItem(getAxis(plts[1], 'bottom', 'Easting'), row=2, col=2)
for plt in self.plots:
plt.vb.menu = QtGui.QMenu(self)
评论列表
文章目录