Hi,

I don't think there's an easy "switch" to turn on the behaviour you 
describe. I think you could do it by connecting to the sigResized 
<http://www.pyqtgraph.org/documentation/_modules/pyqtgraph/graphicsItems/ViewBox/ViewBox.html#ViewBox>
 
signal of the ViewBox, and calculating new values for the visible region 
and then calling setRange(). There would be a bit of work remembering old 
values of the ViewBox size, and maybe ignoring the event on initialisation 
or if your setRange() call also triggers the sigResized signal again.
With a little more work (querying the window position) then you might be 
able to differentiate between a resize from the top-left or bottom-right 
corners.

There may be an easier way to do it, but that's the only way I can think of 
at the moment.

Patrick

On Saturday, 7 March 2020 22:07:45 UTC+10:30, yunsong zhao wrote:
>
>
> Hi, there, 
> All the examples provided by pyqtgraph, changes the scale of the items in 
> a viewbox when resizing the parent window, ie, the view range retains.
> But I want to keep the scale while resizing the window.
> How to implement this. Thanks!
>

-- 
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/3eec9f68-e559-44c0-a1db-2388fb7eae6f%40googlegroups.com.

Reply via email to