I suspect this is related https://github.com/pyqtgraph/pyqtgraph/issues/1187
I'm concerned this is some Qt behavior that would be tricky to work around,
but I haven't gotten a chance to look into it much. One idea for a
workaround would be to use a LayoutWidget with separate PlotWidgets inside,
so changing your example to something like this:
win = pg.LayoutWidget()
win.showMaximized()
plots = []
for i in range(2):
for j in range(2):
pw = pg.PlotWidget()
win.addWidget(pw)
plots.append(pw)
win.nextRow()
On Friday, October 2, 2020 at 6:14:03 AM UTC-7 [email protected] wrote:
>
> Plots with scientific notation on the ylabel appear smaller than other
> plots in a GraphicsLayoutWidget after using setData.
>
> In the example below, the width of the first column shrinks after setting
> the data in each plot.
>
> from pyqtgraph.Qt import QtGui, QtCore
> import pyqtgraph as pg
> import random
>
> app = QtGui.QApplication([])
> # create layout and add 4 plots to it in 2x2 grid
> win = pg.GraphicsLayoutWidget(show=True)
> win.showMaximized()
> plots = []
> for i in range(2):
> for j in range(2):
> plots.append(win.addPlot())
> win.nextRow()
>
> # create plotdataitem for each plot
> lines = [p.plot() for p in plots]
>
>
> # add random data, with 1 plot much larger range than the rest
> def update():
> lines[0].setData(range(100), [random.gauss(1e7, 1e5) for i in
> range(100)])
> for line in lines[1:4]:
> line.setData(range(100), [random.gauss(0, 1) for i in range(100)])
>
>
> # update()
> timer = QtCore.QTimer()
> timer.timeout.connect(update)
> timer.start(2000)
> app.exec_()
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/dd05ed23-aea3-4f1e-91a9-c9740b0f950en%40googlegroups.com.