From eb6ab2a22296bf1f2aac50e4dc1db28766f84dff Mon Sep 17 00:00:00 2001 From: topquark12 Date: Sun, 5 Jun 2022 14:58:42 +0800 Subject: [PATCH] add graph legends --- pytec/tecQT.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pytec/tecQT.py b/pytec/tecQT.py index aa12fb3..2070392 100644 --- a/pytec/tecQT.py +++ b/pytec/tecQT.py @@ -26,7 +26,7 @@ tec = Client() app = pg.mkQApp() mw = QtGui.QMainWindow() mw.setWindowTitle('Thermostat Control Panel') -mw.resize(800,800) +mw.resize(1024,800) cw = QtGui.QWidget() mw.setCentralWidget(cw) l = QtGui.QVBoxLayout() @@ -58,6 +58,16 @@ current0plot.addItem(Iset0curve) current1plot.addItem(tecI1curve) current1plot.addItem(Iset1curve) +temp0legend = temp0plot.getPlotItem().addLegend(brush=(50,50,200,150)) +temp0legend.addItem(temp0curve, 'feedback') +temp1legend = temp1plot.getPlotItem().addLegend(brush=(50,50,200,150)) +temp1legend.addItem(temp0curve, 'feedback') +current0legend = current0plot.getPlotItem().addLegend(brush=(50,50,200,150)) +current0legend.addItem(tecI0curve, 'feedback') +current0legend.addItem(Iset0curve, 'setpoint') +current1legend = current1plot.getPlotItem().addLegend(brush=(50,50,200,150)) +current1legend.addItem(tecI1curve, 'feedback') +current1legend.addItem(Iset1curve, 'setpoint') cnt = 0 time_stamp = np.zeros(rec_len)