Thanks Patrick! Unfortunately, negative spacings don't work with 
QGraphicsGridLayout objects. In fact, I didn't find a layout which does 
support overlapping items.

Since I have much more than two plots, it would be cumbersome to try to put 
all in one cell.

I had one last idea which I'm not sure will work either, but is it possible 
to disable (vertical) clipping for a given viewbox? I didn't find anything 
in either the PyQtGraph or the Qt API, but maybe I missed something.

If nothing works, I guess writing a custom layout based on QGraphicsLayout 
which supports overlapping rows would still be an option.

Clemens

On Wednesday, February 10, 2021 at 5:13:20 AM UTC+1 Patrick wrote:

> Hi,
>
> I really don't know if this will work, but since GraphicsLayout uses a Qt 
> QGraphicsGridLayout internally to position the plots, you could try setting 
> negative spacing 
> <https://doc.qt.io/qt-5/qgraphicsgridlayout.html#setRowSpacing> for it. 
> Maybe something like:
>
> graphicslayout.layout.setRowSpacing(row=0, -50)
>
> If that doesn't accept negative values, then I'm not too sure. I believe 
> it's possible to put two plots into the same row and column of the layout, 
> and maybe you could then adjust each plots alignment and size. Anyway, 
> hopefully looking through the QGraphicsGridLayout API might give some ideas.
>
> Patrick
>
> On Wednesday, 10 February 2021 at 2:26:29 am UTC+10:30 
> [email protected] wrote:
>
>> Hello!
>>
>> I would like to create multiple plots in rows, which is relatively 
>> straightforward using pg.GraphicsLayout() and the addPlot() method. 
>> However,  rows created like that do not overlap. Is there a way how I can 
>> (gradually) let them overlap so that the plots e.g. overlap by 20% on the 
>> y-axis?
>>
>> Thanks!
>> Clemens
>>
>

-- 
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/f562e725-cb69-4ee7-aabc-f259de1d2c52n%40googlegroups.com.

Reply via email to