On Oct 22, 2021, at 11:49 AM, Ognyan Moore <[email protected]> wrote:

Hi Israel,

Good to hear from you.  We had a lot of changes in 0.12.3 (one day we'll do a release with only a few changes), but I can't think of anything that would have broken mouse behavior. 

That said, just yesterday, I did merge an issue that does effect zooming, the issue was noticeable when the grid was displayed; but the issue it addresses is/was quite old. 

Ok, this is interesting. Apparently my minimal reproducible example attempt was a bit *too* minimal. The problem *is* related to the grid being displayed, but *primarily* with a right axis. A left axis can display the grid without significant issue, and master branch does not fix the issue.

Actually, to be anal about it, even having the grid on the left axis seems to offset the zoom point by a few pixels at least - it is noticeably different than when there is no grid, in which scenario the zoom point “sticks” to the mouse quite well - but it is nowhere near as noticeable as when using a grid on the right axis.

If you can, I would try and give `master` branch a chance

Doesn’t seem to have helped. I tried with master branch, and the behavior was the same as with previous releases.

, otherwise, if a minimum reproducible example is out of the question, I would attempt to do some kind of git bisect and see if you can zero in on the commit that started causing the problem to begin with.

Yep, I’ll start working on that. 

For what it’s worth, it appears to be somewhere between the 0.12.1 release and the 0.12.2 release.

Minimal (more or less) code example that illustrates the three options attached. To test, try positioning the mouse cursor directly above a tick mark on the X axis (say, 40), then zoom in using the scroll wheel (or two-finger drag on the trackpad, if you have that configured - that’s what I have). If it behaves the same for you, the top graph (grid on right axis) will have the tick mark shooting off to the right, the middle graph (left axis grid) will have it moving slowly to the left, and the bottom graph (no grid) will more-or-less stay put (*might* have one or two pixel offset, but might just be my cursor positioning). You’ll probably want to make the window a lot bigger first though :-)

--
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/7A15BABB-946C-4310-AFCB-91CAC3B9E242%40alaska.edu.
from PySide2.QtWidgets import QApplication, QDialog, QVBoxLayout, QLabel
import pyqtgraph as pg

if __name__ == "__main__":
    app = QApplication()
    dialog = QDialog()
    dialog.setWindowTitle("Zoom tests")

    layout = QVBoxLayout(dialog)

    vals = list(range(100))

    # Axis items for first graph
    right_axis = pg.AxisItem("right")
    right_axis.setGrid(75)
    left_axis = pg.AxisItem("left")

    # Axis items for second graph
    right_axis2 = pg.AxisItem("right")
    left_axis2 = pg.AxisItem("left")
    left_axis2.setGrid(75)

    # axis items for third graph
    right_axis3 = pg.AxisItem("right")
    left_axis3 = pg.AxisItem("left")

    # Grid on right axis, zoom point significantly offset
    plotWidget = pg.PlotWidget(dialog,
                               axisItems={
                                   'right': right_axis,
                                   'left': left_axis,
                               }
                               )

    plotWidget2 = pg.PlotWidget(dialog,
                                axisItems = {
                                    'right': right_axis2,
                                    'left': left_axis2,
                                }
                                )
    plotWidget3 = pg.PlotWidget(dialog,
                                axisItems = {
                                    'right': right_axis3,
                                    'left': left_axis3,
                                }
                                )

    plotWidget.plot(vals)
    plotWidget2.plot(vals)
    plotWidget3.plot(vals)

    layout.addWidget(QLabel("Grid on right axis, zoom significantly offset"))
    layout.addWidget(plotWidget)

    layout.addWidget(QLabel("Grid on left axis, zoom slightly offset (in opposite direction)"))
    layout.addWidget(plotWidget2)

    layout.addWidget(QLabel("No grid, zoom as expected"))
    layout.addWidget(plotWidget3)

    dialog.show()

    app.exec_()

---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320
Work: 907-474-5172
cell:  907-328-9145


Ogi

On Fri, Oct 22, 2021 at 11:00 AM Israel Brewster <[email protected]> wrote:
Just (finally!) got around to upgrading my project to pyqtgraph 0.12.3, and now rather than zooming around the mouse when using the “scroll wheel” (two-finger drag on the trackpad) to zoom in/out, it seems to zoom from some point on the left edge of the graph. Is this a change/issue with the new version of pyqtgraph, or something due to the many (many!) overrides/tweaks I have made to the behavior of pyqtgraph throughout my code?
---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320
Work: 907-474-5172
cell:  907-328-9145


--
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/D7D8C7C8-266A-480C-967D-7E3E8660BD27%40alaska.edu.

--
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/CA%2BnduTF8%3DXi20rGQxywn%3DPJYzx2B%2B_KqsR89qL4FOdzxD-RCXQ%40mail.gmail.com.

--
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/7A15BABB-946C-4310-AFCB-91CAC3B9E242%40alaska.edu.

Reply via email to