diff options
Diffstat (limited to 'examples/syncPlotLocation.py')
-rw-r--r-- | examples/syncPlotLocation.py | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/examples/syncPlotLocation.py b/examples/syncPlotLocation.py index 55332bc..59cfaec 100644 --- a/examples/syncPlotLocation.py +++ b/examples/syncPlotLocation.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# coding: utf-8 # /*########################################################################## # # Copyright (c) 2016-2017 European Synchrotron Radiation Facility @@ -36,7 +35,6 @@ from silx.gui.colors import Colormap class SyncPlot(qt.QMainWindow): - def __init__(self): qt.QMainWindow.__init__(self) self.setWindowTitle("Plot with synchronized axes") @@ -57,7 +55,7 @@ class SyncPlot(qt.QMainWindow): colormaps = ["gray", "red", "green", "blue"] for i in range(2 * 2): plot = Plot2D(parent=widget, backend=backend) - plot.setInteractiveMode('pan') + plot.setInteractiveMode("pan") plot.setDefaultColormap(Colormap(colormaps[i])) noisyData = silx.test.utils.add_gaussian_noise(data, mean=i / 10.0) plot.addImage(noisyData) @@ -66,18 +64,22 @@ class SyncPlot(qt.QMainWindow): xAxis = [p.getXAxis() for p in plots] yAxis = [p.getYAxis() for p in plots] - self.constraint1 = SyncAxes(xAxis, - syncLimits=False, - syncScale=True, - syncDirection=True, - syncCenter=True, - syncZoom=True) - self.constraint2 = SyncAxes(yAxis, - syncLimits=False, - syncScale=True, - syncDirection=True, - syncCenter=True, - syncZoom=True) + self.constraint1 = SyncAxes( + xAxis, + syncLimits=False, + syncScale=True, + syncDirection=True, + syncCenter=True, + syncZoom=True, + ) + self.constraint2 = SyncAxes( + yAxis, + syncLimits=False, + syncScale=True, + syncDirection=True, + syncCenter=True, + syncZoom=True, + ) for i, plot in enumerate(plots): if i % 2 == 0: @@ -102,4 +104,4 @@ if __name__ == "__main__": window = SyncPlot() window.setAttribute(qt.Qt.WA_DeleteOnClose, True) window.setVisible(True) - app.exec_() + app.exec() |