Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions qcodes/plots/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 16 additions & 3 deletions qcodes/plots/pyqtgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import numpy as np
import itertools

from qtpy import QtCore, QtGui, QtWidgets
from qtpy.QtWidgets import QWidget, QShortcut, QHBoxLayout
Expand Down Expand Up @@ -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
Expand All @@ -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)

Expand Down Expand Up @@ -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']
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()}
Expand Down