Hello all,
I want to use have multiple plots with only one X axis, as shown in the GraphicsLayout example, where it seems to work as expected. But when I try it myself, the ViewBoxes of the items have different sizes, while I want (and would expect) the ViewBoxes to have the same size for all plots. I think it might be related to the size of the window - if the ViewBox is small, it seems to be correct, only if it grows, it gets out of proportion.
What am I doing wrong? How can I avoid this behavior?
Thanks,
Jo
import sys
from PySide2.QtWidgets import QApplication
import pyqtgraph as pg
if __name__ == "__main__":
app = QApplication(sys.argv)
win = pg.GraphicsLayoutWidget(border=(50, 0, 0))
p1 = win.addPlot(y=[1, 3, 2])
win.nextRow()
p2 = win.addPlot(y=[3, 1, 2])
p1.showAxis('bottom', False) # leaving this out makes the ViewBoxes same size
win.show()
sys.exit(app.exec_())