title: How to have a fast crosshair mouse cursor for subplots in matplotlib?
body: <p>In this video of <code>backtrader</code>'s <code>matplotlib</code> implementation <a href="https://youtu.be/m6b4Ti4P2HA?t=2008" rel="nofollow noreferrer">https://youtu.be/m6b4Ti4P2HA?t=2008</a> I can see that a default and very fast and CPU saving crosshair mouse cursor seems to exist in <code>matplotlib</code>.</p>
  <p>I would like to have the same kind of mouse cursor for a simple multi subplot plot in <code>matplotlib</code> like this:</p>
  <pre><code>import numpy as np
  import matplotlib
  
  matplotlib.use('QT5Agg')
  matplotlib.rcParams['figure.figsize'] = (20.0, 22.0)
  import matplotlib.pyplot as plt
  
  fig = plt.figure()
  ax1 = plt.subplot(2, 1, 1)
  ax2 = plt.subplot(2, 1, 2, sharex=ax1)
  
  ax1.plot(np.array(np.random.rand(100)))
  ax2.plot(np.array(np.random.rand(100)))
  
  plt.show()
  </code></pre>
  <p>So, if I am with my mouse in the lower subplot, I want to see directly and very precisely, which value of x/y in the lower plot corresponds to which value pair in the upper plot.</p>
  <p>I have found other solutions to do this but they seem to be very slow compared to the implementation in the video.</p>