title: Annotation alignment when interactively redrawing figure
body: <p>I started from the code in <a href="https://stackoverflow.com/a/47166787/2504700">this other answer</a>, and I modified a part of it, in order to always show the labels when hovering towards the center of the plot:</p>
  
  <pre class="lang-py prettyprint-override"><code>...
  
  annot = ax.annotate("", xy=(0,0), xytext=(0,0),textcoords="offset points",
                      bbox=dict(boxstyle="round", fc="w"),
                      arrowprops=dict(arrowstyle="-&gt;"))
  annot.set_visible(False)
  xmid = np.mean(ax.get_xlim())                                                 
  ymid = np.mean(ax.get_ylim())
  offset = 20
  
  def update_annot(ind):
  
      pos = sc.get_offsets()[ind["ind"][0]]
      annot.xy = pos
      annot.xytext = (-offset if pos[0] &gt; xmid else offset, 
                      -offset if pos[1] &gt; ymid else offset)
      text = "    {}, {}    ".format(" ".join(list(map(str,ind["ind"]))), 
                             " ".join([names[n] for n in ind["ind"]]))
      annot.set_text(text)
      annot.get_bbox_patch().set_facecolor(cmap(norm(c[ind["ind"][0]])))
      annot.get_bbox_patch().set_alpha(0.4)
      annot.set_ha("right" if pos[0] &gt; xmid else "left")
      annot.set_va("top" if pos[1] &gt; ymid else "bottom")
  
  ...
  </code></pre>
  
  <p>which yields the following output:</p>
  
  <p><a href="https://i.stack.imgur.com/VR3qT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VR3qT.png" alt="bad1"></a></p>
  
  <p>and two more examples <a href="https://i.stack.imgur.com/jbOSg.png" rel="nofollow noreferrer">here</a> and <a href="https://i.stack.imgur.com/pLX82.png" rel="nofollow noreferrer">here</a>. Which is not the expected output. The arrow is in the correct direction, and the text nearly the desired one, but it is aligned to the data point instead of being aligned to the end of the arrow.</p>
  
  <p>What I expected to get is what is achieved using the same arguments when calling <code>ax.annotate</code> (without interactively modifying the annotation) which is the following behaviour:</p>
  
  <p><a href="https://i.stack.imgur.com/3VZ2g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3VZ2g.png" alt="enter image description here"></a></p>