diff --git a/qcodes/plots/base.py b/qcodes/plots/base.py index 5dfcfa730ba5..8d86a1e6c423 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..1f266df07364 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 @@ -120,7 +121,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,9 +135,10 @@ 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) + geometry_settings = itertools.chain(figposition,figsize) + self.setGeometry(*geometry_settings) else: self.resize(*figsize) @@ -636,6 +638,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'] 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()}