0

I'm using pyqt and matplotlib to plot a bunch of graphs in a GUI. At this point I only have x,y coordinates on the bottom-right of the plot which dynamically change when I hover my mouse over a graph (this is a default function of the NavigationToolbar library in pyQt). This is what I see:

enter image description here

Here is some code for the Navbar -

self.mpl_toolbar = NavigationToolbar(self.canvas, self.mainFrame)

And this is the Navigation Bar I get on my GUI:

enter image description here

But I want a cursor function where I can click on the plot and I have a fixed x,y position like in matlab. See the image below for an example:

enter image description here

Is there a way to add cursors to the NavigationToolbar library? If so, how can I do this using pyQt?

I have looked at the pyQt + matplotlib documentation and all I can find is how to modify the NavigationToolbar to reduce the number of features on it.

DavidG
  • 24,279
  • 14
  • 89
  • 82
ragzputin
  • 397
  • 3
  • 5
  • 20
  • You're right. For some reason I wasn't able to find this question. Thanks! – ragzputin Jul 18 '16 at 19:54
  • Actually, the thread you linked only accounts for when the mouse hovers over the graph. I don't think it works when the user clicks on the graph. – ragzputin Jul 19 '16 at 00:02

0 Answers0