33 from python_qt_binding.QtCore
import Slot, Qt, qVersion, qWarning, Signal
34 from python_qt_binding.QtGui
import QColor
35 from python_qt_binding.QtWidgets
import QVBoxLayout, QWidget
37 if qVersion().startswith(
'5.'):
39 from pkg_resources
import parse_version
44 return [int(x)
for x
in re.sub(
r'(\.0+)*$',
'', s).split(
'.')]
47 from pyqtgraph
import __version__
as pyqtgraph_version
53 pyqtgraph_version = pkg_resources.get_distribution(
"pyqtgraph").version
56 raise ImportError(
'A newer PyQtGraph version is required (at least 0.10 for Qt 5)')
58 from pyqtgraph
import PlotWidget, mkPen, mkBrush
64 limits_changed = Signal()
67 super(PyQtGraphDataPlot, self).
__init__(parent)
80 def add_curve(self, curve_id, curve_name, curve_color=QColor(Qt.blue), markers_on=
False):
81 pen = mkPen(curve_color, width=1)
83 symbolPen = mkPen(QColor(Qt.black))
84 symbolBrush = mkBrush(curve_color)
88 symbolPen=symbolPen, symbolBrush=symbolBrush, symbolSize=4)
94 curve_id = str(curve_id)
104 for curve
in self.
_curves.values():
113 curve = self._curves[curve_id]
114 curve.setData(data_x, data_y)
123 self.
_plot_widget.setXRange(limits[0], limits[1], padding=0)
126 self.
_plot_widget.setYRange(limits[0], limits[1], padding=0)