From 7763aee79f70a7ae4e65594441a8720b281ee9f8 Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Tue, 15 Nov 2016 16:23:00 +0100 Subject: [PATCH 1/5] use window_title as parameter --- qcodes/plots/pyqtgraph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcodes/plots/pyqtgraph.py b/qcodes/plots/pyqtgraph.py index ceb2d1084392..044104c7399f 100644 --- a/qcodes/plots/pyqtgraph.py +++ b/qcodes/plots/pyqtgraph.py @@ -120,7 +120,7 @@ class QtPlot(QWidget, BasePlot): """ def __init__(self, *args, figsize=(1000, 600), figposition=None, - interval=0.25, windowtitle=None, theme=((60, 60, 60), 'w'), + interval=0.25, window_title=None, theme=((60, 60, 60), 'w'), show_window=True, parent=None, **kwargs): QWidget.__init__(self, parent=parent) # Set base interval to None to disable that JS update-widget thingy @@ -134,7 +134,7 @@ def __init__(self, *args, figsize=(1000, 600), figposition=None, self.interval = interval self.auto_updating = False - self.setWindowTitle(windowtitle or 'Plotwindow') + self.setWindowTitle(window_title or 'Plotwindow') if figposition: self.setGeometry(*figposition, *figsize) else: From b1acd1d97c6b4a7a32fd1f6aa49f10934e1c1779 Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Tue, 15 Nov 2016 16:23:46 +0100 Subject: [PATCH 2/5] update requirements for pyqtgraph --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0dc6e2e769f9..815ac519ed83 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def readme(): extras = { 'MatPlot': ('matplotlib', '1.5'), - 'QtPlot': ('pyqtgraph', '0.9.10'), + 'QtPlot': ('pyqtgraph', '0.9.11'), 'coverage tests': ('coverage', '4.0') } extras_require = {k: '>='.join(v) for k, v in extras.items()} From be5bc0103b6d0c04454be75268c921e81d6b54fc Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Tue, 15 Nov 2016 16:25:55 +0100 Subject: [PATCH 3/5] fix for python 3.4 --- qcodes/plots/pyqtgraph.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qcodes/plots/pyqtgraph.py b/qcodes/plots/pyqtgraph.py index 044104c7399f..e595b3dda76c 100644 --- a/qcodes/plots/pyqtgraph.py +++ b/qcodes/plots/pyqtgraph.py @@ -3,6 +3,7 @@ """ import numpy as np +import itertools from qtpy import QtCore, QtGui, QtWidgets from qtpy.QtWidgets import QWidget, QShortcut, QHBoxLayout @@ -136,7 +137,8 @@ def __init__(self, *args, figsize=(1000, 600), figposition=None, self.setWindowTitle(window_title or 'Plotwindow') if figposition: - self.setGeometry(*figposition, *figsize) + geometry_settings = itertools.chain(figposition,figsize) + self.setGeometry(*geometry_settings) else: self.resize(*figsize) From 188d01b100ecc9381b24cc0a972ae76000799d62 Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Wed, 16 Nov 2016 23:09:05 +0100 Subject: [PATCH 4/5] fix live plotting --- qcodes/plots/base.py | 10 ++++++++++ qcodes/plots/pyqtgraph.py | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/qcodes/plots/base.py b/qcodes/plots/base.py index b3de438c60a3..723e015b837a 100644 --- a/qcodes/plots/base.py +++ b/qcodes/plots/base.py @@ -279,6 +279,16 @@ def expand_trace(self, args, kwargs): if axletter not in kwargs: kwargs[axletter] = set_array + def update(self): + """ + Update the data in this plot, using the updaters given with + MatPlot.add() or in the included DataSets, then include this in + the plot. + This is a wrapper routine that the update widget calls, + inside this we call self.update() which should be subclassed + """ + self.update_data() + def update_data(self): """ Update the data in this plot, using the updaters given with diff --git a/qcodes/plots/pyqtgraph.py b/qcodes/plots/pyqtgraph.py index ceb2d1084392..ebeefacca8bf 100644 --- a/qcodes/plots/pyqtgraph.py +++ b/qcodes/plots/pyqtgraph.py @@ -636,6 +636,17 @@ def _update_labels(self, subplot_object, config): units = self.get_units(config[axletter]) ax.setLabel(label, units) + def update(self): + """ + Update the data in this plot, using the updaters given with + MatPlot.add() or in the included DataSets, then include this in + the plot. + This is a wrapper routine that the update widget calls, + inside this we call self.update() which should be subclassed + """ + BasePlot.update(self) + QWidget.update(self) + def update_plot(self): for trace in self.traces: config = trace['config'] From 7248ade71dbd04b83ebeb320bb01e82e55a254b9 Mon Sep 17 00:00:00 2001 From: Pieter Eendebak Date: Wed, 16 Nov 2016 23:09:05 +0100 Subject: [PATCH 5/5] fix live plotting