Hello!
I am new to pyqtgraph and would like to draw a line plot and under the line plot a simple line with a rectangle (see line.jpg). The Lineplot is no problem, everything is working fine but is there any possibility to add a simple line with rectangle under the plot? It can be outside or inside the plot but the line should show up under the line of the plot (see plot.jpg).
# Set up a window with plotimport pyqtgraph as pgwin = pg.GraphicsWindow()plt = win.addPlot()plt.plot(x=[0, 0.1, 0.2, 0.3, 0.4], y=[1, 7, 2, 4, 3])# Add a ViewBox below with two rectanglesvb = win.addViewBox(col=0, row=1)r1 = pg.QtGui.QGraphicsRectItem(0, 0, 0.4, 1)r1.setPen(pg.mkPen(None))r1.setBrush(pg.mkBrush('r'))vb.addItem(r1)r2 = pg.QtGui.QGraphicsRectItem(0.2, -5, 0.1, 10)r2.setPen(pg.mkPen((0, 0, 0, 100)))r2.setBrush(pg.mkBrush((50, 50, 200)))vb.addItem(r2)# Make the ViewBox flatvb.setMaximumHeight(70)# Force y-axis to be always auto-scaledvb.setMouseEnabled(y=False)vb.enableAutoRange(y=True)# Force x-axis to match the plot abovevb.setXLink(plt)