I have two plots - a top and bottom - and a LinesrRegionItem in the bottom plot used to control the top view extents.
The top plot instantiates an object that extends LinearRegionItem (MyLinearRegionItem)
- The MyLinearRegionItem takes the top plot as an __init__ param so it can
A) set the plot's RangeChange signal handler, which is then hooked to a custom updateRegion method.
The updateRegion method just calls the parent self.setRegion.
B) The MyLinearRegionItem's sigRangeChanged is connected to a local method that explicitly calls the top plot's setXRange method.
- The actual MyLinearRegionItem graphic item is added to the bottom plot.
My issue is that when I resize the linear region, the top plot refresh does not work properly under specific conditions.
The graphic items in the top plot move, but one row of pixels in each graphic item does not get erased. The same is true for an infinite line that streaks across the view. But, if I then move the LinearRegionItem, instead of resizing it, the top view will reset to a good state.
Curiously, if I do not first interact with the top plot, then the issue does not surface.
As soon as I move the top plot view in any way, the refresh problem immediately surfaces as soon I resize the linear bar in the bottom plot.
My pyqtgraph app is displaying realtime data as multiple instances of a class that subclasses pg.GraphicsObject. It is these graphics that are streaking one pixel or so at the top as I resize the bottom linear region item. The infinite line is copied 5 to 10 times, also.
Could someone please recommend a course of action to address this?
Thanks!
Hi Luke,
Thanks for the response. I'm fairly certain that this is not an issue with my custom graphic bounds.
Again, the problem only occurs after I manually resize the top plot.
There are two more observables....
- if I resize the bottom plot's linear region item _very slowly_ there are no screen artifacts
- also, when I reset the top plot's y-axis to auto, the problem goes away