summaryrefslogtreecommitdiffstats
path: root/pyk8055/pyplotA.py
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-06-06 00:12:52 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-06-06 00:12:52 +0200
commit9ce77cecba9e782aebeecc1801f42a64a5159106 (patch)
tree860aec0e5774b89475094ded1b0f0cff74d77f8c /pyk8055/pyplotA.py
parenta4c1219a7557aa23bea4836913f4049a6d02c560 (diff)
downloadk8055-9ce77cecba9e782aebeecc1801f42a64a5159106.zip
k8055-9ce77cecba9e782aebeecc1801f42a64a5159106.tar.gz
pyplotA.py and pyplotD.py are fixed
Diffstat (limited to 'pyk8055/pyplotA.py')
-rwxr-xr-xpyk8055/pyplotA.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/pyk8055/pyplotA.py b/pyk8055/pyplotA.py
index e520c40..7f8799a 100755
--- a/pyk8055/pyplotA.py
+++ b/pyk8055/pyplotA.py
@@ -23,21 +23,24 @@ class DataPlot(QwtPlot):
self.a2 = zeros(len(self.x), Float)
self.setTitle("Simple K8055 datascope")
- #self.setAutoLegend(True)
+ self.insertLegend(Qwt.QwtLegend(), Qwt.QwtPlot.BottomLegend);
self.curve1 = QwtPlotCurve("Input 1")
self.curve2 = QwtPlotCurve("Input 2")
+ self.curve1.attach(self)
+ self.curve2.attach(self)
+
self.curve1.setPen(QPen(Qt.red))
- self.curve2.setPen(QPen(Qt.blue))
+ self.curve2.setPen(QPen(Qt.green))
# No automatic scaling, set y-scale 0-255
self.setAxisScale(QwtPlot.yLeft,0,255,50)
- # set marker line in the middle - value 128
- #mY = self.insertLineMarker("", QwtPlot.yLeft)
- mY = QwtPlotMarker()
- #self.setMarkerYPos(mY, 128.0)
+ mY = Qwt.QwtPlotMarker()
+ mY.setLineStyle(Qwt.QwtPlotMarker.HLine)
+ mY.setYValue(128.0)
+ mY.attach(self)
self.setAxisTitle(QwtPlot.xBottom, "Time (seconds)")
self.setAxisTitle(QwtPlot.yLeft, "Values")
@@ -59,7 +62,7 @@ class DataPlot(QwtPlot):
self.a2[0] = self.k.ReadAnalogChannel(2)
self.curve1.setData(self.x, self.a1)
- self.curve1.setData(self.x, self.a2)
+ self.curve2.setData(self.x, self.a2)
self.replot()
# timerEvent()