There are three containers here: PlotWidget (the Qt widget) contains a PlotItem (the Qt graphics item), which contains two AxisItems and a ViewBox. So to get the ViewBox from the PlotWidget, it's `plotwidget.plotItem.vb`.
On Wed, May 2, 2018 at 11:20 PM, Ankit Kakkar <[email protected]> wrote: > Hi Luke, > > Thanks for the suggestion. This seems good. > > However, on line 65 of the crosshair example, it says: > > vb = p1.vb > > This line doesn't seems to work for me. As in my case, p1 refers to > PlotWidget, which does not have any attribute as vb. Could you please > elaborate on what does it mean? > > If it refers to ViewBox(), then do I need to add another viewbox inside my > plotwidget ? > > > > On Wednesday, May 2, 2018 at 7:30:17 PM UTC+5:30, Luke Campagnola wrote: >> >> Hi Ankit, >> Have a look at examples/crosshair.py; that should help. >> >> On Tue, May 1, 2018 at 10:20 PM, Ankit Kakkar <[email protected]> >> wrote: >> >>> Hi, >>> >>> How can we get the real-time X, Y position on mouse hover on m >>> PlotWidget? >>> >>> >>> I have attached a screenshot of the functionality (anything similar) i >>> want. >>> >>> -- >>> 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/ms >>> gid/pyqtgraph/996cc060-277e-4516-a718-664fc515cff5%40googlegroups.com >>> <https://groups.google.com/d/msgid/pyqtgraph/996cc060-277e-4516-a718-664fc515cff5%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > 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/1c65ad03-91b7-4c82-a942-bb938bfb9e3f%40googlegroups.com > <https://groups.google.com/d/msgid/pyqtgraph/1c65ad03-91b7-4c82-a942-bb938bfb9e3f%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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/CACZXET9qRW25AaHDJ2S3mgkSbhpSP--K-KiZ3SYk%3DmzuT%2BBH8A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
